TypechoJoeTheme

运维茶馆

统计
登录
用户名
密码

Ubuntu优化最大打开文件数

掌柜博主
2021-10-13
/
0 评论
/
1,595 阅读
/
69 个字
/
百度已收录
10/13
本文最后更新于2023年07月07日,已超过287天没有更新。如果文章内容或图片资源失效,请留言反馈,我会及时处理,谢谢!

Ubuntu 1604 之前 修改/etc/security/limits.conf 文件即可。

root     soft   nofile    100000
root     hard   nofile    100000
root     soft   nproc     100000
root     hard   nproc     100000
root     soft   core      100000
root     hard   core      100000

*     soft   nofile    100000
*     hard   nofile    100000
*     soft   nproc     100000
*     hard   nproc     100000
*     soft   core      100000
*     hard   core      100000

Ubuntu 1604 之后,还需要设置/etc/systemd/system.conf/etc/systemd/user.conf里面的3个参数:

DefaultLimitCORE=infinity
DefaultLimitNOFILE=100000
DefaultLimitNPROC=100000

其中,system.conf是系统实例使用的,user.conf用户实例使用的。
一般的sevice,使用system.conf中的配置即可。systemd.conf.d/*.conf中配置会覆盖system.conf

设置完成后,需要重启机器生效!


赞(0)
赞赏
感谢您的支持,我会继续努力哒!
版权属于:

运维茶馆

本文链接:

https://www.opstea.com/archives/ubuntu-limits.html(转载时请注明本文出处及文章链接)

评论 (0)