全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 16132|回复: 65

[疑问] 最优SS单边加速优化方案

  [复制链接]
发表于 2018-9-12 14:11:59 | 显示全部楼层 |阅读模式
本帖最后由 hostvps 于 2018-9-12 16:13 编辑

VPS要是KVM类型,优化方案同时启用锐速+hybla+TCP Fast Openpe配合上安全而速度快的chacha20-ietf-poly1305加密方式,故称最优SS单边加速优化方案
1、重装系统为Debian8(安装后SSH默认密码为:Vicer记得修改成复杂密码)
  1. wget --no-check-certificate -qO InstallNET.sh 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh' && chmod a+x InstallNET.sh
  2. bash InstallNET.sh -d 8 -v 64 -a
复制代码

2、更换锐速可用内核
  1. echo -e "\ndeb http://ftp.debian.org/debian/ wheezy-backports main" >> /etc/apt/sources.list
  2. apt-get update
  3. apt-get -t wheezy-backports install linux-image-3.16.0-4-amd64 -y
  4. dpkg -l|grep linux-image | awk '{print $2}'  #查看本机安装内核
  5. apt-get purge 其余内核名称 -y
  6. update-grub
  7. reboot
复制代码

3、安装锐速
  1. wget --no-check-certificate -qO /tmp/appex.sh "https://raw.githubusercontent.com/0oVicero0/serverSpeeder_Install/master/appex.sh" && bash /tmp/appex.sh 'install'
复制代码

4、安装SS(选Shadowsocks-libev安装,加密方式选chacha20-ietf-poly1305)
  1. wget --no-check-certificate -O shadowsocks-libev-debian.sh https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks-libev-debian.sh
  2. chmod +x shadowsocks-libev-debian.sh
  3. ./shadowsocks-libev-debian.sh 2>&1 | tee shadowsocks-libev-debian.log
复制代码

5、优化SS
修改/etc/security/limits.conf 添加
  1. * soft nofile 51200
  2. * hard nofile 51200
复制代码

修改/etc/profile 添加
  1. ulimit -SHn 51200
复制代码

修改/etc/sysctl.conf 添加
  1. fs.file-max = 51200
  2. net.core.rmem_max = 67108864
  3. net.core.wmem_max = 67108864
  4. net.core.netdev_max_backlog = 250000
  5. net.core.somaxconn = 4096
  6. net.ipv4.tcp_syncookies = 1
  7. net.ipv4.tcp_tw_reuse = 1
  8. net.ipv4.tcp_tw_recycle = 0
  9. net.ipv4.tcp_fin_timeout = 30
  10. net.ipv4.tcp_keepalive_time = 1200
  11. net.ipv4.ip_local_port_range = 10000 65000
  12. net.ipv4.tcp_max_syn_backlog = 8192
  13. net.ipv4.tcp_max_tw_buckets = 5000
  14. net.ipv4.tcp_fastopen = 3
  15. net.ipv4.tcp_mem = 25600 51200 102400
  16. net.ipv4.tcp_rmem = 4096 87380 67108864
  17. net.ipv4.tcp_wmem = 4096 65536 67108864
  18. net.ipv4.tcp_mtu_probing = 1
  19. net.ipv4.tcp_congestion_control = hybla
复制代码

运行sysctl -p使设置生效
修改/etc/shadowsocks-libev/config.json
  1. "fast_open":true,
复制代码

重启系统即可享用最优SS单边加速优化方案(如果已是可装锐速的debian8系统,1和2步可省去)
参考:
https://moeclub.org/2018/04/03/603/
https://doub.io/linux-jc6/
https://moeclub.org/2017/03/08/14/?v=795
https://teddysun.com/358.html
https://shadowsocks.org/en/config/advanced.html
https://www.hostloc.com/thread-467991-1-1.html
发表于 2018-9-12 14:16:02 | 显示全部楼层
加钱才是最优解
发表于 2018-9-12 14:20:09 | 显示全部楼层
我TM以为自己穿越到了2016年
 楼主| 发表于 2018-9-12 15:04:52 | 显示全部楼层
本帖最后由 hostvps 于 2018-9-13 08:49 编辑
funders 发表于 2018-9-12 14:57
大佬来个bbr版的吧,毕竟锐速支持的系统有限


之所以选择debian8系统和linux-image-3.16.0-4-amd64内核是有原因的,bbr和文中ss优化的net.ipv4.tcp_congestion_control = hybla冲突,linux内核小于3.5就不能使用文中ss优化的net.ipv4.tcp_fastopen = 3,而其他内核debian8又不能安装锐速,所以综合考虑debian8 linux-image-3.16.0-4-amd64 比较适合可以同时启用锐速+hybla+TCP Fast Openpe
发表于 2018-9-12 14:27:13 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2018-9-12 14:15:05 | 显示全部楼层
另一个帖子里还有这几条,不需要吗?
vm.min_free_kbytes = 5120
vm.overcommit_memory = 1
vm.panic_on_oom = 1
vm.swappiness = 80
vm.vfs_cache_pressure = 200

点评

小白发出了同样的疑问?这是老司机大佬的帖子里  发表于 2018-9-13 08:43
发表于 2018-9-12 14:18:41 | 显示全部楼层
战略性mark
发表于 2018-9-12 14:23:24 | 显示全部楼层
第5步没啥用,以前测试过,设置和不设置没区别
发表于 2018-9-12 14:25:28 | 显示全部楼层
瓦工默认bbr+aes-256-cfb已经很满足了
发表于 2018-9-12 14:25:49 | 显示全部楼层
这个和上次的版本有什么区别,还请大佬明示!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2026-3-7 21:49 , Processed in 0.067873 second(s), 11 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表