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 ...
随机推荐
- Mvc Model 模板的获取【学习笔记】
MVC的Model模板有两种:一种编辑模式(@Html.EditorFor()).一种显示模式(Html.DisplayFor()). 模板的获取与执行(以下转自这里): 当我们调用HtmlHelpe ...
- Ubuntu下安装nvidia显卡驱动
layout: post title: Ubuntu下安装nvidia显卡驱动 date: 2015-10-02 17:19:06 categories: 常用命令 tags: 显卡 驱动 最近一直在 ...
- [CF Round #294 div2] E. A and B and Lecture Rooms 【树上倍增】
题目链接:E. A and B and Lecture Rooms 题目大意 给定一颗节点数10^5的树,有10^5个询问,每次询问树上到xi, yi这两个点距离相等的点有多少个. 题目分析 若 x= ...
- 【技术贴】解决支付宝充值信用卡还款跳转到网上银行报错Error 404 - Not Found
声明 : 本文在 GFDL 1.2 下发布,本文出处光大银行信用卡 http://bbs.090989.com/forum-186-1.html http://androidgao.blogspot ...
- Hibernate中对象的三种状态以及Session类中saveOrUpdate方法与merge方法的区别
首先,用一张图说明一个对象,在Hibernate中,在调用了不同方法之后对象所处的不同状态 在Hibernate中,一个对象的状态可以被分为如图所示的三种 Transient:瞬时对象,该对象在数据库 ...
- android.graphics.Matrix
Matrix类包含了一个3x3的矩阵用来改变坐标,它没有一个构造器来初始化它里边的内容,所以创建实例后需要调用reset()方法生成一个标准matrix,或者调用set..一类的函数,比如setTra ...
- vijosP1902学姐的清晨问候
题目:https://vijos.org/p/1902 题解:sb题...扫一遍每个字母出现的次数即可 代码: #include<cstdio> #include<cstdlib&g ...
- BZOJ1232: [Usaco2008Nov]安慰奶牛cheer
1232: [Usaco2008Nov]安慰奶牛cheer Time Limit: 10 Sec Memory Limit: 162 MBSubmit: 578 Solved: 403[Submi ...
- git 添加忽略文件
使用github for windows客户端添加.gitignore文件: 如下图所示,在github客户端可以看到未提交的更改列表 随便选中一个文件,右链,选择ignore file. 然后会 ...
- Nginx 代理 jira 和 confluence
原文出处:http://blog.chenlb.com/2012/01/nginx-proxy-jira-and-confluence.html jira 和 confluence 想部署到同一台机器 ...