打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
How to increase file descriptors max limit on Linux

How to increase file descriptors max limit on Linux

posted on February 27, 2008 in hacks, HowTo, Linux with 10 Comments  

Today my DBA reported that the server she was working on was spitting out “too many open files” errors and no new processes could be started.

This is a common problem with DB servers with heavy transactions. In my environment there are 6 DB instances running on the server. No quite the optimized setup I would say.

The fix was to increase the total file descriptors kernel parameter count in the /etc/sysctl.conf file. I doubled my limit from 8192 to 16384.

The walk through,

1. Find out what the current open file descriptor limit is.

~# more /proc/sys/fs/file-max~# 8192

or

~# sysctl -a | grep fs.file-max~# fs.file-max = 8192

2. View how many open file descriptors are currently being used.

~# more /proc/sys/fs/file-nr~# 8191

3. View how many files are open. The number returned might defer as 1 file descriptor can have multiple open files attached to it.

~# lsof | wc -l~# 10325

4. Edit the kernel paramneter file /etc/sysctl.conf and add line “fs.file-max=[new value]” to it.

~# vi /etc/sysctl.conffs.file-max = 331287

5. Apply the changes.

~# sysctl -p~# fs.file-max = 331287

Problem fixed.

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
The user limit for number of open files is too small.
Linux遭遇Too many open files
CentOS最大文件描述符限制更改
linux最大允许的文件描述符open files数nofile修改
HowTo: Debug Crashed Linux Application Core Files Like A Pro
在Linux中打开了太多文件(Too many open files)的解决方法
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服