jes*_*tro 15 centos ulimit centos7
我想为 Centos 7 中的所有用户永久设置打开文件限制,但在谷歌上似乎有很多相互矛盾的信息。
sys*_*138 19
除非他们做了一些非常古怪的事情(如果是这样,请怪 systemd),否则所有这些都设置在/etc/security/limits.conf.
* soft nofile 8192
* hard nofile 8192
Run Code Online (Sandbox Code Playgroud)
类似的东西。
小智 13
如果你想增加系统服务的文件限制,你必须编辑 /usr/lib/systemd/system/SOME_SERVICE.service
添加LimitNOFILE,
[Service]
...
LimitNOFILE=8192
Run Code Online (Sandbox Code Playgroud)
并运行systemctl daemon-reload以激活更改。
小智 11
可以通过在以下位置创建新的配置文件来完成:/etc/security/limits.d/(在升级等时安全)。例如:
/etc/security/limits.d/nofile.conf
Run Code Online (Sandbox Code Playgroud)
内容如 sysadmin1138 之前所写:
* soft nofile 8192
* hard nofile 8192
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
69312 次 |
| 最近记录: |