新近在搬瓦工上买了穷人版的套餐.
一键开启ss后, 优化配置操作如下:
[STEP 1]
由于使用的是openvz的VPS, 所以优化前需要执行修复命令.
否则会出现"permission denied on key 'xxx'"的异常.
rm -f /sbin/modprobe ln -s /bin/true /sbin/modprobe rm -f /sbin/sysctl ln -s /bin/true /sbin/sysctl
*这个操作是重建了modprobe, sysctl的soft link.
[STEP 2]
修改配置文件: /etc/sysctl.conf
vi /ect/sysctl.conf
在文件中添加以下内容:
fs.file-max = 51200 net.ipv4.tcp_syncookies = 1 net.ipv4.tcp_tw_reuse = 1 net.ipv4.tcp_tw_recycle = 0 net.ipv4.tcp_fin_timeout = 30 net.ipv4.tcp_keepalive_time = 1200 net.ipv4.ip_local_port_range = 10000 65000 net.ipv4.tcp_max_syn_backlog = 8192 net.ipv4.tcp_max_tw_buckets = 5000 net.ipv4.tcp_fastopen = 3 # increase TCP max buffer size settable using setsockopt() net.core.rmem_max = 67108864 net.core.wmem_max = 67108864 # increase Linux autotuning TCP buffer limit net.ipv4.tcp_rmem = 4096 87380 67108864 net.ipv4.tcp_wmem = 4096 65536 67108864 # increase the length of the processor input queue net.core.netdev_max_backlog = 250000 # recommended for hosts with jumbo frames enabled net.ipv4.tcp_mtu_probing=1
更新并重启服务器
sysctl -p reboot
[STEP 3]
安装net_speeder
wget https://coding.net/u/njzhenghao/p/download/git/raw/master/net_speeder-installer.sh bash net_speeder-installer.sh
安装完成后,启动ns
nohup /usr/local/net_speeder/net_speeder venet0 "ip" >/dev/null 2>&1 &
** 我装了ns后, 发现反而变卡了, 所以就又把ns关了...
[NOTE]
参考文章:
[1] http://www.40do.com/archives/7411.html