0
点赞
收藏
分享

微信扫一扫

linux修改max user processes/file limits

一点读书 2024-05-10 阅读 6
linux

1、修改普通用户单个用户可同时运行的最大进程数 (默认为 4096 )

[root@xxx devops]# cat /etc/security/limits.d/20-nproc.conf 
# Default limit for number of user's processes to prevent
# accidental fork bombs.
# See rhbz #432903 for reasoning.
*          soft    nproc     65535
root       soft    nproc     unlimited

2、修改文件句柄数

 [root@xxx devops]#cat /etc/security/limits.conf
root soft nofile 655350
root hard nofile 655350
* soft nofile 655350
* hard nofile 655350

3、查看Linux系统的句柄数

ulimit -a

4、关于修改后生效问题
centos/redhat系统,修改以上配置后,退出登录用户,再次重新登录,配置生效,但是启动的程序需要重启(也有动态修改程序的句柄数操作,后续介绍);
其他操作系统目前没有验证,正常情况都是用户重新登录生效;

举报

相关推荐

0 条评论