Sidebar

How to resolve open file limits in linux

0 votes
564 views
asked Jun 2, 2020 by mike-r-7535 (13,830 points)
edited Jun 5, 2020 by mike-r-7535
My QIE is receiving this error:

java.net.SocketExeption: Too many open files

What causes this and how can we resolve the error?

1 Answer

0 votes

Linux limits the number of network connections, or open files that each process can have at any given point in time.  The default setting is for each process to utilize up to 1024 open files.  These open files are also called file descriptors.

Every open file, socket connection, FTP connection, HTTP call, DNS lookup, etc will use a separate file descriptor. When the limit of 1024 simultaneous connections is reached, it may manifest itself by with the "Too many open files" error.

The resolution is to increase the number of files the QIE process can have open.

You will need to modify the /etc/security/limits.conf file by adding the equivilant entries:

*               hard    nofile           [value]
*               soft    nofile           [value]

Where [value] is your new open file limit.  Setting this to 100000 should be sufficient.

For a more detailed explanation of setting these values:

 https://www.thegeekdiary.com/understanding-etc-security-limits-conf-file-to-set-ulimit/

These settings should be set for all linux installations.

Mac installs should also increase their file limits.  https://wilsonmar.github.io/maximum-limits/

answered Jun 2, 2020 by mike-r-7535 (13,830 points)
edited Jun 5, 2020 by mike-r-7535
...