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 SPARC).

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 corrupted 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 in proc file system.

    $ ulimit -aH
    core file size (blocks) unlimited
    data seg size (kbytes) unlimited
    file size (blocks) unlimited
    max locked memory (kbytes) unlimited
    max memory size (kbytes) unlimited
    open files 1024
    pipe size (512 bytes) 8
    stack size (kbytes) unlimited
    cpu time (seconds) unlimited
    max user processes 4094
    virtual memory (kbytes) unlimited
  2. Edit the /etc/security/limits.conf and add the lines:
    *     soft   nofile  65535
    * hard nofile 65535
  3. Edit the /etc/pam.d/login by adding the line:
    session required /lib/security/pam_limits.so
  4. Use the 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. Use the ulimit command to set the file descriptor limit to the hard limit specified in/etc/security/limits.conf.
    ulimit -n unlimited
  6. Restart your system.

http://www.cnblogs.com/qq78292959/archive/2012/03/07/2383337.html

更改linux的最大文件描述符限制的更多相关文章

  1. Linux中的文件描述符与打开文件之间的关系

    Linux中的文件描述符与打开文件之间的关系 导读 内核(kernel)利用文件描述符(file descriptor)来访问文件.文件描述符是非负整数.打开现存文件或新建文件时,内核会返回一个文件描 ...

  2. Linux中的文件描述符与打开文件之间的关系------------每天进步一点点系列

    http://blog.csdn.net/cywosp/article/details/38965239 1. 概述     在Linux系统中一切皆可以看成是文件,文件又可分为:普通文件.目录文件. ...

  3. (转)Linux中的文件描述符

    本文转自:http://blog.csdn.net/cywosp/article/details/38965239 作者:cywosp 1. 概述 在Linux系统中一切皆可以看成是文件,文件又可分为 ...

  4. (转)Linux中的文件描述符与打开文件之间的关系

    转:http://blog.csdn.net/cywosp/article/details/38965239 1. 概述     在Linux系统中一切皆可以看成是文件,文件又可分为:普通文件.目录文 ...

  5. Linux exec与文件描述符

    看到好几篇文章讲述exec都是一知半解,所以我尽量说的清楚明白一些.本文首先讲述Linux文件描述符,然后是exec,最后举例说明exec I/O重定向及其用法. 概念:exec命令用于调用并执行指令 ...

  6. Linux Linux下最大文件描述符设置

    Linux下最大文件描述符设置 by:授客 QQ:1033553122 1.   系统可打开最大文件描述符设置 查看系统可打开最大文件描述符 # cat /proc/sys/fs/file-max 6 ...

  7. [svc]linux中的文件描述符(file descriptor)和文件

    linux中的文件描述符(file descriptor)和文件 linux为了实现一切皆文件的设计哲学,不仅将数据抽象成了文件,也将一切操作和资源抽象成了文件,比如说硬件设备,socket,磁盘,进 ...

  8. linux fcntl 对文件描述符控制

    linux fcntl 对文件描述符控制 linux fcntl 对文件描述符控制 linux fcntl 对文件描述符控制

  9. linux exec和文件描述符妙用技巧(转)

    最近在看<精通unix shell脚本编程>时,看到exec<$1 exec 1>$OUTFILE,一下看的我就蒙了.网上看了大半天,终于搞定,记录如下.对于 Linux 而言 ...

随机推荐

  1. 安装配置Rancher管理docker

    原文:安装配置Rancher管理docker 版权声明:本文为博主原创文章,转载请注明地址http://blog.csdn.net/tianyaleixiaowu. https://blog.csdn ...

  2. C++开源码项目汇总

    Google的C++开源码项目 v8  -  V8 JavaScript Engine V8 是 Google 的开源 JavaScript 引擎. V8 採用 C++ 编写,可在谷歌浏览器(来自 G ...

  3. [React] Create an Auto Resizing Virtualized List with react-virtualized

    In this lesson we'll show how to use the AutoSizer component from react-virtualized to automatically ...

  4. leetcode-combination sum and combination sum II

    Combination sum: Given a set of candidate numbers (C) and a target number (T), find all unique combi ...

  5. MySql Order By 多个字段 排序规则

    版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/xlxxcc/article/details/52250963 说在前面 突发奇想,想了解一下mysq ...

  6. codeforces 571B--Minimization(贪心+dp)

    D. Minimization time limit per test 2 seconds memory limit per test 256 megabytes input standard inp ...

  7. C语言数组初始化的问题

  8. 12行Python暴力爬《黑豹》豆瓣短评

    作者:黄嘉锋 来源:https://www.jianshu.com/p/ea0b56e3bd86 草长莺飞,转眼间又到了三月"爬虫月".这时往往不少童鞋写论文苦于数据获取艰难,辗转 ...

  9. 【37.38%】【codeforces 722C】Destroying Array

    time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard ou ...

  10. Java解惑八:很多其它库之谜

    本文是依据JAVA解惑这本书,做的笔记. 电子书见:http://download.csdn.net/detail/u010378705/7527721 谜题76 将线程的启动方法start(),写成 ...