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 ...
随机推荐
- mybatis ${}与#{}的区别
#{}可以直接获取方法的参数: ${}从方法的参数中利用get方法来获取参数的属性值:
- debian9使用systemd部署etcd集群
在centos上,是可以直接使用yum安装etcd的: # yum list | grep etcd etcd.x86_64 3.2.9-3.el7 @extras 但是,在debian上却没有安装包 ...
- 【CH4201】楼兰图腾
题目大意:给定一个长度为 N 的序列,从序列中任意挑出三个数,求满足中间的数字值最小(最大)有多少种情况. 题解:建立在值域上的树状数组,从左到右扫描一遍序列,统计出每个点左边有多少个数大于(小于)该 ...
- 【CF884D】Boxes And Balls k叉哈夫曼树
题目大意:给定一个大小为 N 的集合,每次可以从中挑出 2 个或 3 个数进行合并,合并的代价是几个数的权值和,求将这些数合并成 1 个的最小代价是多少. 引理:K 叉哈夫曼树需要保证 \((n-1) ...
- jq给单选框 radio添加或删除选中状态
$("#div1 :radio").removeAttr("checked");//删除目标div下所有单选框的选中状态 $("#div1 :radi ...
- sqoop的安装与配置
最近需要将MySQL的数据导出到HDFS,所以搜到了sqoop2.跟sqoop1相比,sqoop2的好处是直接使用程序连接到集群上的sqoop,远程操作.流程是需要先创建link也可以理解成要操作的对 ...
- Spring Boot 1.4 单元测试
在1.3中单元测试这样子的类似代码: // SpringJUnit支持,由此引入Spring-Test框架支持! @RunWith(SpringJUnit4ClassRunner.class) // ...
- Linux命令(七)Linux用户管理和修改文件权限
1. 用户管理 1.1 创建用户/设置密码/删除用户 (-m很重要,自动添加用户家目录) 创建用户组dev, 给用户组dev新建xiaoqin用户,给新用户设置密码! 1.2 查看用户信息 1.3 设 ...
- Spring Cloud(十四)Config 配置中心与客户端的使用与详细
前言 在上一篇 文章 中我们直接用了本应在本文中配置的Config Server,对Config也有了一个基本的认识,即 Spring Cloud Config 是一种用来动态获取Git.SVN.本地 ...
- [整理]javascript压缩、格式化
1.使用packer来压缩JS文件 packer工具在线版:http://dean.edwards.name/packer/ 通过packer对js打包压缩的同时,执行Base62 encode编码后 ...