linux设置最大打开文件数
一、查看当前用户对进程打开文件最大数的限制
$ ulimit -a | grep open
二、系统对进程打开文件最大数是如何限制的
先来看man的一段解析:
/proc/sys/fs/file-max
This file defines a system-wide limit on the number of open files for all processes. (See also setrlimit(), 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 in the kernel log about running out of file handles (look for "VFS: file-max limit <number> reached"), try increas‐
ing this value: echo > /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 - times the new value of
/proc/sys/fs/file-max, or you will run out of inodes. Privileged processes (CAP_SYS_ADMIN) can override the file-max limit.
(1)修改系统总限制(永久生效)
echo "" > /proc/sys/fs/file-max
(2)修改进程的软硬限制(永久生效)
vi /etc/security/limits.conf
添加:
* soft nofile
* hard nofile
注:*表示所有用户都生效
三、重启shell,校验配置是否生效
$ ulimit -a | grep open
原文出自:http://blog.csdn.net/daiyudong2020/article/details/77828959
linux设置最大打开文件数的更多相关文章
- umilit 修改 linux 最多可打开文件数
ulimit -n 修改 临时修改: ulimit -SHn 65535 永久修改: echo '* - nofile 65535' >> /etc/security/li ...
- Linux 打开文件数
linux设置最大打开文件数 - daiyudong2020的博客 - CSDN博客 https://blog.csdn.net/daiyudong2020/article/details/77828 ...
- the max number of open files 最大打开文件数 ulimit -n RabbitMQ调优
Installing on RPM-based Linux (RHEL, CentOS, Fedora, openSUSE) — RabbitMQ https://www.rabbitmq.com/i ...
- linux 打开文件数 too many open files 解决方法
linux 打开文件数 too many open files 解决方法 too many open files 出现这句提示的原因是程序打开的文件/socket连接数量超过系统设定值. 查看每个用户 ...
- 在Linux最大打开文件数限制下 MySQL 对参数的调整
http://www.actionsky.com/docs/archives/78 2016年4月7日 周文雅 目录 1 起因 2 说明 3 MySQL调整参数的方式 3.1 计算 request ...
- 放开Linux内核对用户进程可打开文件数和TCP连接的限制
一. 检查linux内核uname -alsb_release -a 二. 用户进程可打开文件数限制1) vim /etc/security/limits.conf* - nof ...
- linux系统工程师修改打开文件数限制代码教程。服务器运维技术
提示linux文件打开错误,修改linux打开文件数参数. /etc/pam.d/login 添加 session required /lib/security/pam_limits.so 注意看这个 ...
- 调整Linux最大打开文件数
#!/bin/bash ## 文件数限制 ulimit -n ulimit -Sn ulimit -Hn ## fs.nr_open,进程级别 ## fs.file-max,系统级别 ## 最大文件描 ...
- linux打开文件数测试
/proc/sys/kernel/threads-max 系统最大线程数量 /proc/sys/vm/max_map_count 限制一个进程可以拥有的VMA(虚拟内存区域)的数量 /proc/sys ...
随机推荐
- 【刷题】LOJ 2587 「APIO2018」铁人两项
题目描述 比特镇的路网由 \(m\) 条双向道路连接的 \(n\) 个交叉路口组成. 最近,比特镇获得了一场铁人两项锦标赛的主办权.这场比赛共有两段赛程:选手先完成一段长跑赛程,然后骑自行车完成第二段 ...
- Problem A: 踢罐子 解题报告
Problem A: 踢罐子 Description 平面上有\(n\)个点,其中任意2点不重合,任意3点不共线. 我们等概率地选取一个点A,再在剩下的\(n-1\)个点中等概率地选取一个点B,再在剩 ...
- 一、spring boot 1.5.4入门(web+freemarker)
1.配置maven文件pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmln ...
- 解题:NOIP 2018 保卫王国
题面 最小支配集=全集-最大独立集 所以先把点权改成正无穷/负无穷来保证强制选/不选某个点到独立集里,然后变成了洛谷的动态DP模板 GTMDNOIP2018ZTY #include<stack& ...
- SpringBoot 读取配置文件及profiles切换配置文件
读取核心配置文件 核心配置文件是指在resources根目录下的application.properties或application.yml配置文件,读取这两个配置文件的方法有两种,都比较简单. 先创 ...
- bzoj千题计划189:bzoj1867: [Noi1999]钉子和小球
http://www.lydsy.com/JudgeOnline/problem.php?id=1867 dp[i][j] 落到(i,j)的方案数 dp[i][j]=0.5*dp[i-1][j] ...
- docker重新安装后无法启动
问题描述: docker版本升级或者重新安装后,无法启动服务,出现如下报错: level=error msg="[graphdriver] prior storage driver over ...
- ASP.NET MVC学习(二)之控制器Controller
1.控制器 Controller接收用户请求,将Model和View匹配在一起,共同完成用户请求.它是一个分发器,通过选择不同的Model.View,可以决定完成不同的用户请求. 但Controlle ...
- shell 示例1 从1叠加到100
从1叠加到100 echo $[$(echo +{..})] echo $[(+)*(/)] seq -s |bc
- python中的__call__
如果python中的一个类定义了 __call__ 方法,那么这个类它的实例就可以作为函数调用,也就是实现了 () 运算符,即可调用对象协议 下面是一个简单的例子: class TmpTest: de ...