线程可以打开的最大文件数修改

Linux 运维以及脚本干货: 欢迎分享,欢迎folk, 欢迎留言
https://unnunique.github.io/AADocs/skill-docs/linux/
https://github.com/unnunique/unnunique.github.io/blob/master/AADocs/skill-docs/linux/index.md

线程可以打开的最大文件数修改

如下:

在/etc/security/limits.conf 中添加两行。

#<domain>      <type>  <item>         <value>
#
#*               soft    core            0
#*               hard    rss             10000
#@student        hard    nproc           20
#@faculty        soft    nproc           20
#@faculty        hard    nproc           50
#ftp             hard    nproc           0
#@student        -       maxlogins       4
* soft nofile 65535
* hard nofile 65535  (添加的两行)
# End of file
* soft nofile 65535 <br/>
* hard nofile 65535 <br/>

执行以下两个命令,

ulimit -Hn 65535

ulimit -Sn 65535

之后重启系统,reboot

猜你喜欢

转载自blog.csdn.net/eases_stone/article/details/80194086
今日推荐