PDA

View Full Version : [ubuntu] Too many open files even after changing the limits.conf



dr-alves
September 25th, 2009, 06:46 AM
Hi

I'm using ubuntu karmic without a hitch so far.
My box has the desktop installed but is mostly a server box (was installed as such at first) and that's why i'm posting here.
One of the things I run in my box is jboss with several applications deployed (jira, hudson, confluence) but I'm getting a weird error

Jboss fails to deploy some applications due to "too many open files". When I first saw this I thought it would be simple to solve, just needed to up ulimit, now I'm not so sure.

I increased the limit to all user to 65536 (at first I had only * but then i decided to get creative):



* soft nofile 65536
* hard nofile 65536
jboss soft nofile 65536
jboss hard nofile 65536
root soft nofile 65536
root hard nofile 65536


Also the max limit is high

linux-server:~# cat /proc/sys/fs/file-max
202989

and the max ever occupied is well below the limit:
cat /proc/sys/fs/file-nr
6304 0 202989


all users return the same limit (including the jboss user who initiates the app server):
jboss@linux-server:/home$ ulimit -n
65536


I'm out of ideas and it is hard to find results in google as similar problems are always solved upping ulimit.

Any ideas?


Regards
David R Alves

dr-alves
September 28th, 2009, 09:18 AM
Shameless bump!

Still need help figuring out this issue.

Anyone?

Cheers
David

dr-alves
October 9th, 2009, 12:30 AM
Still getting this issue.

I've done that i can find on google. All users return 65536 limits and still applications crash due to "too many open files".

Please help!!

Xianath
October 9th, 2009, 07:16 AM
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

Any discrepancy between what you see in your processes and what you've set in limits.conf? You may need to add the following to /etc/pam.d/common-session:


session required pam_limits.so

Cheers,
Peter

RafaelSantos
October 20th, 2009, 05:36 PM
I'm having this problem too, I'll try to explain better (but sorry about my awful english):

I have a server running Nginx + Jetty 6 on a Ubuntu Server 8.10 and I'm receiving some error messages of "Too many open files". Since then I'm trying to increase the "nofile" limit without success.

On my /etc/security/limits.conf:

* soft nofile 2048
* hard nofile 4096

# grep pam_limits.so *
atd:session required pam_limits.so
common-session:session required pam_limits.so
cron:session required pam_limits.so
login:session required pam_limits.so
sshd:session required pam_limits.so
su:session required pam_limits.so
sudo:session required pam_limits.soBut its not working:


# 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
/usr/lib/jvm/java-6-sun-1.6.0.14/jre/bin/java-DSTART=/usr/share/jetty6/etc/start.config-Xms512m-Xmx4096m-XX:MaxPermSize=800M-Djava.awt.headless=true-javaagent:/usr/share/jetty6/newrelic/newrelic.jar-Dnewrelic.environment=production-Djetty.home=/usr/share/jetty6-Djava.io.tmpdir=/var/cache/jetty6-jar/usr/share/jetty6/start.jar/etc/jetty6/jetty-logging.xml/etc/jetty6/jetty.xml
Limit Soft Limit Hard Limit Units
Max open files 1024 1024 files
Currently open files: 919Any ideas?

RafaelSantos
October 21st, 2009, 08:14 PM
Desperated bump...

I've tried to find some help on google and found more people with the same problem but got no answers. :frown:

stlhrt
October 27th, 2009, 03:20 PM
I have the same problem on ubuntu 8.10 and 9.04.

setting limits in

/etc/security/limits.conf
/etc/sysctl.conf


when logged in
ulimit-n
shows correct limits per user, but after spawnig java process


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

shows limit 1024

fail :(

stlhrt
October 27th, 2009, 08:32 PM
ok, solved mine problem...
$BEA_HOME/weblogic81/common/bin/commEnv.sh contains calls to
ulimit -n 1024
hack it and you are set ;) i bet jetty scripts contain something similar