锐速相对来说速度一般比BBR更快,有人还是喜欢使用锐速的。下面讲解一下然后在128MB内存这样超小型的VPS上面安装锐速。
一、重装系统
使用一键脚本重装系统为Debian7 32位。
1 2 |
wget --no-check-certificate -qO InstallNET.sh 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh' && chmod a+x InstallNET.sh bash InstallNET.sh -d 7 -v 32 -a |
登陆SSH默认密码为:Vicer,可以使用passwd root修改密码。
该系统会默认设置你内存2倍大小的SWAP。
二、内核参数优化
编辑文件limits.conf
1 |
vi /etc/security/limits.conf |
在最后添加两行
1 2 |
* soft nofile 51200 * hard nofile 51200 |
编辑profile文件
1 |
vi /etc/profile |
在最后添加一行
1 |
ulimit -SHn 51200 |
修改后重启生效。
修改sysctl.conf
1 |
vi /etc/sysctl.conf |
在最后添加
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
fs.file-max = 51200 net.core.rmem_max = 67108864 net.core.wmem_max = 67108864 net.core.rmem_default = 65536 net.core.wmem_default = 65536 net.core.netdev_max_backlog = 4096 net.core.somaxconn = 4096 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 = 4096 net.ipv4.tcp_max_tw_buckets = 5000 net.ipv4.tcp_fastopen = 3 net.ipv4.tcp_rmem = 4096 87380 67108864 net.ipv4.tcp_wmem = 4096 65536 67108864 net.ipv4.tcp_mtu_probing = 1 net.ipv4.tcp_congestion_control = hybla vm.min_free_kbytes = 5120 vm.overcommit_memory = 1 vm.panic_on_oom = 1 vm.swappiness = 80 vm.vfs_cache_pressure = 200 |
令其生效:
1 |
sysctl -p |
三、安装锐速
1 |
wget --no-check-certificate -O appex.sh https://raw.githubusercontent.com/0oVicero0/serverSpeeder_Install/master/appex.sh && chmod +x appex.sh && bash appex.sh install |
优化锐速参数:
1 |
vi /appex/etc/config |
将以下内容修改为:
1 2 3 4 5 6 |
initialCwndWan="65" shaperEnable="0" SmBurstMS="20" shortRttMS="90" l2wQLimit="128 1024" w2lQLimit="128 1024" |
重启锐速
1 |
/appex/bin/serverSpeeder.sh restart |
基本上经过这一番设置以后,锐速就不那么容易杀进程了。我没有做大流量的压力测试,但应该还是可靠的。关键点是使用32位的系统和设置锐速的内存占用。当然,为了确保ss等的稳定运行,最好还是使用libev版,添加守护脚本,监控进程。因为某些原因,这里就不放教程了,大家可以自行google。
我自己一般还是使用BBR的多点,还没有遇到杀进程的情况,放心。
本文参考:https://www.hostloc.com/forum.php?mod=viewthread&tid=467991&highlight=%E9%94%90%E9%80%9F
- 本文固定链接: https://www.ljchen.com/archives/1644
- 转载请注明: ljchen 于 三言两语 发表