Jas*_*son 5 linux security centos ulimit
我已/etc/security/limits.conf
设置为以下内容:
nobody soft nofile 409600
nobody hard nofile 1024000
phpuser soft nofile 409600
phpuser hard nofile 1024000
httpd soft nofile 409600
httpd hard nofile 1024000
* soft nofile 409600
* hard nofile 1024000
Run Code Online (Sandbox Code Playgroud)
但是,php页面仍然显示:
[...] failed to open stream: Too many open files [...]
Run Code Online (Sandbox Code Playgroud)
设置ulimit -n 10000
看起来只是一个临时修复。
我也有以下设置:
fs.file-max = 20970800
net.core.somaxconn = 1024000
kern.maxfilesperproc = 16638400
kern.maxfiles = 819200
Run Code Online (Sandbox Code Playgroud)
您可以通过编辑limits.conf来永久设置ulimit。检查此链接
如果是 php 文件,也请参阅此线程