Date: Fri, 13 Apr 2001 04:01:25 -0700 From: Alfred Perlstein <bright@wintelcom.net> To: Bruce Evans <bde@zeta.org.au> Cc: Jonathan Lemon <jlemon@flugsvamp.com>, tlambert@primenet.com, current@FreeBSD.ORG Subject: Re: SOMAXCONN -- not tunable? Message-ID: <20010413040125.E976@fw.wintelcom.net> In-Reply-To: <Pine.BSF.4.21.0104131501390.13944-100000@besplex.bde.org>; from bde@zeta.org.au on Fri, Apr 13, 2001 at 03:24:35PM %2B1000 References: <200104130008.f3D08nM61301@prism.flugsvamp.com> <Pine.BSF.4.21.0104131501390.13944-100000@besplex.bde.org>
next in thread | previous in thread | raw e-mail | index | archive | help
* Bruce Evans <bde@zeta.org.au> [010412 22:25] wrote: > On Thu, 12 Apr 2001, Jonathan Lemon wrote: > > > In article <local.mail.freebsd-current/200104111854.LAA25459@usr07.primenet.com> you write: > > >Here are patches to make SOMAXCONN tunable from the config files. > > > > > >Right now, it's not possible to override SOMAXCONN. > > > > sysctl -w kern.ipc.somxconn=1024 > > > > SOMAXCONN is just a compile time default, and yes it is not > > currently tunable at config time. Does it really have to be? > > Of course it doesn't have to be tunable at config time. > > > Just stick it in /etc/sysctl.conf, and it gets set before most > > things are started in the system. > > Changing the actual limit using either the sysctl or an option breaks > SOMAXCONN. I think the correct fix is to never define it change > whatever uses it to use sysconf(_SC_SOMAXCONN). Similarly for all > other manifest constants that aren't actually constant. Actually, the correct fix is most likely to redefine it to -1. :) Either that or remove it from the namespace. Or just leave it alone, afaik listen called with a backlog larger than the sysctl limit just truncates it down to that limit. What do you think? /usr/src % grep -r SOMAXCON * contrib/perl5/ext/Socket/Socket.pm: SOMAXCONN contrib/perl5/ext/Socket/Socket.pm:sub SOMAXCONN (); contrib/perl5/ext/Socket/Socket.xs: if (strEQ(name, "SOMAXCONN")) contrib/perl5/ext/Socket/Socket.xs:#ifdef SOMAXCONN contrib/perl5/ext/Socket/Socket.xs: return SOMAXCONN; contrib/perl5/lib/Exporter.pm: use Socket qw(!/^[AP]F_/ !SOMAXCONN !SOL_SOCKE T); contrib/perl5/pod/perlipc.pod: listen(Server,SOMAXCONN) || die "listen: $!"; contrib/perl5/pod/perlipc.pod: listen(Server,SOMAXCONN) || die "listen: $!"; contrib/perl5/pod/perlipc.pod: listen(Server,SOMAXCONN) || die "listen: $!"; contrib/perl5/pod/perlipc.pod:is SOMAXCONN. contrib/perl5/pod/perlipc.pod: Listen => SOM AXCONN, contrib/perl5/t/lib/ph.t: SOCK_RAW SOCK_RDM SOCK_SEQPACKET SOCK_STREAM SOL_SO CKET SOMAXCONN contrib/sendmail/libmilter/libmilter.h:#if SOMAXCONN > 20 contrib/sendmail/libmilter/libmilter.h:# define MI_SOMAXCONN SOMAXCONN contrib/sendmail/libmilter/libmilter.h:#else /* SOMAXCONN */ contrib/sendmail/libmilter/libmilter.h:# define MI_SOMAXCONN 20 contrib/sendmail/libmilter/libmilter.h:#endif /* SOMAXCONN */ contrib/sendmail/libmilter/main.c:static int backlog= MI_SOMAXCONN; crypto/heimdal/kadmin/kadm_conn.c: if (listen (s, SOMAXCONN) < 0) { crypto/heimdal/kdc/connect.c: if(type == SOCK_STREAM && listen(d->s, SOMAXCON N) < 0){ crypto/heimdal/lib/kadm5/ipropd_master.c: if (listen(fd, SOMAXCONN) < 0) crypto/heimdal/lib/roken/mini_inetd.c: if (listen (fds[i], SOMAXCONN) < 0) crypto/heimdal/lib/roken/roken-common.h:#ifndef SOMAXCONN crypto/heimdal/lib/roken/roken-common.h:#define SOMAXCONN 5 crypto/kerberosIV/ChangeLog: * appl/kx/kx.h: Remove SOMAXCONN and add KX_PORT crypto/kerberosIV/ChangeLog: fallback definitions for SOMAXCONN, STDIN_FILENO , and crypto/kerberosIV/appl/kx/common.c: && listen (s[i].fd, SOMAXCONN) < 0) crypto/kerberosIV/appl/kx/kxd.c: if (listen (sock, SOMAXCONN) < 0) { crypto/kerberosIV/kadmin/admin_server.c: if (listen(admin_fd, SOMAXCONN) < 0) crypto/kerberosIV/lib/roken/mini_inetd.c: if(listen(s, SOMAXCONN) < 0){ crypto/kerberosIV/lib/roken/mini_inetd.c: if(listen(s, SOMAXCONN) < 0){ crypto/kerberosIV/lib/roken/roken-common.h:#ifndef SOMAXCONN crypto/kerberosIV/lib/roken/roken-common.h:#define SOMAXCONN 5 crypto/kerberosIV/server/kerberos.c: listen(sock, SOMAXCONN); crypto/kerberosIV/slave/kpropd.c: ret = listen(s, SOMAXCONN); crypto/openssl/crypto/bio/b_sock.c:#define MAX_LISTEN SOMAXCONN lib/libc/net/getaddrinfo.3: if (listen(s[nsock], SOMAXCONN) < 0) { lib/libc/rpc/rpc_soc.c: _listen(fd, SOMAXCONN); lib/libc/rpc/svc_generic.c: _listen(fd, SOMAXCONN); sbin/mountd/mountd.c: listen(tcpsock, SOMAXCONN); sbin/mountd/mountd.c: listen(tcp6sock, SOMAXCONN); sys/conf/options:SOMAXCONN opt_inet.h sys/kern/uipc_socket.c:static int somaxconn = SOMAXCONN; sys/kern/uipc_socket.c:SYSCTL_INT(_kern_ipc, KIPC_SOMAXCONN, somaxconn, CTLFLAG_ RW, sys/sys/socket.h:#ifndef SOMAXCONN sys/sys/socket.h:#define SOMAXCONN 128 sys/sys/sysctl.h:#define KIPC_SOMAXCONN 3 /* int: max leng th of connection q */ usr.sbin/rpcbind/rpcbind.c: listen(fd, SOMAXCONN); -- -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] http://www.egr.unlv.edu/~slumos/on-netbsd.html To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010413040125.E976>