httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Slemko <ma...@znep.com>
Subject Re: WWW Form Bug Report: "sockets left in FIN_WAIT_2 lingering state" on SunOS 4.x (fwd)
Date Sat, 21 Dec 1996 22:03:39 GMT
On Thu, 19 Dec 1996, Chuck Murcko wrote:

> # Network options.  NMBCLUSTERS defines the number of mbufs and defaults to 
> # 256.  This machine is a gateway that handles lots of traffic, so we boost
> # that value.
> options         SOMAXCONN=256           # max pending connects

Note that, unlike in BSD/OS, in FreeBSD SOMAXCONN is not wrapped by an
ifndef, so defining it in your kenel config file won't work very well.  To
modify it on FreeBSD the best way would be to use sysctl to modify
"kern.somaxconn" after boot.  OTOH, it defaults to 128 in recent version
of FreeBSD which is far more than BSD/OS defaulted to (16) last I checked.

> options         NMBCLUSTERS=4096        # clusters to spare(maybe)!

When I last checked BSD/OS, it hardcoded NMBCLUSTERS.  FreeBSD does it
based on maxusers using:
	int     nmbclusters = 512 + MAXUSERS * 16;

which is reasonable in many cases.

> 
> Size of an mbuf_cluster in 4.4lite BSD is 16 kB. So, it's a compromise
> as to where you want to set that value. Remember, you're sacrificing
> RAM that could be running user procs by bumping it up.

I thought mbuf clusters were around 1 or 2 Kbytes on most architectures?

FreeBSD's sys/i386/include/param.h:

 #ifndef MCLSHIFT
 #define MCLSHIFT        11              /* convert bytes to m_buf clusters */
 #endif  /* MCLSHIFT */
 #define MCLBYTES        (1 << MCLSHIFT) /* size of an m_buf cluster */
 #define MCLOFSET        (MCLBYTES - 1)  /* offset within an m_buf cluster */

which puts it at 2 kB, and lite2 uses:

 #define MCLBYTES        1024
 #define MCLSHIFT        10

which is 1kB.

We run lots of BSD servers with NMBCLUSTERS at 4096, and it doesn't take 
65536 kB of memory for the mbuf clusters.



Mime
View raw message