Linux下查看用户所能打开的最大文件个数的设置:

使用命令查看: ulimit –n

文件设置位置:/etc/security/limits.conf

#<domain>        <type>  <item>  <value>

#<domain> can be:用户名,组名

#        - an user name

#        - a group name, with @group syntax

#        - the wildcard *, for default entry

#        - the wildcard %, can be also used with %group syntax,

#                 for maxlogin limit

#

#<type> can have the two values:

#        - "soft" for enforcing the soft limits

#        - "hard" for enforcing hard limits

#

#<item> can be one of the following:

#        - core - limits the core file size (KB)

#        - data - max data size (KB)

#        - fsize - maximum filesize (KB)

#        - memlock - max locked-in-memory address space (KB)

#        - nofile - max number of open files最大打开的文件数

#        - rss - max resident set size (KB)

#        - stack - max stack size (KB)

#        - cpu - max CPU time (MIN)

#        - nproc - max number of processes

#        - as - address space limit (KB)

webserver soft nofile 65536

webserver hard nofile 65536

               查看进程的文件打开数

查看所有进程的文件打开数:lsof |wc –l

查看某个进程的文件打开数:lsof –p pid |wc –l

Pid:进程号