echo 65532 > /proc/sys/fs/file-max
echo 30 > /proc/sys/net/ipv4/tcp_fin_timeout
echo 60000 > /proc/sys/net/ipv4/tcp_keepalive_time
echo 15000 > /proc/sys/net/ipv4/tcp_keepalive_intvl
echo 0 > /proc/sys/net/ipv4/tcp_window_scaling
echo 1024 25000 > /proc/sys/net/ipv4/ip_local_port_range
echo 2621143 > /proc/sys/net/core/rmem_max
echo 262143 > /proc/sys/net/core/rmem_default
echo 4096 131072 262143 >/proc/sys/net/ipv4/tcp_rmem
echo 4096 13107262143 > /proc/sys/net/ipv4/tcp_wmem
echo "67108864" > /proc/sys/kernel/shmmax
echo 16777216 > /proc/sys/net/core/rmem_max
echo 16777216 > /proc/sys/net/core/wmem_default
echo 16777216 > /proc/sys/net/core/wmem_max
echo 4096 > /proc/sys/net/core/somaxconn
echo 262143 > /proc/sys/net/core/rmem_default
echo 0 > /proc/sys/net/ipv4/tcp_sack
echo 0 > /proc/sys/net/ipv4/tcp_timestamps
参考: http://docs.oracle.com/cd/E19683-01/817-2180-10/pt_chap6.html
set rlim_fd_max = 8192
ulimit -a -H
ulimit -n 8192
ulimit -a
echo 30 > /proc/sys/net/ipv4/tcp_fin_timeout
echo 60000 > /proc/sys/net/ipv4/tcp_keepalive_time
echo 15000 > /proc/sys/net/ipv4/tcp_keepalive_intvl
echo 0 > /proc/sys/net/ipv4/tcp_window_scaling
echo 1024 25000 > /proc/sys/net/ipv4/ip_local_port_range
echo 2621143 > /proc/sys/net/core/rmem_max
echo 262143 > /proc/sys/net/core/rmem_default
echo 4096 131072 262143 >/proc/sys/net/ipv4/tcp_rmem
echo 4096 13107262143 > /proc/sys/net/ipv4/tcp_wmem
echo "67108864" > /proc/sys/kernel/shmmax
echo 16777216 > /proc/sys/net/core/rmem_max
echo 16777216 > /proc/sys/net/core/wmem_default
echo 16777216 > /proc/sys/net/core/wmem_max
echo 4096 > /proc/sys/net/core/somaxconn
echo 262143 > /proc/sys/net/core/rmem_default
echo 0 > /proc/sys/net/ipv4/tcp_sack
echo 0 > /proc/sys/net/ipv4/tcp_timestamps
参考: http://docs.oracle.com/cd/E19683-01/817-2180-10/pt_chap6.html
set rlim_fd_max = 8192
ulimit -a -H
ulimit -n 8192
ulimit -a
转载于:https://blog.51cto.com/yijiaxin/800270