Linux tunning parameters to for load testing

When you run load testing, usually you will quickly discover issue like you can only open 1024 concurent tcp connection, or limit on how much file descriptors you can create.

To save you from all of google to tune it, here is a snippet on what you need to set

sysctl -w fs.file-max=1000000
sysctl -w fs.nr_open=1000000
ulimit -n 1000000
sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000'
sysctl -w net.ipv4.tcp_rmem='1024 4096 16384'
sysctl -w net.ipv4.tcp_wmem='1024 4096 16384'
sysctl -w net.core.rmem_max=16384
sysctl -w net.core.wmem_max=16384

Let’s go into the detail

Subscribe to BetterDev for programming tips and articles.

Join 3000+ other subscribers today