At Sat, 21 Mar 2026 16:54:36 -0000 (UTC), mlelstv%serpens.de@localhost (Michael van Elst) wrote:
Subject: Re: network outages
>
> 262144 * 2048 / ( 512 + 2048 ) = 209715.
>
> The relevant setting is kern.sbmax. Setting a socket buffer beyond
> sbmax * MCLBYTES / (MSIZE + MCLBYTES) fails and the TCP protocol
> no longer attaches.
>
> The correction factor obviously should make kern.sbmax show the
> total memory used for a buffer including the headers. But it's
> just confusing.
Isn't the simplest to just make kern.sbmax the right size for the
largest given {send,recv}buf_max value?
I.e.:
kern.sbmax = buf_max + ((buf_max / MCLBYTES) * MSIZE)
No?
Could the kernel do this itself and eliminate the need to manually tune
kern.sbmax? Maybe even eliminate kern.sbmax entirely?
So, folks using 16Mb for sendbuf_max need to set kern.sbmax to 20Mb, no?
--
Greg A. Woods <gwoods%acm.org@localhost>
Kelowna, BC +1 250 762-7675 RoboHack <woods%robohack.ca@localhost>
Planix, Inc. <woods%planix.com@localhost> Avoncote Farms <woods%avoncote.ca@localhost>
Attachment:
pgp2uLri6Znp4.pgp
Description: OpenPGP Digital Signature