Jetty - linux -Too many open files

今天碰到个问题,jetty系统跑的时候点击页面突然报 internal server error 错,翻了一下日志,发现很多jsp not found的错误:

2013-11-28 04:29:16,500 WARN [SymmetricDS] [log] [1002316844@qtp-718123118-23] /xx/xx/xx/xx/xx/xx-wizard.do
org.apache.jasper.JasperException: PWC6117: File "/common/error.jsp" not found
        at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:89)
        at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:375)
        at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:169)
        at org.apache.jasper.compiler.JspUtil.getInputStream(JspUtil.java:910)
        at org.apache.jasper.xmlparser.XMLEncodingDetector.getEncoding(XMLEncodingDetector.java:143)
        at org.apache.jasper.compiler.ParserController.determineSyntaxAndEncoding(ParserController.java:376)
        at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:210)

继续翻,看到一个可疑的地方:

2013-11-28 04:29:10,552 WARN [] [log] [1059039254@qtp-718123118-25] Nested in org.apache.jasper.JasperException: PWC6344: Unable to create output writer for file ../xx/WEB-INF/jspclasses/org/apache/jsp/common/error_jsp.java:
java.io.FileNotFoundException: ../xx/WEB-INF/jspclasses/org/apache/jsp/common/error_jsp.java (Too many open files)
        at java.io.FileOutputStream.open(Native Method)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:70)
        at org.apache.jasper.compiler.JDTJavaCompiler.getJavaWriter(JDTJavaCompiler.java:149)
        at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:188)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:435)
        at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:608)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:360)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:486)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:380)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

 

看来是因为jetty进程打开文件数的限制,导致进程不能生成jsp页面到linux的文件系统里。

先ps aux |grep jetty 一下,找到jetty的pid,然后

lsof -u jettypid看一下当前用户的文件数是1286,

再查看一下当前用户级的可打开文件数: ulimit -a

默认是1024.

 

需要改大,更改 /etc/security/limits.conf,加入

soft nofile 65535

hard nofile 65535

 

 本文出自 “祝坤荣” 博客,请务必保留此出处

 

时间: 2024-10-01 11:49:34

Jetty - linux -Too many open files的相关文章

weblogic10.0 linux, too many open files该问题出现时未达到linux未达到open files上限

问题描述 产品环境:weblogic10.0 集群(4 manageed servers),linux(仅供对比 测试环境:weblogic10.0 集群(2 managed servers)) ,linux 没出现too many open files 问题产品环境和测试环境的weblogic和linux配置一样.产品环境[ecgadmin@g4t0923g ~/domain/ecgDomain/servers/ecgNode1/logs]$ ulimit -acore file size (

linux too many open files解决方案

  这个问题的出现原因是system对程序打开files数量的限制问题. 用 ulimit -a 命令可以查看 [root@5 ~]# ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 4096 max locked memory (

linux启动系统时UNEXPECTED INCONSISTENCY报错

启动系统时,出现以下错误. 这意味着确认文件系统时发现了问题,在这里介绍一下修复文件系统错误的方法. Checking filesystems /12: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.             (i.e., without -a or -p options) *** An error occurred during the file system check. *** Dropping you to a shell; th

BitNami LAMPStack 5.3.8-0发布 PHP应用程序

BitNami LAMPStack是一个易于安装的开发环境和部署PHP应用程序.它包括预配置的http://www.aliyun.com/zixun/aggregation/14417.html">Apache,MySQL和PHP,phpMyAdmin的发行版.Amazon AWS PHP SDK可以更容易地开发在Amazon网络服务运行上PHP应用程序.AWS PHP SDK包括AWS PHP库,代码示例和文档版本. BitNami LAMPStack 5.3.8-0版本的PHP已更新到

Nginx的优化与防盗链

Nginx是俄罗斯人编写的十分轻量级的HTTP服务器,Nginx,它的发音为"engine X",是一个高性能的HTTP和反向代理服务器,同时也是一个IMAP/POP3/SMTP 代理服务器.Nginx是由俄罗斯人Igor Sysoev为俄罗斯访问量第二的Rambler.ru站点开发. Nginx以事件驱动(epoll)的方式编写,所以有非常好的性能,同时也是一个非常高效的反向代理.负载平衡.但是Nginx并不支持cgi方式运行,原因是可以减少因此带来的一些程序上的漏洞.所以必须使用F

Git for Windows v2.8.3 Release Notes

Git for Windows v2.8.3 Release Notes Latest update: May 20th 2016 Introduction These release notes describe issues specific to the Git for Windows release. The release notes covering the history of the core git commands can be found in the Git projec

unity的一些特殊目录

Hidden Folders Folders that start with a dot (e.g. ".UnitTests/", ".svn/") are ignored by Unity. Any assets in there are not imported, and any scripts in there are not compiled. They will not show up in the Project view. "Standard

python备份脚本提示文件名,目录或卷标语法出错(Windows7)

问题描述 python备份脚本提示文件名,目录或卷标语法出错(Windows7) 1C #Filename:backup_ver1.py import osimport time #1.the files and directories tobe backed up are specified in a listsource=['D:LibraryPcb''D:LibraryPLD'] target_dir='F:DD' target=target_dir+time.strftime('%Y%m

BitNami Tomcat Stack 7.0.20-0发布 Tomcat安装程序

BitNami Tomcat Stack是一个安装环境来开发和调配Java应用程序的Tomcat安装程序.它包括预配置,http://www.aliyun.com/zixun/aggregation/14417.html">Apache, Tomcat, MySQL, 和Java的运行版本.用户可以得到一个Tomcat安装环境,并在回答相关问题后的在几分钟内运行. BitNami Tomcat Stack 7.0.20-0版本关闭了MySQL binary登录,ctlscript.sh脚本