On Tue, Jan 19, 2010 at 6:33 PM, chefren <chef...@pi.net> wrote: > Network defaults in OpenBSD 4.6 (i386 & amd64): > kern.maxclusters = 6144 > net.inet.tcp.recvspace = 16 KiB > > > A) From skimming the OpenBSD kernel source code we get the impression > that this will allow, very roughly: > > 6144 mbuf-clusters > * 1460 Ethernet-bytes/mbuf-cluster > / 16 KiB/connection > = roughly 550 fully-buffered TCP connections. > > i.e. after +- 550 connections, further TCP connections can get refused.
It doesn't quite work like that. Connections and mbufs aren't really connected. My understanding is you're more likely to have 2000 connections with only a little bit buffered in each one, unless you are deliberately refusing to read the data. > Are there safe OpenBSD sysctl & kernel compile settings that allow this? > > * This would suggest kern.maxclusters = 300 connections * 64 > KiB/connection / 1460 Ethernet-bytes/mbuf-cluster = roughly > 15000. (right?) > > * But that would exhaust the default kernel memory pool too much. > (right?) > > (it would allocate 15000 mbuf-clusters * 2048 > alloc-bytes/mbuf-cluster = 29 MiB ) > > > If we understand correctly, i386 is too cramped in virtual address space > to increase the kernel memory pool safely. I have no idea what safe is, but there's a lot more freedom than they're used to be. Some of the old scary advice comes from when there was a special map just for clusters. But we replaced the pool backend like 5 years ago to fix that. 30M or more doesn't sound unreasonable at all really. Well, if you ever needed anything close to that I'd say it's probably not going to help because you have other performance problems, but the box won't fall over from too many clusters alone.