Change the maximum file descriptor limit for Linux

Source: Internet
Author: User
Ile descriptor requirements (Linux systems)

To ensure good server performance, the total number of client connections, database files, and log files must not exceed the maximum file descriptor limit on the Operating System (Ulimit -N). By default, the Directory Server allows an unlimited number of connections but is restricted by the file descriptor limit on the operating system. linux systems limit the number of file descriptors that any one process may open to 1024 per process. (this condition is not a problem on Solaris machines, x86, x64, or iSCSI ).

After the Directory Server has exceeded the file descriptor limit of 1024 per process, any new process and worker threads will be blocked. for example, if the Directory Server attempts to open a Oracle Berkeley je database file when the operating system has exceeded the file descriptor limit, the directory server will no longer be able to open a connection that can lead to a hosted upted database exception. likewise, if you have a directory server that exceeds the file descriptor limit set by the operating system, the Directory Server can become unresponsive as the LDAP connection handler consumes all of the CPU's processing in attempting to open a new connection.

To fix this condition, set the maximum file descriptor limit per process on Linux machines.

 

To increase the file descriptor limit (Linux)
  1. Display the current hard limit of your machine.

    The hard limit is the maximum server limit that can be set without tuning the kernel parameters inProcFile System.

    $ ulimit -aHcore file size (blocks)       unlimiteddata seg size (kbytes)        unlimitedfile size (blocks)            unlimitedmax locked memory (kbytes)    unlimitedmax memory size (kbytes)      unlimitedopen files                    1024pipe size (512 bytes)         8stack size (kbytes)           unlimitedcpu time (seconds)            unlimitedmax user processes            4094virtual memory (kbytes)       unlimited
  2. Edit/Etc/security/limits. confAnd add the lines:
    *     soft   nofile  65535*     hard   nofile  65535 
  3. Edit/Etc/PAM. d/loginBy adding the line:
    session required /lib/security/pam_limits.so
  4. Use this system file limit to increase the file descriptor limit to 65535.

    The System File limit is set in/Proc/sys/fs/file-max.

    echo 65535 > /proc/sys/fs/file-max
  5. UseUlimitCommand to set the file descriptor limit to the hard limit specified in/Etc/security/limits. conf.
    ulimit -n unlimited
  6. Restart your system.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.