CyberTek - the future at the present!
Google

Maximum number of open files in Linux

Posted by: admin (set 4)

Linux systems usually have a preset limit of 1024 open files simultaneously. This limit is very low indeed in the case of machine with high working loads and in particular in the presence of web servers with many different domains and therefore pointers to files and logs.

When in production is reached and exceeded this limit are often problems of inconsistency strani. So it is better to act quickly. Knowing the process-id of our own application (eg tomcat or httpd) can then examine command with the number of files that this process takes open:

lsof-p [process-id] | wc-l

We understand the problem minimaliste can intervene with the ulimit command. Use the following commands to get information about the system:

ulimit-Ha

ulimit-Hs

Finally adjust the maximum value of opening the same files from Linux can enter:

ulimit-n 4000

Take a look also at the manpages for more info on the command and all its options:

man ulimit

Published in: linux, shell, tips
  1. BOCCALONE Said,

    If you want to make the change permaente even after having to reboot to add (tested on RHEL):

    * - Nofile 2048

    file:

    / etc / security / limits.conf

    replaced in 2048 with the desired value.

    Luck!

Add A Comment

Powered by CyberTek - Remote Assistance