用户登录
用户注册

分享至

查看linux默认能最多开启多少个文件数量

  • 作者: 金基毒力
  • 来源: 51数据库
  • 2020-08-25

ulimit –a

ulimit –n

#vi /erc/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   noproc     10000(可选)
*   hard  noproc   10000(可选)

*   soft   nofile  65535

*   hard  nofile  65535 (添加的两行)

# End of file

:wq 保存退出

说明:

*      代表针对所有用户
noproc 是代表最大进程数
nofile  是代表最大文件打开数

注意:

这个当中的硬限制是实际的限制,而软限制是warnning限制,只会做出warning;

执行下面的两条命令

ulimit –Hn 65535

ulimit –Sn 65535

最后重启系统才能生效  reboot

在查看 ulimit –n

#ulimit –n

65535

已打开文件数限制,已调至最大。


 

软件
前端设计
程序设计
Java相关