ssr后端优化设置 - wilia/django-sspanel GitHub Wiki

基于kvm架构vps的优化

TCP优化

1.修改文件句柄数限制

如果是ubuntu/centos均可修改/etc/sysctl.conf
找到fs.file-max这一行,修改其值为1024000,并保存退出。然后执行sysctl -p使其生效
修改vi /etc/security/limits.conf文件,加入

*               soft    nofile           512000
*               hard    nofile          1024000

针对centos,还需要修改 nano /etc/pam.d/common-session文件, 加入 session required pam_limits.so

2.修改vi /etc/profile文件,加入 ulimit -SHn 1024000

然后重启服务器执行ulimit -n,查询返回1024000即可。

sysctl.conf报错解决方法

# 修复modprobe的:
rm -f /sbin/modprobe 
ln -s /bin/true /sbin/modprobe
# 修复sysctl的:
rm -f /sbin/sysctl 
ln -s /bin/true /sbin/sysctl

系统层面

开启brr加速

推荐使用秋大的一件脚本:

https://teddysun.com/489.html

网络层面

防火墙的配置 请根据自己的系统自行Google