文件配置格式
第一列表示用户和组(@开头)。第二列表示软限制还是硬限制,第三列表示限制的资源类型,第四列表示限制的最大值
hard和soft的区别: soft是一个警告值,而hard则是一个真正意义的阀值,超过就会报错,一般情况下都是设为同一个值。
core是内核文件,nofile是文件描述符,noproc是进程,一般情况下只限制文件描述符数和进程数就够了
#<domain> <type> <item> <value>
#
#* soft core 0
#root hard core 100000
#* hard rss 10000
#@student hard nproc 20
#@faculty soft nproc 20
#@faculty hard nproc 50
#ftp hard nproc 0
#ftp - chroot /ftp
#@student - maxlogins 4
# End of file
-----------分割线,上面是配置文件的模板,下面是自己添加的------------------------
* soft nofile 655350 #表示任何一个用户可以打开的最大的文件描述符数量
* hard nofile 655350
* soft nproc 655350 #表示任何一个用户可以打开的最大的进程数
* hard nproc 655350
@student hard nofile 65535 #student组中的任何人最多能打开文件描述符数量是65535,并且会在打开65000个时发出警告
@student soft nofile 65000
@student hard nproc 50 #student组中的任何人不能拥有超过50个进程,并且会在拥有30个进程时发出警告
@student soft nproc 30