/proc/sys/fs 内容解析

This subdirectory contains specific file system, file handle, inode, dentry and quota information.

1,/proc/sys/fs/aio-max-nr

aio-max-nr allows you to change the maximum value/proc/sys/fs/aio-nr can grow to.

2,/proc/sys/fs/aio-nr

aio-nr shows the current system-wide number of asynchronous io requests.

3,/proc/sys/fs/bio_netoops

4,/proc/sys/fs/dentry-state

tatus of the directory cache. Since directory entries are dynamically allocated and deallocated, this file indicates the current status. It holds six values of which only the first three are used:

  • nr_dentry - number of dentries currently allocated
  • nr_unused - nuber of unused dentries
  • age_limit - seconds after the entry may be reclaimed, when memory is short

Last three values are not used and are always zero.

5,/proc/sys/fs/dir-notify-enable

This file controls dnotify, a directory notification mechanism, and will not appear if dnotify support is compiled out. It was introduced with inotify in case some people want to disable dnotify support at runtime.

There are two possible values:

  • 1 - dnotify is enabled (default)
  • 0 - dnotify is disabled

6,/proc/sys/fs/file-max

The kernel allocates file handles dynamically, but doesn‘t free them again at this time.

The value in file-max denotes the maximum number of file handles that the Linux kernel will allocate. When you get a lot of error messages about running out of file handles, you might want to raise this limit. The default value is 10% of RAM in kilobytes.

7,/proc/sys/fs/file-nr

Historically, the three values in file-nr denoted the number of allocated file handles, the number of allocated but unused file handles, and the maximum number of file handles. Linux 2.6 always reports 0 as the number of free file handles - this is not an error, it just means that the number of allocated file handles exactly matches the number of used file handles.

8,/proc/sys/fs/inode-nr

The file inode-nr contains the first two items from/proc/sys/fs/inode-state.

9,/proc/sys/fs/inode-state

inode-state contains two actual numbers and five dummy values. The numbers are:

  • nr_inodes - denotes the number of inodes the system has allocated. This number will grow and shrink dynamically.
  • nr_free_inodes - represents the number of free inodes. Ie. the number of inuse inodes is (nr_inodes - nr_free_inodes).

10,/proc/sys/fs/lease-break-time

This file specifies the grace period (in seconds) that the kernel grants to a process holding a file lease 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.

11,/proc/sys/fs/leases-enable

This file can be used to enable or disable file leases on a system-wide basis. If this file contains the value 0, leases are disabled. A non-zero value enables leases.

12,/proc/sys/fs/nr_open

13,/proc/sys/fs/overflowgid

Some filesystems only support 16-bit GIDs, although in Linux GIDs are 32 bits. When one of these filesystems is mounted with writes enabled, any GID that would exceed 65535 is translated to a fixed value before being written to disk.

This sysctl allows you to change the value of the fixed GID. The default is 65534.

14,/proc/sys/fs/overflowuid

Some filesystems only support 16-bit UIDs, although in Linux UIDs are 32 bits. When one of these filesystems is mounted with writes enabled, any UID that would exceed 65535 is translated to a fixed value before being written to disk.

This sysctl allows you to change the value of the fixed UID. The default is 65534.

15,/proc/sys/fs/suid_dumpable

The value in this file determines whether core dump files are produced for set-user-ID or otherwise protected/tainted binaries. Three different integer values can be specified:

  • 0 (default) - This provides the traditional behaviour. A core dump will not be produced for a process which has changed credentials (by calling seteuid(2), setgid(2), or similar, or by executing a set-user-ID or set-group-ID program) or whose binary does not have read permission enabled.
  • 1 ("debug") - All processes dump core when possible. The core dump is owned by the file system user ID of the dumping process and no security is applied. This is intended for system debugging situations only. Ptrace is unchecked.
  • 2 ("suidsafe") - Any binary which normally would not be dumped (see "0" above) is dumped readable by root only. This allows the user to remove the core dump file but not to read it. For security reasons core dumps in this mode will not overwrite one another or other files. This mode is appropriate when administrators are attempting to debug problems in a normal environment.

16,/proc/sys/fs/inotify

The following interfaces can be used to limit the amount of kernel memory consumed by the inotify file system event-monitoring mechanism.

16.1 /proc/sys/fs/inotify/max_queued_events

The value in this file is used when an application calls inotify_init(2) to set an upper limit on the number of events that can be queued to the corresponding inotify instance. Events in excess of this limit are dropped, but an IN_Q_OVERFLOW event is always generated.

16.2 /proc/sys/fs/inotify/max_user_instances

16.3 /proc/sys/fs/inotify/max_user_watches

时间: 2024-08-08 05:36:30

/proc/sys/fs 内容解析的相关文章

设置Linux打开文件句柄/proc/sys/fs/file-max和ulimit -n的区别

max-file 表示系统级别的能够打开的文件句柄的数量.是对整个系统的限制,并不是针对用户的. ulimit -n 控制进程级别能够打开的文件句柄的数量.提供对shell及其启动的进程的可用文件句柄的控制.这是进程级别的. 对于服务器来说,file-max和ulimit都需要设置,否则会出现文件描述符耗尽的问题. 一般如果遇到文件句柄达到上限时,会碰到"Too many open files"或者Socket/File: Can't open so many files等错误. 为了

linux /proc/sys/fs/file-nr /proc/sys/fs/file-max /etc/security/limits.conf 三者的关联

ulimit -n 对应 /etc/security/limits.conf 文件设置 问题: Can’t open so many files 对于linux运维的同学们,相信都遇到过这个问题. 在Linux下一切资源皆文件,普通文件是文件,磁盘打印机是文件,socket 当然也是文件.系统默认设置成1024,但是这个数字对于服务器特别是大并发的远远是不够的,所以,我们需要结合实际情况修改成一个更大更合理的值. 修改方法 临时解决方案: ulimit -SHn 65535 永久解决方案,注意,

inotify报错Failed to watch /opt; /proc/sys/fs/inotify/max_user_watches,K哥

2016.11.8 K哥有2台服务器使用了unison+inotify达到网站文件夹时时同步的效果 今天突然发现inotify占用很大CPU,可以用top命令查看 打开inotify日志查看原因 发现这一报错 Failed to watch /opt; upper limit on inotify watches reached!Please increase the amount of inotify watches allowed per user via `/proc/sys/fs/ino

Difference between ulimit, lsof, cat /proc/sys/fs/file-max

https://unix.stackexchange.com/questions/476351/difference-between-ulimit-lsof-cat-proc-sys-fs-file-max https://www.cyberciti.biz/faq/linux-increase-the-maximum-number-of-open-files/ https://access.redhat.com/documentation/en-us/red_hat_enterprise_li

linux /proc/sys

所有的TCP/IP调优参数都位于/proc/sys/net/目录.例如, 下面是最重要的一些调优参数,后面是它们的含义: 1./proc/sys/net/core/rmem_max — 最大的TCP数据接收缓冲 2./proc/sys/net/core/wmem_max — 最大的TCP数据发送缓冲 3./proc/sys/net/ipv4/tcp_timestamps — 时间戳在(请参考RFC 1323)TCP的包头增加12个字节 4./proc/sys/net/ipv4/tcp_sack 

Linux TCP/IP调优参数 /proc/sys/net/目录

所有的TCP/IP调优参数都位于/proc/sys/net/目录. 例如, 下面是最重要的一些调优参数,后面是它们的含义: /proc/sys/net/core/rmem_default "110592" 定义默认的接收窗口大小:对于更大的 BDP 来说,这个大小也应该更大. /proc/sys/net/core/rmem_max "110592" 定义接收窗口的最大大小:对于更大的 BDP 来说,这个大小也应该更大. /proc/sys/net/core/wmem

/proc/sys 子目录的作用

该子目录的作用是报告各种不同的内核参数,并让您能交互地更改其中的某些.与 /proc 中所有其他文件不同,该目录中的某些文件可以写入,不过这仅针对 root. 其中的目录以及文件的详细列表将占据过多的篇幅,而且该目录的内容是依赖于系统的,而 大部分的文件也仅仅对某些特殊的应用程序有用.然而,以下是该子目录的两个最常见的用 途: 允许路由:即便是 Mandrakelinux 默认的内核也是允许路由的,您必需显式允许它这么 做.为此,您只要以 root 身份键入以下命令: $ echo 1 >/pr

[转]手工释放linux内存——/proc/sys/vm/drop_caches

另一篇:http://www.linuxfly.org/post/320/ ? 1.清理前内存使用情况?free -m 2.开始清理??echo 1 > /proc/sys/vm/drop_caches 3.清理后内存使用情况?free -m 4.完成! 查看内存条数命令: dmidecode?|?grep?-A16?"Memory?Device$" ? ? ? ? ? +++++++++++++++++++++++++++++++++++++++++++++++++++++++

/proc/sys/net/ipv4/ip_forward

ip地址分公有地址和私有地址,public address是由INIC(internet network information center)负责,这些ip地址分配给注册并向INIC提出申请的组织机构.通过它访问internet.private address是属于非注册地址,专门为组织内部使用,private ip address是不可能直接用来跟WAN通信的,要么利用帧来通信(FRE帧中继,HDLC,PPP),要么需要路由的NAT功能把私有地址转换为一个公有ip! 选择一台电脑(有两个网卡