Discussion:
java.net.SocketException: Too many open files
Ragini Thakur
2011-04-07 06:49:43 UTC
Permalink
Hi,



While running load test in distributed mode we observed the
"java.net.SocketException: Too many open files" on the slave where
Jmeter was executed in server mode. Can anyone tell why this exception
is thrown? I never observed this exception any time before.





The complete stack trace is as below.



Created remote object: UnicastServerRef [liveRef:
[endpoint:[10.3.1.62:41728](local),objID:[70c181c5:12f2e03530e:-7fff,
-9053872638812208603]]]

Starting the test on host 10.3.1.62:1099 @ Wed Apr 06 19:34:35 PST 2011
(1302147275469)

Apr 6, 2011 7:51:44 PM sun.rmi.transport.tcp.TCPTransport$AcceptLoop
executeAcceptLoop

WARNING: RMI TCP Accept-0: accept loop for
ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=41728] throws

java.net.SocketException: Too many open files

at java.net.PlainSocketImpl.socketAccept(Native Method)

at
java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:358
)

at java.net.ServerSocket.implAccept(ServerSocket.java:470)

at java.net.ServerSocket.accept(ServerSocket.java:438)

at
sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(TCPTrans
port.java:387)

at
sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(TCPTransport.java:359)

at java.lang.Thread.run(Thread.java:636)



Test environment: Linux

Jmeter version 2.4

Test run duration: 60 mins



Please let me know in case any I shall provide any other information.





Regards,

Ragini Thakur





"Legal Disclaimer: This electronic message and all contents contain information from Cybage Software Private Limited which may be privileged, confidential, or otherwise protected from disclosure. The information is intended to be for the addressee(s) only. If you are not an addressee, any disclosure, copy, distribution, or use of the contents of this message is strictly prohibited. If you have received this electronic message in error please notify the sender by reply e-mail to and destroy the original message and all copies. Cybage has taken every reasonable precaution to minimize the risk of malicious content in the mail, but is not liable for any damage you may sustain as a result of any malicious content in this e-mail. You should carry out your own malicious content checks before opening the e-mail or attachment."
www.cybage.com
Felix Frank
2011-04-07 07:38:22 UTC
Permalink
Post by Ragini Thakur
Hi,
While running load test in distributed mode we observed the
"java.net.SocketException: Too many open files" on the slave where
Jmeter was executed in server mode. Can anyone tell why this exception
is thrown? I never observed this exception any time before.
Hi,

as a first step, you can check your open files limit using "ulimit -n".

Raise it if necessary.

HTH,
Felix
Ragini Thakur
2011-04-07 07:43:18 UTC
Permalink
What is the cause of this exception its OS issue or application?

Regards,
Ragini Thakur

-----Original Message-----
From: Felix Frank [mailto:***@mpexnet.de]
Sent: Thursday, April 07, 2011 1:08 PM
To: JMeter Users List
Subject: Re: java.net.SocketException: Too many open files
Post by Ragini Thakur
Hi,
While running load test in distributed mode we observed the
"java.net.SocketException: Too many open files" on the slave where
Jmeter was executed in server mode. Can anyone tell why this exception
is thrown? I never observed this exception any time before.
Hi,

as a first step, you can check your open files limit using "ulimit -n".

Raise it if necessary.

HTH,
Felix

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-***@jakarta.apache.org
For additional commands, e-mail: jmeter-user-***@jakarta.apache.org



"Legal Disclaimer: This electronic message and all contents contain information from Cybage Software Private Limited which may be privileged, confidential, or otherwise protected from disclosure. The information is intended to be for the addressee(s) only. If you are not an addressee, any disclosure, copy, distribution, or use of the contents of this message is strictly prohibited. If you have received this electronic message in error please notify the sender by reply e-mail to and destroy the original message and all copies. Cybage has taken every reasonable precaution to minimize the risk of malicious content in the mail, but is not liable for any damage you may sustain as a result of any malicious content in this e-mail. You should carry out your own malicious content checks before opening the e-mail or attachment."
www.cybage.com
Adrian Speteanu
2011-04-07 18:51:10 UTC
Permalink
Note that ulimit -n gives the limit per user, you should also check the
limitation per system as well.
Any socket exception are obviously related to the OS and / or network.

On linux, this problem in particular is related to the fact that linux
treats open sockets as open file descriptors. And file descriptors are
limited to a "safe" value for various reasons - until someone actually needs
more for a particular task and then this can be easily configured. If JMeter
needs to open several hundreds sockets (and considering that some stay open
a while after the thread has finished with them) it is easy to run into this
issue, because other processes need to use file descriptors.

Similar tweaks can be done on Windows as well, though I'm not sure, you'd
get the same error message, on XP it was easy to run into running out of
available sockets because they were limited to 5000. However, Win 7 has been
generally configured to permit many open sockets and I haven't had problems
with running scripts that open 4-5000 threads in jmeter and as many
connections as they can (not recommended for actual tests, I was looking for
how much it can take).

This can be affected by how the test is configured as well (using keep alive
for example, but by many other factors also).
Post by Ragini Thakur
What is the cause of this exception its OS issue or application?
Regards,
Ragini Thakur
-----Original Message-----
Sent: Thursday, April 07, 2011 1:08 PM
To: JMeter Users List
Subject: Re: java.net.SocketException: Too many open files
Post by Ragini Thakur
Hi,
While running load test in distributed mode we observed the
"java.net.SocketException: Too many open files" on the slave where
Jmeter was executed in server mode. Can anyone tell why this exception
is thrown? I never observed this exception any time before.
Hi,
as a first step, you can check your open files limit using "ulimit -n".
Raise it if necessary.
HTH,
Felix
---------------------------------------------------------------------
"Legal Disclaimer: This electronic message and all contents contain
information from Cybage Software Private Limited which may be privileged,
confidential, or otherwise protected from disclosure. The information is
intended to be for the addressee(s) only. If you are not an addressee, any
disclosure, copy, distribution, or use of the contents of this message is
strictly prohibited. If you have received this electronic message in error
please notify the sender by reply e-mail to and destroy the original message
and all copies. Cybage has taken every reasonable precaution to minimize the
risk of malicious content in the mail, but is not liable for any damage you
may sustain as a result of any malicious content in this e-mail. You should
carry out your own malicious content checks before opening the e-mail or
attachment."
www.cybage.com
---------------------------------------------------------------------
Deepak Shetty
2011-04-07 18:57:08 UTC
Permalink
The OS limits these things for a good reason . you might actually need more
than the limit set on your operating system or your application is using up
more than it should need. In the case of JMeter it is *usually* the case
that you have specified too many threads concurrently without increasing the
limits on your OS
Post by Ragini Thakur
What is the cause of this exception its OS issue or application?
Regards,
Ragini Thakur
-----Original Message-----
Sent: Thursday, April 07, 2011 1:08 PM
To: JMeter Users List
Subject: Re: java.net.SocketException: Too many open files
Post by Ragini Thakur
Hi,
While running load test in distributed mode we observed the
"java.net.SocketException: Too many open files" on the slave where
Jmeter was executed in server mode. Can anyone tell why this exception
is thrown? I never observed this exception any time before.
Hi,
as a first step, you can check your open files limit using "ulimit -n".
Raise it if necessary.
HTH,
Felix
---------------------------------------------------------------------
"Legal Disclaimer: This electronic message and all contents contain
information from Cybage Software Private Limited which may be privileged,
confidential, or otherwise protected from disclosure. The information is
intended to be for the addressee(s) only. If you are not an addressee, any
disclosure, copy, distribution, or use of the contents of this message is
strictly prohibited. If you have received this electronic message in error
please notify the sender by reply e-mail to and destroy the original message
and all copies. Cybage has taken every reasonable precaution to minimize the
risk of malicious content in the mail, but is not liable for any damage you
may sustain as a result of any malicious content in this e-mail. You should
carry out your own malicious content checks before opening the e-mail or
attachment."
www.cybage.com
---------------------------------------------------------------------
Adrian Speteanu
2011-04-07 19:29:41 UTC
Permalink
ulimit -n is usually at 1024 on latest debian / ubuntu distributions. that
is a little too small for web-applications & performance tests. it can be
increased to 10-30,000, though I agree a check on the test should be done.
Post by Deepak Shetty
The OS limits these things for a good reason . you might actually need more
than the limit set on your operating system or your application is using up
more than it should need. In the case of JMeter it is *usually* the case
that you have specified too many threads concurrently without increasing the
limits on your OS
Post by Ragini Thakur
What is the cause of this exception its OS issue or application?
Regards,
Ragini Thakur
-----Original Message-----
Sent: Thursday, April 07, 2011 1:08 PM
To: JMeter Users List
Subject: Re: java.net.SocketException: Too many open files
Post by Ragini Thakur
Hi,
While running load test in distributed mode we observed the
"java.net.SocketException: Too many open files" on the slave where
Jmeter was executed in server mode. Can anyone tell why this exception
is thrown? I never observed this exception any time before.
Hi,
as a first step, you can check your open files limit using "ulimit -n".
Raise it if necessary.
HTH,
Felix
---------------------------------------------------------------------
"Legal Disclaimer: This electronic message and all contents contain
information from Cybage Software Private Limited which may be privileged,
confidential, or otherwise protected from disclosure. The information is
intended to be for the addressee(s) only. If you are not an addressee,
any
Post by Ragini Thakur
disclosure, copy, distribution, or use of the contents of this message is
strictly prohibited. If you have received this electronic message in
error
Post by Ragini Thakur
please notify the sender by reply e-mail to and destroy the original
message
Post by Ragini Thakur
and all copies. Cybage has taken every reasonable precaution to minimize
the
Post by Ragini Thakur
risk of malicious content in the mail, but is not liable for any damage
you
Post by Ragini Thakur
may sustain as a result of any malicious content in this e-mail. You
should
Post by Ragini Thakur
carry out your own malicious content checks before opening the e-mail or
attachment."
www.cybage.com
---------------------------------------------------------------------
Loading...