Linux Networking – Upper Limit of net.core.somaxconn

linuxnginx

I want to increase the maximum number of connections that can be queued for acceptance by NGINX, for this nginx documentation suggested to increase the somaxconn.

1) what are the min and max limits?

2) does the limit depend on the system configuration like ram, cores?

Best Answer

A quick search mentioned that in old kernels net.core.somaxconn was an unsigned 16 bit integer so between 0 and 65535, with a value of 128 as the default and that higher values would silently get truncated to 65535, but no mention if/when that was changed and to what.

On my CentOS test system with kernel 3.10.0 still no value beyond 65535 is accepted.

sysctl net.core.somaxconn=65536
sysctl: setting key "net.core.somaxconn": Invalid argument

I have no idea what the real-word impact/requirements are when a large limit is set and reached.