cancel
Showing results for 
Search instead for 
Did you mean: 

Too many open files (once again)

goldmar
Champ in-the-making
Champ in-the-making
Hello,

I've got the following problem: I've followed the guidelines on increasing the open files limit but Alfresco still crashes now and then. Before I increased the limit, Alfresco was crashing several times a day; now it's better… but it still crashes a few times per week with lots of exceptions and socket failures due to "too many open files".

My limits are actually quite high:
*               soft    nofile          32768
*               hard    nofile          65536‍‍

Is this normal behaviour? Is there anything else I can do?

I'm using Alfresco CE 3.4.d.

Regards,
Mark
4 REPLIES 4

loftux
Star Contributor
Star Contributor
What OS are you running?
Have you followed all the advice in http://wiki.alfresco.com/wiki/Too_many_open_files?

If you run the command found in that article to verify that the settings has taken effect, what is the result?

dranakan
Champ on-the-rise
Champ on-the-rise
Hello,

Check if the values are setted… Sample if your user is alfresco :

su - alfresco
ulimit -n # Soft
ulimit -Hn # Hard
‍‍‍‍

goldmar
Champ in-the-making
Champ in-the-making
Thanks for your suggestions. I'm using Ubuntu 10.04.3 Server LTS. I've rechecked all the stuff and it's really strange.

As expected:
root@myserver:~# su - tomcat6
$ ulimit -n
4096
$ ulimit -Hn
65536‍‍‍‍‍

But if I run for pid in `pidof java`; do echo "$(< /proc/$pid/cmdline)"; egrep 'files|Limit' /proc/$pid/limits; echo "Currently open files: $(ls -1 /proc/$pid/fd | wc -l)"; echo; done as suggested in the wiki:
(this is Alfresco; I've used the WAR package)
/usr/lib/jvm/java-6-sun/bin/java-Djava.util.logging.config.file=/var/lib/tomcat6/conf/logging.properties-Djava.awt.headless=true-Xms2048m-Xmx4096m-Xss1024k-XX:MaxPermSize=256m-XX:NewSize=1024m-Drun.mode=production-XX:+UseConcMarkSweepGC-Djava.net.preferIPv4Stack=true-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager-Djava.endorsed.dirs=/usr/share/tomcat6/endorsed-classpath/usr/share/tomcat6/bin/bootstrap.jar-Dcatalina.base=/var/lib/tomcat6-Dcatalina.home=/usr/share/tomcat6-Djava.io.tmpdir=/tmp/tomcat6-tmporg.apache.catalina.startup.Bootstrapstart
Limit                     Soft Limit           Hard Limit           Units
Max open files            1024                 1024                 files
Currently open files: 142‍‍‍‍

However, at the same time:
/opt/atlassian/jira/jre//bin/java-Djava.util.logging.config.file=/opt/atlassian/jira/conf/logging.properties-XX:MaxPermSize=256m-Xms256m-Xmx768m-Djava.awt.headless=true-Datlassian.standalone=JIRA-Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true-Dmail.mime.decodeparameters=true-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager-Djava.endorsed.dirs=/opt/atlassian/jira/endorsed-classpath/opt/atlassian/jira/bin/bootstrap.jar-Dcatalina.base=/opt/atlassian/jira-Dcatalina.home=/opt/atlassian/jira-Djava.io.tmpdir=/opt/atlassian/jira/temporg.apache.catalina.startup.Bootstrapstart
Limit                     Soft Limit           Hard Limit           Units
Max open files            65536                65536                files
Currently open files: 457‍‍‍‍

Why does it work for JIRA but not for Alfresco? 😞

goldmar
Champ in-the-making
Champ in-the-making
It seems that this is the solution…