Monday, December 15, 2008

Jruby / Tomcat Too Many Open Files

For those plagued by the following error in Tomcat running JRuby

IOError (/usr/local/tomcat/webapps/myapp/WEB-INF/app/controllers/sessions_controller.rb (Too many open files)):

This is apparently a leak in <> should display your current max limit

Assuming your java pid is 1111, type "lsof +p 1111 | wc -l" and compare to the number above, it should almost certainly be higher than the limit.

To fix this on Redhat Linux edit the file /etc/security/limits.conf and add a line that looks like:

* - nofile 4096

To fix this on Solaris edit the file /etc/system and add a line that looks like:

set rlim_fd_cur = 4096
set rlim_fd_max = 4096

13 comments:

George Secillano said...

Thanks for the post. I always thought setting ulimit would solve it but it's currently set to unlimited. I'll try your solution. I don't get the error all the time, though.

Dberg said...

ulimit is only for the current user shell I believe, but does not affect all newly spawned system processes. I learned that one the hard way too :-)

Unknown said...

We are offering design services in affordable price for your businesses and much more......

IT said...

JMS Training Institutes in Chennai JMS Training Institutes in Chennai | JSP Training Institutes in Chennai | Spring Training Institutes in Chennai Spring Training Institutes in ChennaiMicroServices Training Institutes In Chennai Java MicroServices Training Institutes In Chennai
Java EE Training Institutes in Chennai Java EE Training Institutes in Chennai

Unknown said...

It is really very excellent,I find all articles was amazing.Awesome way to get exert tips from everyone,not only i like that post all peoples like that post.Because of all given information was wonderful and it's very helpful for me.

Java Training in Chennai | Java Training Institute in Chennai

janathan said...

very informative keepsharing.....
freeinplanttrainingcourseforECEstudents
internship
internship-for-aeronautical-engineering-students-in-india
internship-for-cse-3rd-year-students
freeinplanttrainingcourseforMECHANICALstudents
internship-in-chennai-for-ece
inplant-training-for-civil
internship-at-bsnl
internship-for-2nd-year-ece-students
internship-for-aeronautical-students-in-chennai

Vijaykumar said...

great informative...
Inplant Training in Chennai
Iot Internship
Internship in Chennai for CSE
Internship in Chennai
Python Internship in Chennai
Implant Training in Chennai
Android Training in Chennai
R Programming Training in Chennai
Python Internship
Internship in chennai for EEE

Vijaykumar said...

nice..
Crome://Flags
Python Programming Questions and Answers PDF
Qdxm Sfyn Uioz
How To Hack Whatsapp Account Ethical Hacking
Power Bi Resume
Whatsapp Unblock Software
Tp Link Password Hack
The Simple Interest Earned On a Certain Amount Is Double
A Certain Sum Amounts To RS. 7000 in 2 years and to RS. 8000 in 3 Years. Find The Sum.
Zensoft Aptitude Questions

jenani said...

Excellent way of expressing your ideas with a clear vision, Keep updating
Java Training in Chennai

Java Training in Velachery

Java Training inTambaram

Java Training in Porur

Java Training in Omr

Java Training in Annanagar

vanathi said...

Articles are Excellent content,Thanks for your all Effective works.Keep Going With it,and thank for sharing with us.
Software Testing Training in Chennai

Software Testing Training in Velachery

Software Testing Training in Tambaram

Software Testing Training in Porur

Software Testing Training in Omr
Software Testing Training in Annanagar

subathara said...

I have read your blog its very attractive and impressive. I like it your blog.
Digital Marketing Training in Chennai

Digital Marketing Training in Velachery

Digital Marketing Training in Tambaram

Digital Marketing Training in Porur

Digital Marketing Training in Omr

Digital MarketingTraining in Annanagar

Anonymous said...

Play Casinos & Bonus Codes | The FilmFileEurope
Discover 888 스포츠 the Best Casino Sites for 2021 in the market with Casino Games and Bonus Codes 무료 해외 축구 for Bonuses. The best Casino 스마일토토 sites, 188bet Bonus codes, 양방배팅 Free Spins,

WordPress Training in Hyderabad said...

Learn to create your website from experts