vim /etc/security/limits.conf添加以下内容
* soft nofile 65535
* hard nofile 65535
并添加开机启动
vim /etc/rc.local
ulimit -SHn 65535
附nginx进程下检查最大文件打开数脚本
#!/bin/bash
for pid in `ps aux | grep nginx | grep -v grep |awk ‘{print $2}‘`
do
cat /proc/${pid}/limits | grep ‘max open files‘
done
by:rm_rf_db
时间: 2024-10-10 16:47:28