我要评分
获取效率
正确性
完整性
易理解

Modifying Network Parameters

Purpose

Modify network parameter settings at the operating system layer to improve server performance.

Procedure

Linux Parameter

Description

Default Value

Recommended Value

Commands

tcp_max_syn_backlog

Maximum number of clients that can receive SYN (synchronization) packets.

2048

8192.

echo 8192 > /proc/sys/net/ipv4/tcp_max_syn_backlog
echo 1024 > /proc/sys/net/core/somaxconn
echo 16777216 > /proc/sys/net/core/rmem_max
echo 16777216 > /proc/sys/net/core/wmem_max
echo 4096 87380 16777216> /proc/sys/net/ipv4/tcp_rmem
echo 4096 65536 16777216> /proc/sys/net/ipv4/tcp_wmem
echo 360000 > /proc/sys/net/ipv4/tcp_max_tw_buckets

net.core.somaxconn

Maximum number of clients that can process data in the server, that is, the maximum number of connections.

128

1024.

net.core.rmem_max

Maximum size of the socket receive buffer, in bytes.

229376

16777216.

net.core.wmem_max

Maximum size of the socket send buffer, in bytes.

229376

16777216.

net.ipv4.tcp_rmem

Size of the read buffer. The three numbers indicate the minimum, default, and maximum size of the read buffer.

4096 87380 6291456

4096 87380 16777216.

net.ipv4.tcp_wmem

Size of the write buffer. The three numbers indicate the minimum, default, and maximum size of the write buffer.

4096 16384 4194304

4096 65536 16777216.

net.ipv4.max_tw_buckets

Maximum number of TIME_WAIT sockets that can be retained by the system at the same time.

2048

360000.