NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Slow 'real world' network performance



On Sat, Oct 25, 2025 at 12:28:37PM -0500, Peter Miller wrote:

> I have never tuned my oses before. How does one go about finding where
> the bottlenecks are? Are there any good resources you can recommend?

The examples given here are already all you can tune. Basically you
bump the buffer sizes to allow for larger TCP windows.

kern.sbmax                   -> the global limit for send/receive buffers
kern.inet.tcp.sendspace      -> send buffer default
kern.inet.tcp.sendbuf_inc    -> send buffer autoscaling increment
kern.inet.tcp.sendbuf_max    -> send buffer autoscaling limit
kern.inet.tcp.recvspace      -> receive buffer default
kern.inet.tcp.recvbuf_inc    -> receive buffer autoscaling increment
kern.inet.tcp.recvbuf_max    -> receive buffer autoscaling limit
kern.somaxkva                -> total memory limit for network stack

The buffer sizes set a limit for the TCP window size. The TCP window
needs to grow to the "bandwidth-delay product". I.e. you multiply
the speed with the round-trip time to get the necessary window size.

For 1Gbit/s to the other side of the world with a RTT of about 250ms
you need a window (and thus buffers) of 500 MByte. For a shorter
distance, you only need smaller windows.

Unfortunately that's only true for a perfect connection.

In practice you will experience transmission errors. TCP will
interpret all these errors as bandwidth limitations and slow down
before trying to ramp up speed again.

There are several algorithms how to do this in detail and these
algorithms vary in how good they can maintain speed when facing errors,
especially when operating over a long distance.

This is the major reason for your observations (and shows that
NetBSD has room for improvement).



Greetings,
-- 
                                Michael van Elst
Internet: mlelstv%serpens.de@localhost
                                "A potential Snark may lurk in every tree."


Home | Main Index | Thread Index | Old Index