# ulimit–n 65535
# vim /etc/security/limits.conf
* softnofile 65536
* hard nofile65536
# vim /etc/pam.d/login
sessionrequired /lib/security/pam_limits.so
# cat/proc/sys/fs/file-max
32568
# netstat-n | awk ‘/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}’
LAST_ACK16
SYN_RECV348
ESTABLISHED70
FIN_WAIT1229
FIN_WAIT230
CLOSING33
TIME_WAIT18098
# vim /etc/sysctl.conf
net.ipv4.tcp_syncookies= 1
net.ipv4.tcp_tw_reuse= 1
net.ipv4.tcp_tw_recycle= 1
net.ipv4.tcp_fin_timeout= 30
# sysctl-p
net.ipv4.tcp_keepalive_time= 1200
net.ipv4.ip_local_port_range= 1024 65535
net.ipv4.tcp_max_syn_backlog= 8192
net.ipv4.tcp_max_tw_buckets= 5000
net.ipv4.tcp_keepalive_time= 1200
net.ipv4.ip_local_port_range= 1024 65535
net.ipv4.tcp_max_syn_backlog= 8192
net.ipv4.tcp_max_tw_buckets= 5000
net.ipv4.tcp_max_syn_backlog= 65536
net.core.netdev_max_backlog= 32768
net.core.somaxconn= 32768
net.core.wmem_default= 8388608
net.core.rmem_default= 8388608
net.core.rmem_max= 16777216 #最大socket读buffer,可参考的优化值:873200
net.core.wmem_max= 16777216 #最大socket写buffer,可参考的优化值:873200
net.ipv4.tcp_timestsmps= 0
net.ipv4.tcp_syn_retries= 2
#net.ipv4.tcp_tw_len= 1
net.ipv4.tcp_tw_reuse= 1
net.ipv4.tcp_wmem= 8192 436600 873200
net.ipv4.tcp_rmem = 32768 436600 873200
net.ipv4.tcp_mem= 94500000 91500000 92700000
net.ipv4.tcp_max_orphans= 3276800
net.ipv4.tcp_fin_timeout= 30
sysctlnet.ipv4.tcp_available_congestion_control
net.ipv4.tcp_congestion_control=hybla
net.ipv4.tcp_fastopen= 3
欢迎光临 51学通信论坛2017新版 (http://bbs.51xuetongxin.com/) | Powered by Discuz! X3 |