INN commit: branches/2.6 (11 files)
INN Commit
rra at isc.org
Wed Jun 9 13:50:13 UTC 2021
Date: Wednesday, June 9, 2021 @ 06:50:12
Author: iulius
Revision: 10555
inn.conf: Add new parameter for listen backlog
Allow to tune the length of the queue of pending connections to innd,
nnrpd and the ovdb overview storage method. The maxlisten parameter now
permits configuring their listen backlog, whose previously hard-coded
values were 128 for nnrpd and 25 for the others, which was not high
enough for some uses.
The default value is now 128 for all of them, and configurable in
inn.conf.
Thanks to Kevin Bowling for the patch.
Modified:
branches/2.6/CONTRIBUTORS
branches/2.6/doc/pod/inn.conf.pod
branches/2.6/doc/pod/news.pod
branches/2.6/frontends/ovdb_server.c
branches/2.6/include/inn/innconf.h
branches/2.6/include/inn/options.h
branches/2.6/innd/lc.c
branches/2.6/innd/rc.c
branches/2.6/lib/innconf.c
branches/2.6/nnrpd/nnrpd.c
branches/2.6/samples/inn.conf.in
-------------------------+
CONTRIBUTORS | 2 +-
doc/pod/inn.conf.pod | 7 +++++++
doc/pod/news.pod | 10 ++++++++++
frontends/ovdb_server.c | 2 +-
include/inn/innconf.h | 1 +
include/inn/options.h | 3 ---
innd/lc.c | 2 +-
innd/rc.c | 2 +-
lib/innconf.c | 1 +
nnrpd/nnrpd.c | 2 +-
samples/inn.conf.in | 1 +
11 files changed, 25 insertions(+), 8 deletions(-)
Modified: CONTRIBUTORS
===================================================================
--- CONTRIBUTORS 2021-06-09 13:41:33 UTC (rev 10554)
+++ CONTRIBUTORS 2021-06-09 13:50:12 UTC (rev 10555)
@@ -278,4 +278,4 @@
Tim Fardell, Remco Rijnders, David Binderman, Tony Evans, Christian Garbs,
Jesse Rehmer, Colin Watson, Lauri Tirkkonen, Christian Mock, Marcus Jodorf,
Richard Kettlewell, Yuriy M. Kaminskiy, Bill Parker, Thomas Hochstein,
-Tanguy Ortolo, Michael Baeuerle
+Tanguy Ortolo, Michael Baeuerle, Kevin Bowling
Modified: doc/pod/inn.conf.pod
===================================================================
--- doc/pod/inn.conf.pod 2021-06-09 13:41:33 UTC (rev 10554)
+++ doc/pod/inn.conf.pod 2021-06-09 13:50:12 UTC (rev 10555)
@@ -1455,6 +1455,13 @@
How many times to attempt a fork(2) before giving up. The default value
is C<10>.
+=item I<maxlisten>
+
+How many incoming connections can queue up in the listen backlog for
+B<innd>, B<nnrpd> and the C<ovdb> overview storage method. The default
+value is C<128> and should be raised in case you notice that some
+connection requests get dropped.
+
=item I<nicekids>
If set to anything other than C<0>, all child processes of innd(8) will
Modified: doc/pod/news.pod
===================================================================
--- doc/pod/news.pod 2021-06-09 13:41:33 UTC (rev 10554)
+++ doc/pod/news.pod 2021-06-09 13:50:12 UTC (rev 10555)
@@ -7,6 +7,16 @@
The F<inn.conf> default value for I<tlsprotocols> no longer contains
TLS versions 1.0 and 1.1, which have been deprecated by S<RFC 8996>.
+=item *
+
+A new F<inn.conf> parameter has been added to tune the length of the
+queue of pending connections to B<innd>, B<nnrpd> and the C<ovdb>
+overview storage method: the I<maxlisten> parameter now permits
+configuring their listen backlog, whose previously hard-coded values
+were C<128> for B<nnrpd> and C<25> for the others, which was not high
+enough for some uses. The default value is now C<128> for all of them,
+and configurable in F<inn.conf>. Thanks to Kevin Bowling for the patch.
+
=back
=head1 Changes in 2.6.4
Modified: frontends/ovdb_server.c
===================================================================
--- frontends/ovdb_server.c 2021-06-09 13:41:33 UTC (rev 10554)
+++ frontends/ovdb_server.c 2021-06-09 13:50:12 UTC (rev 10555)
@@ -678,7 +678,7 @@
if(ret != 0)
sysdie("cannot bind socket");
- if(listen(listensock, MAXLISTEN) < 0)
+ if(listen(listensock, innconf->maxlisten) < 0)
sysdie("cannot listen on socket");
pidfile = concatpath(innconf->pathrun, OVDB_SERVER_PIDFILE);
Modified: include/inn/innconf.h
===================================================================
--- include/inn/innconf.h 2021-06-09 13:41:33 UTC (rev 10554)
+++ include/inn/innconf.h 2021-06-09 13:50:12 UTC (rev 10555)
@@ -177,6 +177,7 @@
unsigned long keepmmappedthreshold; /* Threshold for keeping mmap in buffindexed */
unsigned long maxcmdreadsize; /* Max NNTP command read size used by innd */
unsigned long maxforks; /* Give up after this many fork failure. */
+ unsigned long maxlisten; /* Max listen() backlog */
long nicekids; /* Child processes get niced to this */
unsigned long nicenewnews; /* If NEWNEWS command is used, nice to this */
unsigned long nicennrpd; /* nnrpd is niced to this */
Modified: include/inn/options.h
===================================================================
--- include/inn/options.h 2021-06-09 13:41:33 UTC (rev 10554)
+++ include/inn/options.h 2021-06-09 13:50:12 UTC (rev 10555)
@@ -66,9 +66,6 @@
throttle.) */
#define IO_ERROR_COUNT 50
-/* Length of listen queue for innd. */
-#define MAXLISTEN 25
-
/* The standard NNTP port. */
#define NNTP_PORT 119
Modified: innd/lc.c
===================================================================
--- innd/lc.c 2021-06-09 13:41:33 UTC (rev 10554)
+++ innd/lc.c 2021-06-09 13:50:12 UTC (rev 10555)
@@ -91,7 +91,7 @@
}
/* Set it up to wait for connections. */
- if (listen(i, MAXLISTEN) < 0) {
+ if (listen(i, innconf->maxlisten) < 0) {
syslog(L_FATAL, "%s cant listen %s %m", LogName, LCpath);
exit(1);
}
Modified: innd/rc.c
===================================================================
--- innd/rc.c 2021-06-09 13:41:33 UTC (rev 10554)
+++ innd/rc.c 2021-06-09 13:50:12 UTC (rev 10555)
@@ -1839,7 +1839,7 @@
for (i = 0; i < count; i++) {
if (fds[i] < 0)
continue;
- if (listen(fds[i], MAXLISTEN) < 0) {
+ if (listen(fds[i], innconf->maxlisten) < 0) {
if (i != 0 && errno == EADDRINUSE)
continue;
syswarn("SERVER cant listen to socket");
Modified: lib/innconf.c
===================================================================
--- lib/innconf.c 2021-06-09 13:41:33 UTC (rev 10554)
+++ lib/innconf.c 2021-06-09 13:50:12 UTC (rev 10555)
@@ -118,6 +118,7 @@
{ K(groupbaseexpiry), BOOL (true) },
{ K(mailcmd), STRING (NULL) },
{ K(maxforks), UNUMBER (10) },
+ { K(maxlisten), UNUMBER (128) },
{ K(mta), STRING (NULL) },
{ K(nicekids), NUMBER (4) },
{ K(ovmethod), STRING (NULL) },
Modified: nnrpd/nnrpd.c
===================================================================
--- nnrpd/nnrpd.c 2021-06-09 13:41:33 UTC (rev 10554)
+++ nnrpd/nnrpd.c 2021-06-09 13:50:12 UTC (rev 10555)
@@ -1190,7 +1190,7 @@
FD_ZERO(&lfdset);
for (j = 0; j < lfdcount; j++) {
- if (listen(lfds[j], 128) < 0) {
+ if (listen(lfds[j], innconf->maxlisten) < 0) {
if (j != 0 && errno == EADDRINUSE)
continue;
syslog(L_ERROR, "can't listen to socket");
Modified: samples/inn.conf.in
===================================================================
--- samples/inn.conf.in 2021-06-09 13:41:33 UTC (rev 10554)
+++ samples/inn.conf.in 2021-06-09 13:50:12 UTC (rev 10555)
@@ -188,6 +188,7 @@
keepmmappedthreshold: 1024
#maxcmdreadsize:
maxforks: 10
+maxlisten: 128
nicekids: 4
nicenewnews: 0
nicennrpd: 0
More information about the inn-committers
mailing list