Fixed “ too many open files ”
来源:互联网 发布:装修立体效果图软件 编辑:程序博客网 时间:2024/06/03 13:30
A couple of days ago we ran into the infamous “too many open files” when our Tomcat web server was under load. There are several blogs around the internet that tries to deal with this issue but none of them seemed to do the trick for us. Usually what you do is to set the ulimit to a greater value (it’s something like 1024 by default). But in order to make it permanent after reboot the first thing suggested is to update the /proc/sys/fs/file-max
file and increase the value then edit the /etc/security/limits.conf
and add the following line * - nofile 2048
(see here for more details). But none of this worked for us. We saw that when doing
cat /proc/<tomcat pid>/limits
the limit was still set to the initial value of 1024:
Limit Soft Limit Hard Limit UnitsMax cpu time unlimited unlimited secondsMax file size unlimited unlimited bytesMax data size unlimited unlimited bytesMax stack size 8388608 unlimited bytesMax core file size 0 unlimited bytesMax resident set unlimited unlimited bytesMax processes 63810 63810 processesMax open files 1024 1024 filesMax locked memory 65536 65536 bytesMax address space unlimited unlimited bytesMax file locks unlimited unlimited locksMax pending signals 63810 63810 signalsMax msgqueue size 819200 819200 bytesMax nice priority 0 0Max realtime priority 0 0Max realtime timeout unlimited unlimited usIt was not until we found this thread that the reason and solution became clear. Our Tomcat instance was started as a service during boot and there’s a bug discovered and filed (with patch) in 2005 that doesn’t seem to have been resolved yet. The bug reveals itself by ignoring the max number of open files limit when starting daemons in Ubuntu/Debain. So the work-around suggested by “BOK” was to edit
/etc/init.d/tomcat
and add:ulimit -Hn 16384ulimit -Sn 16384Finally the max number of open files for Tomcat was increased!
摘自:https://blog.jayway.com/2012/02/11/how-to-really-fix-the-too-many-open-files-problem-for-tomcat-in-ubuntu/
- Fixed “ too many open files ”
- too many open files
- too many open files
- Too many open files
- too many open files
- Too many open files
- too many files open
- too many open files
- too many open files
- Too many open files
- Open Too Many files
- Too many open files
- Too many open files
- too many open files
- Too many open files
- too many open files
- too many files open
- too many open files
- 七种CSS方式让一个容器水平垂直居中
- 类似3D效果_CGAffineTransformScale
- App界面适配iOS11(包括iPhoneX的奇葩尺寸)
- Java 简单分词查询
- sysctl(配置优化参数)
- Fixed “ too many open files ”
- 如何使用SQL Developer创建数据库连接
- 微信小程序小技巧
- Appium运行过程中碰到的问题处理
- 谈谈对iOS消息的理解
- HTML
- 【转载】向Java项目中导入jar包方法详述
- AndroidStudio导入网上下载的代码慢及AndroidStudio不提示代码的解决方法
- Eclipse 接口开发(二)