nginx调优之内核配置

在文件/etc/sysctl.conf中添加一下内容:
net.ipv4.tcp_max_tw_bucket = 6000
net.ipv4.ip_local_port_range = 1024 65000
sysctl -a|grep net.ipv4.tcp_tw_recycle = 1 
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_syncookies = 1
net.core.somaxconn = 262144
net.core.netdev_max_backlog = 262144
net.ipv4.tcp_max_orphans = 262144
net.ipv4.tcp_max_syn_backlog = 262144
net.ipv4.tcp_synack_retries = 1
net.ipv4.tcp_syn_retries = 1
net.ipv4.tcp_fin_timeout = 1
net.ipv4.tcp_keepalive_time = 30

使sysctl.conf文件中新添加的内容生效:
sysctl -p

你可能感兴趣的:(web服务器)