码迷,mamicode.com
首页 > 其他好文 > 详细

/proc 文件夹详解

时间:2016-06-21 10:40:01      阅读:145      评论:0      收藏:0      [点我收藏+]

标签:

man 5 proc

http://blog.itpub.net/15480802/viewspace-753819/

/proc/sys/fs/file-max
              This file defines a system-wide limit on the number of open files for all processes.  (See also setr-
              limit(2),  which  can be used by a process to set the per-process limit, RLIMIT_NOFILE, on the number
              of files it may open.)  If you get lots of error messages about running  out  of  file  handles,  try
              increasing this value:

              echo 100000 > /proc/sys/fs/file-max

              The kernel constant NR_OPEN imposes an upper limit on the value that may be placed in file-max.

              If  you  increase  /proc/sys/fs/file-max, be sure to increase /proc/sys/fs/inode-max to 3-4 times the
              new value of /proc/sys/fs/file-max, or you will run out of inodes.

       /proc/sys/fs/file-nr
              This (read-only) file gives the number of files presently opened.  It  contains  three  numbers:  The
              number of allocated file handles, the number of free file handles and the maximum number of file han-
              dles.  The kernel allocates file handles dynamically, but it doesn’t free them again.  If the  number
              of allocated files is close to the

              maximum,  you should consider increasing the maximum.  When the number of free file handles is large,
              you’ve encountered a peak in your usage of file handles and you probably don’t need to  increase  the
              maximum.

       /proc/sys/fs/inode-max
              This  file  contains  the  maximum  number of in-memory inodes.  On some (2.4) systems, it may not be
              present. This value should be 3-4 times larger than the value in file-max, since  stdin,  stdout  and
              network  sockets also need an inode to handle them. When you regularly run out of inodes, you need to
              increase this value.

       /proc/sys/fs/inode-nr
              This file contains the first two values from inode-state.

       /proc/sys/fs/inode-state
              This file contains seven  numbers:  nr_inodes,  nr_free_inodes,  preshrink  and  four  dummy  values.
              nr_inodes is the number of inodes the system has allocated.  This can be slightly more than inode-max
              because Linux allocates them one page full at a time.  nr_free_inodes represents the number  of  free
              inodes.  preshrink is non-zero when the nr_inodes > inode-max and the system needs to prune the inode
              list instead of allocating more.

       /proc/sys/fs/inotify (since Linux 2.6.13)
              This directory contains files max_queued_events, max_user_instances, and max_user_watches,  that  can
              be used to limit the amount of kernel memory consumed by the inotify interface.  For further details,
              see inotify(7).

       /proc/sys/fs/lease-break-time
              This file specifies the grace period that the kernel  grants  to  a  process  holding  a  file  lease
              (fcntl(2)) after it has sent a signal to that process notifying it that another process is waiting to
              open the file.  If the lease holder does not remove or downgrade the lease within this grace  period,
              the kernel forcibly breaks the lease.

       /proc/sys/fs/leases-enable
              This  file  can  be used to enable or disable file leases (fcntl(2)) on a system-wide basis.  If this
              file contains the value 0, leases are disabled.  A non-zero value enables leases.

       /proc/sys/fs/mqueue (since Linux 2.6.6)
              This directory contains files msg_max, msgsize_max, and queues_max, controlling the resources used by
              POSIX message queues.  See mq_overview(7) for details.

 

/proc 文件夹详解

标签:

原文地址:http://www.cnblogs.com/zengkefu/p/5602731.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!