Solving too many open files problem Tomcat 6 and Glassfish in Ubuntu EC2 Amazon
When you get a big chunk indexing of Tomcat 6 or Glassfish, somehow the service get error like "too many open files". (Too many open files) at org.apache.solr.core.SolrCore.getSearcher. Restart tomcat service still give us same error. Yes, actually the problem not in tomcat 6 but in your filesystem. So the solution are :
1. Add fs.file-max = 65536 into /etc/sysctl.conf
2. In /etc/security/limits.conf/ add this :* soft nofile 65535* hard nofile 65535
3. Edit /etc/pam.d/common-session and add this line :session required pam_limits.so
Then restart your server and see if your tomcat working again. Credit to lj4newbies
Comments
Brian (not verified)
Fri, 01/14/2011 - 06:25
Permalink
Awesome
Thanks for the post! :-)
unconundrum (not verified)
Mon, 01/30/2012 - 22:56
Permalink
Amazon Linux
I'm using Amazon Linux on EC2. There is no common-session file. Should I create one or use the existing config-util file that contains similar commands?
admin
Thu, 02/02/2012 - 06:28
Permalink
I also use Amazon EC2
Hi,
I also use Amazon EC2 Ubuntu 64-bit which this files should be existed :
/etc/pam.d/common-session
If you don't, then you can search some PAM installation or leave it and see if your glassfish / tomcat performance.
Add new comment