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 6003 「网络流 24 题」魔术球
题目描述 假设有 \(n\) 根柱子,现要按下述规则在这 \(n\) 根柱子中依次放入编号为 \(1, 2, 3, 4, \cdots\) 的球. 每次只能在某根柱子的最上面放球. 在同一根柱子中,任 ...
- Pair_2测试与优化
# Pair_2测试与优化 211606316李震 21160305胡彤 一.预估与实际 PSP2.1 Personal Software Process Stages 预估耗时(分钟) 实际耗时(分 ...
- 团体程序设计天梯赛-L3-021 神坛 的一些错误做法 和 一些想法
https://pintia.cn/problem-sets/994805046380707840/problems/994805046577840128 错误做法: 极角排序 + 最小三角形的两边是 ...
- 风控模型-美国FICO标准
python信用评分卡(附代码,博主录制) https://study.163.com/course/introduction.htm?courseId=1005214003&utm_camp ...
- python爬虫 scrapy1-安装及创建第一个项目
sklearn实战-乳腺癌细胞数据挖掘(博主亲自录制视频) https://study.163.com/course/introduction.htm?courseId=1005269003& ...
- 2018年5月6日GDCPC (广东赛区)总结
试机是队友浩哥一个人去的,因为觉得华工去了不少次了,环境也比较熟悉了.直到看到了现场环境,感觉有些拥挤,不如从前那样宽敞,增加了一些紧张的不适感. 比赛开始时,我们三人分头读题,虽说题目比较简短,但第 ...
- HDU 1729 类NIM 求SG
每次有n个盒子,每个盒子有容量上限,每次操作可以放入石头,数量为不超过当前盒子中数量的平方,不能操作者输. 一个盒子算一个子游戏. 对于一个盒子其容量为s,当前石子数为x,那么如果有a满足 $a \t ...
- NEGOUT: SUBSTITUTE FOR MAXOUT UNITS
NEGOUT: SUBSTITUTE FOR MAXOUT UNITS Maxout [1] units are well-known and frequently used tools for De ...
- 浅谈 JSON 那些被转义的字符们
其实,之前我一直以为 JSON 会把 ASCII 可显示字符以外的统统转义为 Unicode,直到有一次我用 JSON.stringify 才发现,其实是 PHP 为我们想的太周到了. 我以前是一位 ...
- html template--(来自网易)
html template 概述 包含完整头部信息和主体结构的HTML基础模板. 代码展示 <!DOCTYPE html> <html> <head> < ...