3

Once JMeter script with 5000 values in CSV file is executed with Synchronization Timer, Response data in View Results in Tree shows following error:

java.net.SocketException: Too many open files

I could not find the satisfactory answer yet on google.

Is there any way to resolve this?

Adnan
  • 2,931
  • 3
  • 23
  • 35
Anonymous
  • 858
  • 4
  • 27
  • 54
  • Are you opening that file 5000 times? That's bad approach. You could load your values just once and create some Beanshell logic to use that values as you need... – Iske Aug 05 '16 at 09:21
  • No, just once. CSV contains 5000 Email values. – Anonymous Aug 05 '16 at 09:26

1 Answers1

4

Increase the number of open file handles or file descriptors per process.

You can use command ulimit -a to find out how many open file handles per process is allowed.

$ ulimit -a
core file size        (blocks, -c) unlimited
data seg size         (kbytes, -d) unlimited
file size             (blocks, -f) unlimited
open files                    (-n) 1024
pipe size          (512 bytes, -p) 10
stack size            (kbytes, -s) 8192
cpu time             (seconds, -t) unlimited
max user processes            (-u) 2048
virtual memory        (kbytes, -v) unlimited

You can see that, open files (-n) 1024, which means only 1024 open file handles per process is allowed. If your Java program exceeds this limit, it will throw java.net.SocketException: Too many files open error.

See these threads I/O exception (java.net.SocketException) and java.net.SocketException: Too many open files.

Community
  • 1
  • 1
Adnan
  • 2,931
  • 3
  • 23
  • 35
  • I used root to login and executed these commands. But when I switched to other ordinary user, I found the open files number was the original value. Could I configure the number of open file handles for all users? – niaomingjian Jan 10 '17 at 05:32