宝塔面板版本 : v11.x
在腾讯云购买 新的服务器,centos7.X 后,用命令
- if [ -f /usr/bin/curl ];then curl -sSO https://download.bt.cn/install/install_panel.sh;else wget -O install_panel.sh https://download.bt.cn/install/install_panel.sh;fi;bash install_panel.sh ed8484bec
复制代码 安装后,安装PHP8.2,redis ,nginx 和 sql server 2019 后,跑起来来项目后,
用 ulimit -n 是 100001 ,只要重启服务器后,ulimit -n 就只有 1024了
- cat /etc/security/limits.conf 进行了修改
复制代码- # End of file
- * soft nofile 100001
- * hard nofile 100002
- root soft nofile 100101
- root hard nofile 100102
- * soft nofile 100001
- * hard nofile 100002
- root soft nofile 100101
- root hard nofile 100102
- * soft memlock unlimited
- * hard memlock unlimited
复制代码
在 自己的 ssh 终端上 设置 这个值是有效的,在宝塔的 ssh终端 上 始终是 1024
现在临时处理办法是重启服务器后,在 /etc/init.d/bt 加入 ulimit -n 100001,每次重启都要去加上 这句,不然不生效
在宝塔 V9.x 上是不会出现 这种问题的
为什么会发现是在用户请求一上来时,error log 就说是文件链接不够用,一查 ulimit -n 1024 ,肯定是不够用的
提了求助,是让我在 /etc/security/limits.conf 这里去设置,这些肯定是早设置过了,不然也不会去改 /etc/init.d/bt 的启动文件
宝塔升级 了v11.2 后,在宝塔的ssh 里依然是 1024
(如果安装了宝塔,一直不重启服务器,ulimit -n 是 100001 ,是服务器的默认值)
|
|