Re: Too many open files error

2011-08-24 Thread Francis GALIEGUE
On Wed, Aug 24, 2011 at 17:21, Campbell, Lance la...@illinois.edu wrote:
 Tomcat 6.0.32
 Java 1.6.27
 Apache 2.0
 RedHat 6.x 64 bit
 /proc/sys/fs/file-max = 3233344

 We experienced an issue where we were getting the error too many open files 
 in tomcat.  The server manager increase the amount of open files to the 
 above.  But the error kept coming back even after rebooting the server.  Is 
 there a max number of connections that tomcat should run within based on the 
 above specs?

 The servlet in question that was being hit returned an XML document after 
 doing a series of database queries.


file-max is not what you want to modify. It's the user's limit: RMILIT_NFILE.

Look in /etc/security/limits.d. You'll need to restart Tomcat.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Too many open files error

2011-08-24 Thread Campbell, Lance
The file /etc/security/limits.d is empty.  What would be an example of 
something you would expect to see in there that would relate to changing the 
RMILIT_NFILE value? 

Thanks,  

From: Francis GALIEGUE [f...@one2team.com]
Sent: Wednesday, August 24, 2011 10:24 AM
To: Tomcat Users List
Subject: Re: Too many open files error

On Wed, Aug 24, 2011 at 17:21, Campbell, Lance la...@illinois.edu wrote:
 Tomcat 6.0.32
 Java 1.6.27
 Apache 2.0
 RedHat 6.x 64 bit
 /proc/sys/fs/file-max = 3233344

 We experienced an issue where we were getting the error too many open files 
 in tomcat.  The server manager increase the amount of open files to the 
 above.  But the error kept coming back even after rebooting the server.  Is 
 there a max number of connections that tomcat should run within based on the 
 above specs?

 The servlet in question that was being hit returned an XML document after 
 doing a series of database queries.


file-max is not what you want to modify. It's the user's limit: RMILIT_NFILE.

Look in /etc/security/limits.d. You'll need to restart Tomcat.

--
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Too many open files error

2011-08-24 Thread Francis GALIEGUE
On Wed, Aug 24, 2011 at 17:33, Campbell, Lance la...@illinois.edu wrote:
 The file /etc/security/limits.d is empty.  What would be an example of 
 something you would expect to see in there that would relate to changing the 
 RMILIT_NFILE value?


It's a directory, not a file. Create a file named tomcat in it (or
whatever name you want) and put in these two lines:

tomcat softnofile  16384
tomcat hardnofile  16384

(if the user running Tomcat is indeed called tomcat)

If you want to see the current limit, as root, run:

su tomcat -c ulimit -n

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Too many open files error

2011-08-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Lance,

On 8/24/2011 11:21 AM, Campbell, Lance wrote:
 Tomcat 6.0.32 Java 1.6.27 Apache 2.0 RedHat 6.x 64 bit 
 /proc/sys/fs/file-max = 3233344
 
 We experienced an issue where we were getting the error too many 
 open files in tomcat.  The server manager increase the amount of 
 open files to the above.  But the error kept coming back even
 after rebooting the server.  Is there a max number of connections
 that tomcat should run within based on the above specs?
 
 The servlet in question that was being hit returned an XML
 document after doing a series of database queries.

You may find that the problem isn't the number of on-disk files but
the number of file descriptors, which might actually have different
meanings on your system.

It's also possible that the JVM is giving you a spurious message about
too many files when the problem is really the number of /threads/ --
I've seen that in the past, too.

Can you post the exact stack trace that you got along with this error?
Also, how about the output of ulimit -a for the user that actually
runs Tomcat? Finally, what do your Connector elements look like in
conf/server.xml?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5VRJ8ACgkQ9CaO5/Lv0PCD1gCgk7+nPVcTrN87QRiceYYYjnfi
SdEAoK/4AUixlaSqINfTdnLHty+/zI/B
=aigt
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Too Many Open Files error

2007-10-20 Thread Filip Hanik - Dev Lists

usually it is added at

/etc/security/limits.conf

Filip

Nix Hanwei wrote:

Hi Dan,

You can try sysctrl.conf file.  Add in the ulimit -n for open files.

- Original Message 
From: Daniel M Garland [EMAIL PROTECTED]
To: Tomcat Users List users@tomcat.apache.org
Sent: Friday, 19 October 2007 9:43:00
Subject: Re: Too Many Open Files error

Thanks Jim,

It was previously set to 1024, and I quadrupled it. When you say ulimit
 
is persistent will it persist across a reboot?


I don't seem to have the command lsof, I'll try and apt-get it.

Cheers
Dan

Jim Cox wrote:
  

On 10/19/07, Daniel M Garland [EMAIL PROTECTED] wrote:


Should I then place ulimit -n  in the catalina startup scripts?
  

Setting a limit with ulimit is sticky (i.e. persistent), so there's
no need to stick it in the startup script.

However, you didn't answer the previous two questions about (1) how
many files did Tomcat have open when you got the Too many open


 files
  

error, and (2) what the current ulimit setting for open files is. If
you provide those answers people here can help you out a bit more.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





 __
  

This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 



 __
  


__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






  
__ 
Yahoo! Movies - Search movie info and celeb profiles and photos. 
http://sg.movies.yahoo.com/


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



  



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Too Many Open Files error

2007-10-19 Thread Daniel M Garland

Thanks Jim,

It was previously set to 1024, and I quadrupled it. When you say ulimit 
is persistent will it persist across a reboot?


I don't seem to have the command lsof, I'll try and apt-get it.

Cheers
Dan

Jim Cox wrote:

On 10/19/07, Daniel M Garland [EMAIL PROTECTED] wrote:

Should I then place ulimit -n  in the catalina startup scripts?


Setting a limit with ulimit is sticky (i.e. persistent), so there's
no need to stick it in the startup script.

However, you didn't answer the previous two questions about (1) how
many files did Tomcat have open when you got the Too many open files
error, and (2) what the current ulimit setting for open files is. If
you provide those answers people here can help you out a bit more.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__




__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Too Many Open Files error

2007-10-19 Thread Nix Hanwei
Hi Dan,

You can try sysctrl.conf file.  Add in the ulimit -n for open files.

- Original Message 
From: Daniel M Garland [EMAIL PROTECTED]
To: Tomcat Users List users@tomcat.apache.org
Sent: Friday, 19 October 2007 9:43:00
Subject: Re: Too Many Open Files error

Thanks Jim,

It was previously set to 1024, and I quadrupled it. When you say ulimit
 
is persistent will it persist across a reboot?

I don't seem to have the command lsof, I'll try and apt-get it.

Cheers
Dan

Jim Cox wrote:
 On 10/19/07, Daniel M Garland [EMAIL PROTECTED] wrote:
 Should I then place ulimit -n  in the catalina startup scripts?
 
 Setting a limit with ulimit is sticky (i.e. persistent), so there's
 no need to stick it in the startup script.
 
 However, you didn't answer the previous two questions about (1) how
 many files did Tomcat have open when you got the Too many open
 files
 error, and (2) what the current ulimit setting for open files is. If
 you provide those answers people here can help you out a bit more.
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

 __
 This email has been scanned by the MessageLabs Email Security System.
 For more information please visit http://www.messagelabs.com/email 

 __
 

__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






  
__ 
Yahoo! Movies - Search movie info and celeb profiles and photos. 
http://sg.movies.yahoo.com/

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Too Many Open Files error

2007-10-19 Thread Jim Cox
On 10/19/07, Daniel M Garland [EMAIL PROTECTED] wrote:
 Thanks Jim,

 It was previously set to 1024, and I quadrupled it. When you say ulimit
 is persistent will it persist across a reboot?

 I don't seem to have the command lsof, I'll try and apt-get it.

 Cheers
 Dan

The settings should persist, but there's a chance that a startup
script sets it after every reboot (e.g. Fedora has (or at least had) a
line to disable core file generation in /etc/profile, I think). Easy
enough to test, assuming you can reboot the box.

Besides lsof, a quick and dirty way to count the number of open files
for a process (in this case firefox, use Tomcat's pid in place of
$(pgrep firefox) in your case):
  example-prompt$ ls /proc/$(pgrep firefox)/fd | wc -l
  75

You didn't supply much detail about Tomcat's usage, but if the open
file limit is indeed 1024 (and you don't have a heavily-used server)
you might be leaking file handles somewhere in your JSP pages.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Too Many Open Files error

2007-10-19 Thread Jim Cox
On 10/19/07, Daniel M Garland [EMAIL PROTECTED] wrote:
 Should I then place ulimit -n  in the catalina startup scripts?

Setting a limit with ulimit is sticky (i.e. persistent), so there's
no need to stick it in the startup script.

However, you didn't answer the previous two questions about (1) how
many files did Tomcat have open when you got the Too many open files
error, and (2) what the current ulimit setting for open files is. If
you provide those answers people here can help you out a bit more.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Too Many Open Files error

2007-10-19 Thread Daniel M Garland

Should I then place ulimit -n  in the catalina startup scripts?

Jim Cox wrote:

On 10/18/07, Daniel M Garland [EMAIL PROTECTED] wrote:

Hi all

I'm seeing a problem on a Tomcat instance:

18-Oct-2007 12:41:47 org.apache.tomcat.util.net.AprEndpoint$Acceptor run
SEVERE: Socket accept failed
org.apache.tomcat.jni.Error: Too many open files
 at org.apache.tomcat.jni.Socket.accept(Native Method)
 at
org.apache.tomcat.util.net.AprEndpoint$Acceptor.run(AprEndpoint.java:1001)
 at java.lang.Thread.run(Thread.java:595)

Looking through Google and the advice seems to increase the number of
file descriptors. I'm on debian etch and

cat /proc/sys/fs/file-max
gives
369540


Relevant thing is probably the open file limit for processes -- what
does ulimit -a return for whatever user you're running Tomcat under?

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__




__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Too Many Open Files error

2007-10-18 Thread Peter Bauer
Am Donnerstag 18 Oktober 2007 schrieb Daniel M Garland:
 Hi all

 I'm seeing a problem on a Tomcat instance:

 18-Oct-2007 12:41:47 org.apache.tomcat.util.net.AprEndpoint$Acceptor run
 SEVERE: Socket accept failed
 org.apache.tomcat.jni.Error: Too many open files
  at org.apache.tomcat.jni.Socket.accept(Native Method)
  at
 org.apache.tomcat.util.net.AprEndpoint$Acceptor.run(AprEndpoint.java:1001)
  at java.lang.Thread.run(Thread.java:595)

 Looking through Google and the advice seems to increase the number of
 file descriptors. I'm on debian etch and

 cat /proc/sys/fs/file-max
 gives
 369540

 I don't believe that I've hit this limit or that increasing this value
 would be sensible.

 Given that everything in linux is a file, does this mean that
 connections are not being closed properly? Where would be a good place
 to start debugging this problem?

 Thanks in advance
 Dan

 __
 This email has been scanned by the MessageLabs Email Security System.
 For more information please visit http://www.messagelabs.com/email
 __

 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

Hi Dan,

try using lsof to check which files or network connections (also counts) you 
have opened.

br,
Peter

-- 
Peter Bauer
APUS Software G.m.b.H.
A-8074 Raaba, Bahnhofstrasse 1/1
Email: [EMAIL PROTECTED]
Tel: +43 316 401629 24
Fax: +43 316 401629 9

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Too Many Open Files error

2007-10-18 Thread Jim Cox
On 10/18/07, Daniel M Garland [EMAIL PROTECTED] wrote:
 Hi all

 I'm seeing a problem on a Tomcat instance:

 18-Oct-2007 12:41:47 org.apache.tomcat.util.net.AprEndpoint$Acceptor run
 SEVERE: Socket accept failed
 org.apache.tomcat.jni.Error: Too many open files
  at org.apache.tomcat.jni.Socket.accept(Native Method)
  at
 org.apache.tomcat.util.net.AprEndpoint$Acceptor.run(AprEndpoint.java:1001)
  at java.lang.Thread.run(Thread.java:595)

 Looking through Google and the advice seems to increase the number of
 file descriptors. I'm on debian etch and

 cat /proc/sys/fs/file-max
 gives
 369540

Relevant thing is probably the open file limit for processes -- what
does ulimit -a return for whatever user you're running Tomcat under?

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]