一>修改句柄数
Ulimit –a
1)修改文件:/etc/security/limits.conf,在文件中添加:(立即生效-当前session中运行ulimit -a命令无法显示)
1. * soft nofile 32768 #限制单个进程最大文件句柄数(到达此限制时系统报警)
2. * hard nofile 65536 #限制单个进程最大文件句柄数(到达此限制时系统报错)
* soft nofile 32768
* hard nofile 65536
2)修改文件:/etc/sysctl.conf。在文件末尾添加:
fs.file-max=655350
运行命令:/sbin/sysctl -p 使配置生效
3>临时修改
#step6:set open file buffer with Root
ulimit -HSn 65534
#sudo echo "ulimit -n 65535"
二>修改tcp/udp缓存
#step1:stop iptables with Root
service iptables stop
#step2:set liunx system max TCP/UDP buffer
sysctl -w net.core.rmem_max=67108864
sysctl -w net.core.wmem_max=67108864
#step3set UDP buffer
sysctl -w net.core.rmem_default=33554432
sysctl -w net.core.wmem_default=33554432
#step4:set TCP buffer
sysctl -w net.ipv4.tcp_rmem="4096 33554432 33554432 "
sysctl -w net.ipv4.tcp_wmem="98304 33554432 33554432 "
sysctl -w net.ipv4.tcp_mem="98304 33554432 33554432 "
#step5:set TCP window scalling
sysctl -w net.ipv4.tcp_window_scaling=1
#sysctl -w net.ipv4.ip_local_port_range="1024 65000"