INN commit: trunk (12 files)
INN Commit
rra at isc.org
Wed Jun 9 13:41:33 UTC 2021
Date: Wednesday, June 9, 2021 @ 06:41:33
Author: iulius
Revision: 10554
inn.conf: Add new parameter for listen backlog
Allow to tune the length of the queue of pending connections to innd,
nnrpd and some overview storage methods (ovdb for INN 2.6.5 and both
ovdb and ovsqlite for INN 2.7.0). 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:
trunk/CONTRIBUTORS
trunk/doc/pod/inn.conf.pod
trunk/doc/pod/news.pod
trunk/frontends/ovdb_server.c
trunk/include/inn/innconf.h
trunk/include/inn/options.h
trunk/innd/lc.c
trunk/innd/rc.c
trunk/lib/innconf.c
trunk/nnrpd/nnrpd.c
trunk/samples/inn.conf.in
trunk/storage/ovsqlite/ovsqlite-server.c
------------------------------------+
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 +
storage/ovsqlite/ovsqlite-server.c | 2 +-
12 files changed, 26 insertions(+), 9 deletions(-)
Modified: CONTRIBUTORS
===================================================================
--- CONTRIBUTORS 2021-03-26 19:11:25 UTC (rev 10553)
+++ CONTRIBUTORS 2021-06-09 13:41:33 UTC (rev 10554)
@@ -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-03-26 19:11:25 UTC (rev 10553)
+++ doc/pod/inn.conf.pod 2021-06-09 13:41:33 UTC (rev 10554)
@@ -1467,6 +1467,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 two overview storage methods (C<ovdb> and
+C<ovsqlite>). 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-03-26 19:11:25 UTC (rev 10553)
+++ doc/pod/news.pod 2021-06-09 13:41:33 UTC (rev 10554)
@@ -26,6 +26,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-03-26 19:11:25 UTC (rev 10553)
+++ frontends/ovdb_server.c 2021-06-09 13:41:33 UTC (rev 10554)
@@ -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-03-26 19:11:25 UTC (rev 10553)
+++ include/inn/innconf.h 2021-06-09 13:41:33 UTC (rev 10554)
@@ -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-03-26 19:11:25 UTC (rev 10553)
+++ include/inn/options.h 2021-06-09 13:41:33 UTC (rev 10554)
@@ -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-03-26 19:11:25 UTC (rev 10553)
+++ innd/lc.c 2021-06-09 13:41:33 UTC (rev 10554)
@@ -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-03-26 19:11:25 UTC (rev 10553)
+++ innd/rc.c 2021-06-09 13:41:33 UTC (rev 10554)
@@ -1841,7 +1841,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-03-26 19:11:25 UTC (rev 10553)
+++ lib/innconf.c 2021-06-09 13:41:33 UTC (rev 10554)
@@ -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-03-26 19:11:25 UTC (rev 10553)
+++ nnrpd/nnrpd.c 2021-06-09 13:41:33 UTC (rev 10554)
@@ -1192,7 +1192,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-03-26 19:11:25 UTC (rev 10553)
+++ samples/inn.conf.in 2021-06-09 13:41:33 UTC (rev 10554)
@@ -188,6 +188,7 @@
keepmmappedthreshold: 1024
#maxcmdreadsize:
maxforks: 10
+maxlisten: 128
nicekids: 4
nicenewnews: 0
nicennrpd: 0
Modified: storage/ovsqlite/ovsqlite-server.c
===================================================================
--- storage/ovsqlite/ovsqlite-server.c 2021-03-26 19:11:25 UTC (rev 10553)
+++ storage/ovsqlite/ovsqlite-server.c 2021-06-09 13:41:33 UTC (rev 10554)
@@ -342,7 +342,7 @@
#else
make_inet_listener();
#endif
- if (listen(listensock, MAXLISTEN)==-1)
+ if (listen(listensock, innconf->maxlisten)==-1)
sysdie("cannot listen on socket");
fdflag_nonblocking(listensock, 1);
FD_SET(listensock, &read_fds);
More information about the inn-committers
mailing list