当前位置:论坛首页 > BUG提交 > Linux面板

宝塔重启后,在宝塔的linux 终端,ulimit -n 只有1024

发表在 BUG提交2025-11-17 09:57 [复制链接] 0 160

宝塔面板版本 : v11.x

在腾讯云购买 新的服务器,centos7.X 后,用命令
  1. 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了

  1. cat /etc/security/limits.conf  进行了修改
复制代码
  1. # End of file
  2. * soft nofile 100001
  3. * hard nofile 100002
  4. root soft nofile 100101
  5. root hard nofile 100102
  6. * soft nofile 100001
  7. * hard nofile 100002
  8. root soft nofile 100101
  9. root hard nofile 100102
  10. * soft memlock unlimited
  11. * 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 ,是服务器的默认值)

使用道具 举报 只看该作者 回复
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

普通问题处理

论坛响应时间:72小时

问题处理方式:排队(仅解答)

工作时间:白班:9:00 - 18:00

紧急运维服务

响应时间:3分钟

问题处理方式:宝塔专家1对1服务

工作时间:工作日:9:00 - 18:30

宝塔专业团队为您解决服务器疑难问题

点击联系技术分析

工作时间:09:00至18:30

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