File Descriptor issues

You get an error like the following in the agent logs and the deployment fails:

                java.io.IOException: error=24, Too many open files

Or:

                (Too many open files)

This is due to the number of open file descriptors. Either too many file descriptors are open for the process running the agent, or ther max file descriptors for the system is exceeded.

Users Open Files limit.

To make sure the user running the agent or framework processes has enough file handles, run the following commands:

Firstly, you can see how many file descriptors are being used by the framework server or the agent by typing the following command:

        ps -ef | grep remoting

This will give you the process ID (pid). Use one of the following commands to get a count of the open file handles from the process id:

        ls -la /proc/<pid>/fd | wc -l 
        lsof -p <pid> | wc -l

Next, check the actual user limit. Depending on your system this can be found by running the following command:

        ulimit -aH

To change the users ulimit, please consult the documentation for your system. On Linux, you may need to edit the following file:

        vi /etc/security/limits.conf

The files format is username limit type item value.

So to set the limit for the user rdadmin the following line would be used:

        rdadmin hard nofile 5000        

System Open files limit

To obtain the current maximum number of file descriptors, type the following:

        cat /proc/sys/fs/file-max

Or use

        sysctl -a

If this is less than 200000, increase total file descriptors for system

To prevent running out of filehandles you need to make sure that there are enough file handles available at the system level

Increase the number of file handles by editing:

        /etc/sysctl.conf

and changing the property:

        fs.file-max to 200000

If there isn't a value set already for this property, you need to add the line fs.file-max=200000.

Then run:

        sysctl -p 

which will apply the changes to your system.