Reading time: 14 – 22 minutes
Just a small recipe about how to enable linux kernel to open tons of concurrent connections. Really simple and useful post entry.
<span style="font-style: italic; color: #656565;">echo “10152 65535″ > /proc/sys/net/ipv4/ip_local_port_range</span><br style="font-style: italic; color: #656565;"><span style="font-style: italic; color: #656565;">sysctl -w fs.file-max=128000</span><br style="font-style: italic; color: #656565;"><span style="font-style: italic; color: #656565;">sysctl -w net.ipv4.tcp_keepalive_time=300</span><br style="font-style: italic; color: #656565;"><span style="font-style: italic; color: #656565;">sysctl -w net.core.somaxconn=250000</span><br style="font-style: italic; color: #656565;"><span style="font-style: italic; color: #656565;">sysctl -w net.ipv4.tcp_max_syn_backlog=2500</span><br style="font-style: italic; color: #656565;"><span style="font-style: italic; color: #656565;">sysctl -w net.core.netdev_max_backlog=2500</span><br style="font-style: italic; color: #656565;"><span style="font-style: italic; color: #656565;">ulimit -n 10240</span>