nginx静态处理 优化Linux内核参数

vi /etc/sysctl.conf
02 # Add
03 net.ipv4.tcp_max_syn_backlog = 65536
04 net.core.netdev_max_backlog =  32768
05 net.core.somaxconn = 32768
06  
07 net.core.wmem_default = 8388608
08 net.core.rmem_default = 8388608
09 net.core.rmem_max = 16777216
10 net.core.wmem_max = 16777216
11  
12 net.ipv4.tcp_timestamps = 1
13 net.ipv4.tcp_synack_retries = 2
14 net.ipv4.tcp_syn_retries = 2
15  
16 net.ipv4.tcp_tw_recycle = 1
17 #net.ipv4.tcp_tw_len = 1
18 net.ipv4.tcp_tw_reuse = 1
19  
20 net.ipv4.tcp_mem = 94500000 915000000 927000000
21 net.ipv4.tcp_max_orphans = 3276800
22  
23 #net.ipv4.tcp_fin_timeout = 30
24 #net.ipv4.tcp_keepalive_time = 120
25 net.ipv4.ip_local_port_range = 1024  65535
26 net.ipv4.ip_conntrack_max = 655360
27 net.ipv4.netfilter.ip_conntrack_tcp_timeout_established = 180
28 使配置立即生效:
29 /sbin/sysctl -p
30 如果出现error: "net.ipv4.ip_conntrack_max" is an unknown key
31 error: "net.ipv4.netfilter.ip_conntrack_tcp_timeout_established" is an unknown key
32 解决:
33  
34 modprobe ip_conntrack
35  
36 echo "modprobe ip_conntrack" >> /etc/rc.local
37  
38 modprobe(module probe)
39  
40 功能说明:自动处理可载入模块。

 

link:http://blog.517car.com/2011/05/15/nginx%E9%9D%99%E6%80%81%E5%A4%84%E7%90%86-%E4%BC%98%E5%8C%96linux%E5%86%85%E6%A0%B8%E5%8F%82%E6%95%B0/

你可能感兴趣的:(linux)