/proc/sys/fs/file-max
Linux的/proc/sys/fs/file-max决定了当前内核可以打开的最大的文件句柄数。
查看当前的值:
cat /proc/sys/fs/file-max
这个值在kernel的文档里是这样描述的:
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. To change it, just write the new number into the
file:
意思是file-max一般为内存大小(KB)的10%来计算,如果使用shell,可以这样计算:
grep -r MemTotal /proc/meminfo | awk '{printf("%d",$2/10)}'
一般我们不需要主动设置这个值,除非这个值确实较小(可能有各种其他原因导致file-max没有设置为内存的10%)
如何查看当前kernel的句柄:
cat /proc/sys/fs/file-nr
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.
/proc/sys/fs/file-max的更多相关文章
- 设置Linux打开文件句柄/proc/sys/fs/file-max和ulimit -n的区别
max-file 表示系统级别的能够打开的文件句柄的数量.是对整个系统的限制,并不是针对用户的. ulimit -n 控制进程级别能够打开的文件句柄的数量.提供对shell及其启动的进程的可用文件句柄 ...
- stuff in /proc/sys/fs/
This subdirectory contains specific file system, file handle, inode, dentry and quota information. 1 ...
- Linux打开文件句柄/proc/sys/fs/file-max和ulimit -n的区别
max-file 表示系统级别的能够打开的文件句柄的数量.是对整个系统的限制,并不是针对用户的.ulimit -n 控制进程级别能够打开的文件句柄的数量.提供对shell及其启动的进程的可用文件句柄的 ...
- 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运维的同学们,相信都遇到过这个问题. 在 ...
- 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- ...
- Linux TCP/IP调优参数 /proc/sys/net/目录
所有的TCP/IP调优参数都位于/proc/sys/net/目录. 例如, 下面是最重要的一些调优参数,后面是它们的含义: /proc/sys/net/core/rmem_default " ...
- /proc/sys目录下各文件参数说明
linux 其他知识目录 原文链接:https://blog.csdn.net/hshl1214/article/details/4596583 一.前言本文档针对OOP8生产环境,具体优化策略需要根 ...
- [转帖]/proc/sys目录下各文件参数说明
/proc/sys目录下各文件参数说明 https://blog.csdn.net/luteresa/article/details/68061881 一.前言 本文档针对OOP8生产环境,具体优 ...
- Docker Run Cadvisor failed: inotify_add_watch /sys/fs/cgroup/cpuacct,cpu: no such file or directory
原文链接:https://blog.csdn.net/poem_2010/article/details/84836816 没有找这个文件, 这是一个bug,在系统中,是cpu,cpuacct 可以去 ...
随机推荐
- I/O 多路复用的特点:
I/O 多路复用是通过一种机制使一个进程能同时等待多个文件描述符(fd),而这些文件描述符(套接字描述符)其中的任意一个进入读就绪状态,epoll()函数就可以返回. 所以, IO多路复用,本质上不会 ...
- 【重点突破】—— UniApp 微信小程序开发官网学习One
一.初步认识 uni-app官网:https://uniapp.dcloud.io/component/README HBuilderX官方IDE下载地址: http://www.dcloud.io/ ...
- linux修改时区为东八时区,北京时间,上海时间
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime echo "Asia/Shanghai" > /etc/tim ...
- 点云网格化算法---MPA
MPA网格化算法思路 第一步:初始化一个种子三角面.(随机选点,基于该点进行临近搜索到第二点:在基于该线段中点临近搜索到第三点) 图1 第二步:在种子三角面的基础上,进行面片的扩充,利用边的中点进行临 ...
- 改变主程序的入口 main
main只是开发工具所规定的一个特殊函数名称而已.它既不是程序的入口,也不是必须要有的函数. 程序的入口点记录在可执行文件中的一个数据,该数据标明程序从哪个位置开始执行,这个数据是连接程序的时候由li ...
- oracle-参数文件的备份与还原
oracle-参数文件的备份与还原 参数文件是实例启动到nomount状态的必要条件,规定了实例的行为特征,位置跟操作系统相关,一般unix类的系统在$ORACLE_HOME/dbs目录下 (wind ...
- 【MM系列】SAP 创建工厂
公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[MM系列]SAP 创建工厂 前言部分 大家 ...
- Maven项目的常用jar包
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/20 ...
- Linear Discriminant Analysis
Suppose that we model each class density as multivariate Gaussian, in practice we do not know the pa ...
- Kotlin学习(4)Lambda
Lanbda基础 /* *Lambda允许把代码块当作参数传递给函数 */ fun a(plus:(Int,Int)->Unit){ plus(,) //声明函数的地方,调用代码块,在这里传参 ...