Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Aug 1997 11:24:26 +1000 (EST)
From:      "Daniel O'Callaghan" <danny@panda.hilink.com.au>
To:        freebsd-hackers@freebsd.org
Subject:   Listen queue overflows and SOMAXCONN
Message-ID:  <Pine.BSF.3.91.970808105311.242C-100000@panda.hilink.com.au>

next in thread | raw e-mail | index | archive | help


I have a Web server which is getting busy and the listen queue is 
overflowing.  Kernel is 2.1.5; binaries are 2.1.7.1.
Sysctl reports kern.maxconn=128

Now please don't scream and shout, because I have good reasons for doing 
what I am doing, but I am running the web servers out of inetd. I want to 
continue to do so if at all possible. I have rebuilt inetd with 
listen(...,128) for SOCK_STREAM.  inetd runs at about 0.4% CPU according 
to 'top'.

By using the ipfw rule 'allow tcp from any to any 80 in tcpflags syn' I can
count the number of syn packets received, and I have been recording 
number of syns in 10 second periods.  It averages 17 and has peaked at 40 
between 10am and 11am today.  In the same period there were 269 listen 
queue overflows, for about 4600 actual connections.

~reboot
Fri Aug  8 09:04:24 EST 1997	2 listen queue overflows
Fri Aug  8 09:25:02 EST 1997	22 listen queue overflows
Fri Aug  8 10:00:00 EST 1997	96 listen queue overflows
Fri Aug  8 10:17:41 EST 1997	172 listen queue overflows
Fri Aug  8 10:59:21 EST 1997	365 listen queue overflows

If I have to, I will stop running the servers out of inetd, or build 
another machine to share the load, but I'm sure FreeBSD should be able to 
handle this load easily.  The machine is a P133 on Gigabyte 512k m/b 48MB 
RAM, ncr scsi with SCSI-2 disks.  top says load average=0.3 and Idle=90%
There are 254 IP addresses aliased to lo0.

'netstat -m' says 94 mbufs in use; 29/168 mbufclusters in use.

Does anyone have any ideas about what could be the problem, and how 
to fix it.  I have been planning to upgrade the machine to 2.2.2-RELENG - 
should I plan faster?

/*  Daniel O'Callaghan                                                     */
/*  HiLink Internet <http://www.hilink.com.au/>;       danny@hilink.com.au  */
/*  FreeBSD - works hard, plays hard...                 danny@freebsd.org  */




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.91.970808105311.242C-100000>