Why change net.inet.tcp.tcbhashsize in FreeBSD?

Posted by sh-beta on Server Fault See other posts from Server Fault or by sh-beta
Published on 2012-03-22T18:09:27Z Indexed on 2012/03/23 17:31 UTC
Read the original article Hit count: 270

Filed under:
|

In virtually every FreeBSD network tuning document I can find:

# /boot/loader.conf
net.inet.tcp.tcbhashsize=4096

This is usually paired with some unhelpful statement like "TCP control-block hash table tuning" or "Set this to a reasonable value." man 4 tcp isn't much help either:

tcbhashsize         Size of the TCP control-block hash table (read-only).
                    This may be tuned using the kernel option TCBHASHSIZE
                    or by setting net.inet.tcp.tcbhashsize in the
                    loader(8).

The only document I can find that touches on this mysterious thing is the Protocol Control Block Lookup subsection beneath Transport Layer in Optimizing the FreeBSD IP and TCP Stack, but its description is more about potential bottlenecks in using it. It seems tied to matching new TCP segments to their listening sockets, but I'm not sure how.

What exactly is the TCP Control Block used for? Why would you want to set its hash size to 4096 or any other particular number?

© Server Fault or respective owner

Related posts about freebsd

Related posts about performance-tuning