Chapter 7. Setting the Number of Directory Server Threads

The number of threads Directory Server uses to handle simultaneous connections affects the performance of the server. For example, if all threads are busy handling time-consuming tasks (such as add operations), new incoming connections are queued until a free thread can process the request.
If the server provides a low number of CPU threads, configuring a higher number of threads can increase the performance. However, on a server with many CPU threads, setting a too high value does not further increase the performance.
In instances created using Directory Server 10.1.1 or later, the number of threads Directory Server creates is calculated automatically by default. This number is based on the hardware resources of the server when the instance starts.
If you upgraded from a version earier than 10.1.1 or if you manually set the number of threads, re-enable auto-sizing for optimized performance. For details, see Section 7.1, “Enabling Automatic Thread Tuning”.

Note

Red Hat recommends to use the auto-tuning settings. Do not set the number of threads manually.

7.1. Enabling Automatic Thread Tuning

Directory Server can automatically set the number of threads based on the available hardware threads:
  1. Enable auto-setting the number of threads:
    # ldapmodify -D "cn=Directory Manager" -W -x
    
    dn: cn=config
    changetype: modify
    replace: nsslapd-threadnumber
    nsslapd-threadnumber: -1
    With this setting, Directory Server will use the following optimized number of threads:
    Number of CPU Threads
    Number of Directory Server Threads
    1
    16
    2
    16
    4
    24
    8
    32
    16
    48
    32
    64
    64
    96
    128
    192
    256
    384
    512
    512
    [a]
    1024
    512 [a]
    2048
    512 [a]
    [a] The recommended maximum number of threads is applied.

    Note

    If you enabled the automatic setting, the nsslapd-threadnumber parameter shows the calculated number of threads while Directory Server is running.
  2. Restart the Directory Server instance:
    # systemctl start dirsrv@instance_name