Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Jul 2003 17:22:55 -0400
From:      Scot Loach <sloach@sandvine.com>
To:        "'freebsd-net@freebsd.org'" <freebsd-net@freebsd.org>
Subject:   Kernel tuning for large maxsockets
Message-ID:  <FE045D4D9F7AED4CBFF1B3B813C8533701AE8534@mail.sandvine.com>

next in thread | raw e-mail | index | archive | help
Currently, whenever maxsockets is increased, this causes kernel memory to be
preallocated for each type of pcb (tcp, udp, raw, divert).  The number of
pcbs preallocated for each of these is always the same as maxsockets.

This is probably a waste of memory for raw sockets and divert sockets, since
they would not normally be used in large numbers.   A large server could
save kvm by reducing the number of divert and raw pcbs preallocated.  For
example, on a machine configured for 200,000 maxsockets we would save 75MB
of kvm out of a total of 262MB that would have been preallocated.  This kvm
savings can be used to increase maxsockets even more.

Is there any reason I should not modify the kernel code to only let a small,
fixed number of raw and divert pcbs be preallocated instead of having them
scale with maxsockets?

Next, does this seem like a generally useful thing that could be rolled back
into the source tree?  I could make this a kernel option or a tunable sysctl
variable.

thanks

Scot Loach



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?FE045D4D9F7AED4CBFF1B3B813C8533701AE8534>