Modifying Network Parameters
Purpose
Modify some parameter settings at the operating system layer to improve server performance.
Procedure
Linux Parameter |
Description |
Operation |
|---|---|---|
tcp_max_syn_backlog |
Maximum number of clients that can receive SYN (synchronization) packets. Default value: 2048; recommended value: 8192 |
echo 8192 > /proc/sys/net/ipv4/ tcp_max_syn_backlog |
net.core.somaxconn |
Maximum number of clients that can process data in the server, that is, the maximum number of connections. Default value: 128; recommended value: 1024 |
echo 1024 > /proc/sys/net/core/somaxconn |
net.core.rmem_max |
Maximum size of the socket receive buffer. Default value: 229376; recommended value: 16777216 |
echo 16777216 > /proc/sys/net/core/rmem_max |
net.core.wmem_max |
Maximum size (in bytes) of the socket transmit buffer. Default value: 229376; recommended value: 16777216 |
echo 16777216 > /proc/sys/net/ core/wmem_max |
net.ipv4.tcp_rmem |
Size of the read buffer. The three numbers indicate the minimum, default, and maximum size of the read buffer, respectively. Default value: 4096 87380 6291456; recommended value: 4096 87380 16777216. |
echo "4096 87380 16777216" > /proc/sys/net/ipv4/tcp_rmem |
net.ipv4.tcp_wmem |
Size of the write buffer. The three numbers indicate the minimum, default, and maximum size of the write buffer, respectively. Default value: 4096 16384 4194304; recommended value: 4096 65536 16777216. |
echo "4096 65536 16777216" > /proc/sys/net/ipv4/tcp_wmem |
net.ipv4.max_tw_buckets |
Maximum number of TIME_WAIT sockets that can be retained by the system at the same time. Default value: 2048; recommended value: 360000. |
echo 360000 > /proc/sys/net/ipv4/tcp_max_tw_buckets |