Skip to content

Commit

Permalink
Actualize documentation about file descriptors
Browse files Browse the repository at this point in the history
Better explain limits, with a link to the Solaris documentation.
Improve wording and actualize the numbers for current systems.
  • Loading branch information
Julien-Elie committed Jul 8, 2023
1 parent 010ee22 commit 573b8f3
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 29 deletions.
21 changes: 13 additions & 8 deletions doc/pod/inn.conf.pod
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ C<tradindexed>, and this is set to a value other than C<0>, INN will keep
around and open that many recently written-to overview files in case more
articles come in for those newsgroups. Every overview cache slot consumes
two file descriptors, so be careful not to set this value too high. You
may be able to use the C<limit> command to see how many open file
may be able to use the C<ulimit -n> command to see how many open file
descriptors your operating system allows. innd(8) also uses an open file
descriptor for each incoming feed and outgoing channel or batch file, and
if it runs out of open file descriptors, it may throttle and stop accepting
Expand Down Expand Up @@ -1560,8 +1560,8 @@ If set to anything other than C<0>, maximum buffer size (in bytes) for
reading NNTP command will have this value. It should not be large on
systems which are slow to process and store articles, as that would lead
to innd(8) spending a long time on each channel and keeping other channels
waiting. The default value is BUFSIZ defined in stdio.h (C<1024> in most
environments, see setbuf(3)).
waiting. The default value is BUFSIZ defined in stdio.h (usually between
C<1024> and C<8192> in most environments, see setbuf(3)).

=item I<maxforks>

Expand Down Expand Up @@ -1619,15 +1619,20 @@ innd closes it. The default value is C<3600> (an hour).
The maximum number of file descriptors that innd(8) or innfeed(8) can have
open at once. If innd(8) or innfeed(8) attempts to open more file
descriptors than this value, it is possible the program may throttle or
otherwise suffer reduced functionality. The number of open file
descriptors is roughly the maximum number of incoming feeds and outgoing
otherwise malfunction or suffer reduced functionality. The number of open
file descriptors is roughly the maximum number of incoming feeds and outgoing
batches for innd(8) and the number of outgoing streams for innfeed(8). If
this parameter is set to a negative value, the default limit of the
operating system will be used; this will normally be adequate on systems
other than Solaris. Nearly all operating systems have some hard maximum
limit beyond which this value cannot be raised, usually either 128, 256,
or 1024. The default value of this parameter is C<-1>. Setting it to
C<256> on Solaris systems is highly recommended.
limit beyond which this value cannot be raised, usually either 256, 1024,
or 65536. The default value of this parameter is C<-1>.

Setting this parameter to C<256> on Solaris systems is highly
recommended for 32-bit Solaris versions prior to 11.4, or 64-bit
Solaris versions prior to 11.0. See the L<Solaris documentation about file
descriptors|https://support.oracle.com/knowledge/Sun%20Microsystems/1005979_1.html>
for more details.

=back

Expand Down
8 changes: 5 additions & 3 deletions doc/pod/innfeed.conf.pod
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,11 @@ If the value is greater than zero, then whenever a network socket file
descriptor is created and it has a value I<less than> this, the file
descriptor will be dup'ed to bring the value up greater than this. This is
to leave lower numbered file descriptors free for stdio. Certain systems,
Sun's in particular, require this. SunOS 4.1.x usually requires a value
of 128 and Solaris requires a value of 256. The default if this is not
specified, is C<0>.
Sun's in particular, require this. SunOS 4.1.x usually requires a value of
128, 32-bit Solaris versions prior to 11.4 and 64-bit Solaris versions prior
to 11.0 require a value of 256. See the L<Solaris documentation about file
descriptors|https://support.oracle.com/knowledge/Sun%20Microsystems/1005979_1.html>
for more details. The default if this is not specified, is C<0>.

=back

Expand Down
35 changes: 17 additions & 18 deletions doc/pod/install.pod
Original file line number Diff line number Diff line change
Expand Up @@ -1679,33 +1679,32 @@ And it is also a good practice to refresh each day INN's cached IP addresses:

30 2 * * * <pathbin in inn.conf>/ctlinnd -t 120 -s reload incoming.conf 'flush cache'


=head1 File Descriptor Limits

INN likes to use a lot of file descriptors, particularly if you have a lot
of peers. Depending on what your system defaults are, you may need to
make sure the default limit is increased for INN (particularly for B<innd>
and B<innfeed>). This is vital on Solaris, which defaults (at least as of
2.6) to an absurdly low limit of 64 file descriptors per process.

One way to increase the number of file descriptors is to set
I<rlimitnofile> in F<inn.conf> to a higher value. This will cause B<innd>
and B<innfeed> to try to increase the file descriptor limits when they
start. Note, however, that INN won't be able to increase the limits above
the hard limits set by your operating system; on some systems, that hard
limit is normally 256 file descriptors (Linux, for example). On others,
like Solaris, it's 1024. Increasing the limit beyond that value may
require serious system configuration work. (On some operating systems, it
requires patching and recompiling the kernel. On Solaris it can be
changed in F</etc/system>, but for 2.6 or earlier the limit cannot be
increased beyond 1024 without breaking select(2) and thereby breaking all
of INN. For current versions of Linux, you may be able to change the
maximum by writing to F</proc/sys/fs/file-max>.)
and B<innfeed>). This is vital on Solaris, which defaults to an absurdly
low limit of 64 file descriptors per process up to Solaris 7, and 256 up to
Solaris 11.4 SRU 26 included.

One way to increase the number of file descriptors is to set I<rlimitnofile>
in F<inn.conf> to a higher value. This will cause B<innd> and B<innfeed> to
try to increase the file descriptor limits when they start. Note, however,
that INN won't be able to increase the limits above the hard limits set by
your operating system, usually either 256, 1024, or 65536 (see the value
of C<FD_SETSIZE> in the F<sys/select.h> system header). Increasing the
limit beyond that value may require serious system configuration work.
(On some operating systems, it requires patching and recompiling the kernel.
On Solaris, it can be changed in F</etc/system>, but for 2.6 or earlier the
limit cannot be increased beyond 1024 without breaking select(2) and thereby
breaking all of INN. For current versions of Linux, you may be able to change
the maximum with the C<ulimit -n> command.)

256 file descriptors will probably be enough for all but the largest
sites. There is no harm in setting the limits higher than you actually
need (provided they're set to something lower than or equal to your system
hard limit). C<256> is therefore a reasonable value to try.
hard limit). C<256> or C<1024> are therefore reasonable values to try.

If you're installing INN on a Solaris system, particularly if you're
installing it on a dedicated news server machine, it may be easier to just
Expand Down

0 comments on commit 573b8f3

Please sign in to comment.