Linux Increase The Maximum Number Of Open Files / File Descriptors (FD)

The ulimit command provides control over the resources available to the shell and/or to processes started by it, on systems that allow such control. The maximum number of open file descriptors displayed with following command (login as the root user).
Command To List Number Of Open File Descriptors
Use the following command command to display maximum number of open file descriptors:cat /proc/sys/fs/file-max
Output:
75000
75000 files normal user can have open in single login session. To see the hard and soft values, issue the command as follows:# ulimit -Hn
# ulimit -Sn
To see the hard and soft values for httpd or oracle user, issue the command as follows:# su - username
In this example, su to oracle user, enter:# su - oracle
$ ulimit -Hn
$ ulimit -Sn
System-wide File Descriptors (FD) Limits
The number of concurrently open file descriptors throughout the system can be changed via /etc/sysctl.conf file under Linux operating systems.
The Number Of Maximum Files Was Reached, How Do I Fix This Problem?
Many application such as Oracle database or Apache web server needs this range quite higher. So you can increase the maximum number of open files by setting a new value in kernel variable /proc/sys/fs/file-max as follows (login as the root):# sysctl -w fs.file-max=100000
Above command forces the limit to 100000 files. You need to edit /etc/sysctl.conf file and put following line so that after reboot the setting will remain as it is:# vi /etc/sysctl.conf
Append a config directive as follows:fs.file-max = 100000
Save and close the file. Users need to log out and log back in again to changes take effect or just type the following command:# sysctl -p
Verify your settings with command:# cat /proc/sys/fs/file-max
OR# sysctl fs.file-max
User Level FD Limits
The above procedure sets system-wide file descriptors (FD) limits. However, you can limit httpd (or any other users) user to specific limits by editing /etc/security/limits.conf file, enter:# vi /etc/security/limits.conf
Set httpd user soft and hard limits as follows:httpd soft nofile 4096
httpd hard nofile 10240
Save and close the file. To see limits, enter:# su - httpd
$ ulimit -Hn
$ ulimit -Sn
A note about RHEL/CentOS/Fedora/Scientific Linux users
Edit /etc/pam.d/login file and add/modify the following line (make sure you get pam_limts.so):
session required pam_limits.so
Save and close the file.
FROM:https://www.cyberciti.biz/faq/linux-increase-the-maximum-number-of-open-files/
Linux Increase The Maximum Number Of Open Files / File Descriptors (FD)的更多相关文章
- Maximum number of WAL files in the pg_xlog directory (2)
Jeff Janes: Hi, As part of our monitoring work for our customers, we stumbled upon an issue with our ...
- Maximum number of WAL files in the pg_xlog directory (1)
Guillaume Lelarge: Hi, As part of our monitoring work for our customers, we stumbled upon an issue ...
- the max number of open files 最大打开文件数 ulimit -n RabbitMQ调优
Installing on RPM-based Linux (RHEL, CentOS, Fedora, openSUSE) — RabbitMQ https://www.rabbitmq.com/i ...
- The maximum number of processes for the user account running is currently , which can cause performance issues. We recommend increasing this to at least 4096.
[root@localhost ~]# vi /etc/security/limits.conf # /etc/security/limits.conf # #Each line describes ...
- tomcat 大并发报错 Maximum number of threads (200) created for connector with address null and port 8080
1.INFO: Maximum number of threads (200) created for connector with address null and port 8091 说明:最大线 ...
- tomcat 大并发报错 Maximum number of threads (200) created for connector with address null and port 80
1.INFO: Maximum number of threads (200) created for connector with address null and port 80 说明:最大线程数 ...
- "Your computer could not be joined to the domain. You have exceeded the maximum number of computer accounts you are allowed to create in this domain. Contact your system administrator to have this limit reset or increased."
用一个普通的域帐号玩私有云的时候,遇到了如下的报错. "Your computer could not be joined to the domain. You have exceeded ...
- InnoDB: The log sequence number in ibdata files does not match
InnoDB: The log sequence number in ibdata files does not matchInnoDB的:在ibdata文件的日志序列号不匹配 可能ibdata文件损 ...
- tomcat调优方案Maximum number of threads (200) created for connector with address null and port 8091
1.tomcat6大并发出现:INFO: Maximum number of threads (200) created for connector with address null and por ...
随机推荐
- [BZOJ 3942] [Usaco2015 Feb] Censoring 【KMP】
题目链接:BZOJ - 3942 题目分析 我们发现,删掉一段 T 之后,被删除的部分前面的一段可能和后面的一段连接起来出现新的 T . 所以我们删掉一段 T 之后应该接着被删除的位置之前的继续向后匹 ...
- 横向技术分析C#、C++和Java优劣
转自横向技术分析C#.C++和Java优劣 C#诞生之日起,关于C#与Java之间的论战便此起彼伏,至今不辍.抛却Microsoft与Sun之间的恩怨与口角,客观地从技术上讲,C#与Java都是对传统 ...
- ArtisticStyle----很好用的C/C++样式格式化工具
下载地址:http://srgb.googlecode.com/files/AStyle_2.02_windows.7z 把astyle.exe 复制到 C:\WINDOWS 目录里,省的指定路径VC ...
- C++必备知识
新进C++程序员应在一年内完成学习“basic”类别知识点,两年内完成学习“advance”类别知识点,三到四年内完成学习“expert”1.基础(Basic)(1)变量与基本类型:(2)typede ...
- 【转】Android ROM研究---Android build system增加模块
原文网址:http://hualang.iteye.com/blog/1141315 Android build system就是编译系统的意思 在我们需要向自己编译的源代码中增加模块的时候,需要一些 ...
- 最详细在Windows安装Xamarin.iOS教程
最详细在Windows安装Xamarin.iOS教程 来源:http://www.cnblogs.com/llyfe2006/articles/3098280.html 本文展示了如何设立Xamari ...
- Front-End Engineer 技术栈
自己根据各种招聘网站上的技术要求做的,希望自己能成为这样的人.
- Codeforces 350B Resort
题目链接:http://codeforces.com/problemset/problem/350/B 一开始想复杂了,建了张图,结果效率太低T了.其实用数组存可以了,结果发现的时候快没时间了,修改好 ...
- 在LINUX终端和VIM下复制粘贴
http://www.tinylab.org/linux-terminal-and-paste-copy-under-vim/ 在GUI界面下,我们可以很自由的复制粘贴.但是在字符界面下,我们不得不用 ...
- Java 内存泄露的理解与解决过程
本文详细地介绍了Java内存管理的原理,以及内存泄露产生的原因,同时提供了一些列解决Java内存泄露的方案,希望对各位Java开发者有所帮助. Java内存管理机制 在C++ 语言中,如果需要动态分配 ...