We are getting the following error in the server log: "Too many files opened". It seems that there are not enough file descriptors. How do we determine the number of file descriptors that are needed?

We are getting the following error in the server log: "Too many files opened". It seems that there are not enough file descriptors. How do we determine the number of file descriptors that are needed?

book

Article ID: KB0087131

calendar_today

Updated On:

Products Versions
TIBCO Enterprise Message Service -
Not Applicable -

Description

Resolution:
Every time a process opens a file or creates a socket, the process consumes a file descriptor (fd).

The JMS/EMS Server uses fds for each of its sockets and opened files. Before any client application connects to the server, the server already consumes some fds (for its listen port, the db files, the possible routes, etc...).

When a client application connects to the server, a dedicated socket is created to communicate with the client and leave the listen port opened for new connections. That dedicated socket will be created at the server side and consumes one fd.

Therefore, the number of file descriptors used by the JMS/EMS server will increase by one for every single client connection.

The maximum number of file descriptors is limited at the OS level and that value can be changed. You can set the maximum number of fds per process and/or system wide. Consult your system administrator for more information.

Notice, however, that other applications running on the same machine that the JMS/EMS server may (and most likely will) also consume fds, and therefore, the server may run out of fds even though the number of connections is rather small.

Finally, notice that the JMS client application will also consume a file descriptor per connection (be aware that your application may consume more fds if it is opening files or creating other sockets on its own). If client and server are running on the same machine, the "system wide" number of fds will be decreased by 2 for each client connection.

Issue/Introduction

We are getting the following error in the server log: "Too many files opened". It seems that there are not enough file descriptors. How do we determine the number of file descriptors that are needed?