Performance Tuning Guide
Updated for Directory Server 9.1.2
Abstract
1. Deprecated Documentation
Important
2. Intro to Directory Server Performance Tuning
2.1. Setting Goals for Directory Server Performance
- Assess the environment. Look at everything around the Directory Server: its usage, the load, the network connection and reliability, most common operations, the physical machine its on, along with any services competing for its resources.
- Measure the current Directory Server performance and establish baselines.
- Identify the server areas which can be improved.
- Make any changes to the Directory Server settings and, potentially, to the host machine.
- Measure the Directory Server performance again to see how the changes affected the performance.
- The server process (counters and logs)
- The databases (counters)
- Any database links (counters)
- Search operations
- Indexing performance (which affects both search and write operations)
- Database transactions
- Database and entry cache settings
- Database links
- Available memory (based on directory size)
- Other servers running on the same machine (which could compete for resources)
- Distributing user databases across other Directory Server instances on other machines
- Balancing server loads due to network performance
2.2. Giving Feedback
- Select the Red Hat Directory Server product.
- Set the component to
Doc - performance-and-tuning. - Set the version number to 9.0.
- For errors, give the page number (for the PDF) or URL (for the HTML), and give a succinct description of the problem, such as incorrect procedure or typo.For enhancements, put in what information needs to be added and why.
- Give a clear title for the bug. For example,
"Incorrect command example for setup script options"is better than"Bad example".
3. Tracking Server and Database Performance
Note
3.1. Monitoring Server Activity
Note
3.1.1. Monitoring the Server from the Directory Server Console
- In the Directory Server Console, select the Status tab.
- In the navigation tree, select Performance Counters.
The Status tab in the right pane displays current information about server activity. If the server is currently not running, this tab will not provide performance monitoring information.

Table 1. General Information (Server)
| Field | Description |
|---|---|
| Server Version | Identifies the current server version. |
| Startup Time on Server | The date and time the server was started. |
| Current Time on Server | The current date and time on the server. |

Table 2. Resource Summary
| Resource | Usage Since Startup | Average Per Minute |
|---|---|---|
| Connections | The total number of connections to this server since server startup. | Average number of connections per minute since server startup. |
| Operations Initiated | The total number of operations initiated since server startup. Operations include any client requests for server action,such as searches, adds, and modifies. Often, multiple operations are initiated for each connection. | Average number of operations per minute since server startup. |
| Operations Completed | The total number of operations completed by the server since server startup. | Average number of operations per minute since server startup. |
| Entries Sent to Clients | The total number of entries sent to clients since server startup. Entries are sent to clients as the result of search requests. | Average number of entries sent to clients per minute since server startup. |
| Bytes Sent to Clients | The total number of bytes sent to clients since server startup. | Average number of bytes sent to clients per minute since server startup. |

Table 3. Current Resource Usage
| Resource | Current Total |
|---|---|
| Active Threads | The current number of active threads used for handling requests. Additional threads may be created by internal server tasks, such as replication or chaining. |
| Open Connections | The total number of open connections. Each connection can account for multiple operations, and therefore multiple threads. |
| Remaining Available Connections | The total number of remaining connections that the server can concurrently open. This number is based on the number of currently open connections and the total number of concurrent connections that the server is allowed to open. In most cases, the latter value is determined by the operating system and is expressed as the number of file descriptors available to a task. |
| Threads Waiting to Write to Client | The total number of threads waiting to write to the client. Threads may not be immediately written when the server must pause while sending data to a client. Reasons for a pause include a slow network, a slow client, or an extremely large amount of information being sent to the client. |
| Threads Waiting to Read from Client | The total number of threads waiting to read from the client. Threads may not be immediately read if the server starts to receive a request from the client, and then the transmission of that request is halted for some reason. Generally, threads waiting to read are an indication of a slow network or client. |
| Databases in Use | The total number of databases being serviced by the server. |

Table 4. Connection Status
| Table Header | Description | ||
|---|---|---|---|
| Time Opened | The time on the server when the connection was initially opened. | ||
| Started | The number of operations initiated by this connection. | ||
| Completed | The number of operations completed by the server for this connection. | ||
| Bound as | The distinguished name used by the client to bind to the server. If the client has not authenticated to the server, the server displays not bound in this field. | ||
| Read/Write | Indicates whether the server is currently blocked for read or write access to the client. There are two possible values:
|

Note
cn=monitor,cn=database_instance,cn=ldbm database,cn=plugins,cn=config, as are the other database activities.
Table 5. Global Database Cache Information
| Table Header | Description |
|---|---|
| Hits | The number of times the server could process a request by obtaining data from the cache rather than by going to the disk. |
| Tries | The total number of database accesses since server startup. |
| Hit Ratio | The ratio of cache tries to successful cache hits. The closer this number is to 100%, the better. |
| Pages Read In | The number of pages read from disk into the cache. |
| Pages Written Out | The number of pages written from the cache back to disk. |
| Read-Only Page Evicts | The number of read-only pages discarded from the cache to make room for new pages. Pages discarded from the cache have to be written to disk, possibly affecting server performance. The lower the number of page evicts the better. |
| Read-Write Page Evicts | The number of read-write pages discarded from the cache to make room for new pages. This value differs from Pages Written Out in that these are discarded read-write pages that have not been modified. Pages discarded from the cache have to be written to disk, possibly affecting server performance. The lower the number of page evicts, the better. |
3.1.2. Monitoring the Directory Server from the Command Line
ldapsearch, with the following characteristics:
- Search with the attribute filter
objectClass=*. - Use the search base
cn=monitor; the monitoring attributes for the server are found in thecn=monitorentry. - Use the search scope
base.
ldapsearch -D "cn=directory manager" -W -p 389 -h server.example.com -x -s base -b "cn=monitor" "(objectclass=*)"
cn=monitor entry.
Table 6. Server Monitoring Attributes
| Attribute | Description | ||||||
|---|---|---|---|---|---|---|---|
| version | Identifies the directory's current version number. | ||||||
| threads | The current number of active threads used for handling requests. Additional threads may be created by internal server tasks, such as replication or chaining. | ||||||
| connection:fd:opentime:opsinitiated:opscompleted:binddn:[rw] | Provides the following summary information for each open connection (only available if you bind to the directory as Directory Manager):
| ||||||
| currentconnections | Identifies the number of connections currently in service by the directory. | ||||||
| totalconnections | Identifies the number of connections handled by the directory since it started. | ||||||
| dtablesize | Shows the number of file descriptors available to the directory. Each connection requires one file descriptor: one for every open index, one for log file management, and one for ns-slapd itself. Essentially, this value shows how many additional condncurrent connections can be serviced by the directory. For more information on file descriptors, see the operating system documentation. | ||||||
| readwaiters | Identifies the number of threads waiting to read data from a client. | ||||||
| opsinitiated | Identifies the number of operations the server has initiated since it started. | ||||||
| opscompleted | Identifies the number of operations the server has completed since it started. | ||||||
| entriessent | Identifies the number of entries sent to clients since the server started. | ||||||
| bytessent | Identifies the number of bytes sent to clients since the server started. | ||||||
| currenttime | Identifies the time when this snapshot of the server was taken. The time is displayed in Greenwich Mean Time (GMT) in UTC format. | ||||||
| starttime | Identifies the time when the server started. The time is displayed in Greenwich Mean Time (GMT) in UTC format. | ||||||
| nbackends | Identifies the number of back ends (databases) the server services. | ||||||
| backendmonitordn | Identifies the DN of each directory database. |
3.2. Monitoring Database Activity
Note
3.2.1. Monitoring Database Activity from the Directory Server Console
- In the Directory Server Console, select the Status tab.
- In the navigation tree, expand the Performance Counters folder, and select the database to monitor.The tab displays current information about database activity. If the server is currently not running, this tab will not provide performance monitoring information.

Table 7. Summary Information
Table 8. Database Cache Information
| Performance Metric | Current Total |
|---|---|
| Hits | The number of times the database cache successfully supplied a requested page. |
| Tries | The number of times the database cache was asked for a page. |
| Hit Ratio |
The ratio of database cache hits to database cache tries. The closer this value is to 100%, the better. Whenever a directory operation attempts to find a portion of the database that is not present in the database cache, the directory has to perform a disk access to obtain the appropriate database page. Thus, as this ratio drops towards zero, the number of disk accesses increases, and directory performance drops.
To improve this ratio, increase the amount of data that the directory maintains in the database cache by increasing the value of the
nsslapd-dbcachesize attribute. This is the Maximum Cache Size database setting in the Directory Server Console.
|
| Pages Read In | The number of pages read from disk into the database cache. |
| Pages Written Out | The number of pages written from the cache back to disk. A database page is written to disk whenever a read-write page has been modified and then subsequently deleted from the cache. Pages are deleted from the database cache when the cache is full and a directory operation requires a database page that is not currently stored in cache. |
| Read-Only Page Evicts | The number of read-only pages discarded from the cache to make room for new pages. |
| Read-Write Page Evicts | The number of read-write pages discarded from the cache to make room for new pages. This value differs from Pages Written Out in that these are discarded read-write pages that have not been modified. |
Table 9. Database File-Specific
| Performance Metric | Current Total |
|---|---|
| Cache Hits | The number of times that a search result resulted in a cache hit on this specific file. That is, a client performs a search that requires data from this file, and the directory obtains the required data from the cache. |
| Cache Misses | The number of times that a search result failed to hit the cache on this specific file. That is, a search that required data from this file was performed, and the required data could not be found in the cache. |
| Pages Read In | The number of pages brought to the cache from this file. |
| Pages Written Out | The number of pages for this file written from cache to disk. |
3.2.2. Monitoring Database Activity from the Command Line
ldapsearch. The search targets the monitoring subtree of the LDBM database entry, cn=monitor,cn=database_name,cn=ldbm database,cn=plugins,cn=config. This contains all of the monitoring attributes for the that specific database instance.
ldapsearch -D "cn=directory manager" -W -p 389 -h server.example.com -x -s base -b "cn=monitor,cn=database_name,cn=ldbm database,cn=plugins,cn=config" "(objectclass=*)"
Table 10. Database Monitoring Attributes
| Attribute | Description |
|---|---|
| database | Identifies the type of database currently being monitored. |
| readonly | Indicates whether the database is in read-only mode; 0 means that the server is not in read-only mode, 1 means that it is in read-only mode. |
| entrycachehits | The total number of successful entry cache lookups. That is, the total number of times the server could process a search request by obtaining data from the cache rather than by going to disk. |
| entrycachetries | The total number of entry cache lookups since the directory was last started. That is, the total number of search operations performed against the server since server startup. |
| entrycachehitratio |
Ratio that indicates the number of entry cache tries to successful entry cache lookups. This number is based on the total lookups and hits since the directory was last started. The closer this value is to 100%, the better. Whenever a search operation attempts to find an entry that is not present in the entry cache, the directory has to perform a disk access to obtain the entry. Thus, as this ratio drops towards zero, the number of disk accesses increases, and directory search performance drops.
To improve this ratio, increase the size of the entry cache by increasing the value of the
nsslapd-cachememsize attribute in the cn=database_name, cn=ldbm database,cn=plugins,cn=config entry for the database. In the Directory Server Console, this is set in the Memory available for cache field in the database settings.
|
| currententrycachesize |
The total size, in bytes, of directory entries currently present in the entry cache.
To increase the size of the entries which can be present in the cache, increase the value of the
nsslapd-cachememsize attribute in the cn=database_name, cn=ldbm database,cn=plugins,cn=config entry for the database. In the Directory Server Console, this is set in the Memory available for cache field in the database settings.
|
| maxentrycachesize |
The maximum size, in bytes, of directory entries that can be maintained in the entry cache.
To increase the size of the entries which can be present in the cache, increase the value of the
nsslapd-cachememsize attribute in the cn=database_name, cn=ldbm database,cn=plugins,cn=config entry for the database. In the Directory Server Console, this is set in the Memory available for cache field in the database settings.
|
| dbcachehits | The number of times the server could process a request by obtaining data from the cache rather than by going to the disk. |
| dbcachetries | The total number of database accesses since server startup. |
| dbcachehitratio | The ratio of cache tries to successful cache hits. The closer this number is to 100%, the better. |
| dbcachepagein | The number of pages read from disk into the cache. |
| dbcachepageout | The number of pages written from the cache back to disk. |
| dbcacheroevict | The number of read-only pages discarded from the cache to make room for new pages. Pages discarded from the cache have to be written to disk, possibly affecting server performance. The lower the number of page evicts the better. |
| dbcacherwevict | The number of read-write pages discarded from the cache to make room for new pages. This value differs from Pages Written Out in that these are discarded read-write pages that have not been modified. Pages discarded from the cache have to be written to disk, possibly affecting server performance. The lower the number of page evicts the better. |
| dbfilename-number | The name of the file. number provides a sequential integer identifier (starting at 0) for the file. All associated statistics for the file are given this same numerical identifier. |
| dbfilecachehit-number | The number of times that a search result resulted in a cache hit on this specific file. That is, a client performs a search that requires data from this file, and the directory obtains the required data from the cache. |
| dbfilecachemiss-number | The number of times that a search result failed to hit the cache on this specific file. That is, a search that required data from this file was performed, and the required data could not be found in the cache. |
| dbfilepagein-number | The number of pages brought to the cache from this file. |
| dbfilepageout-number | The number of pages for this file written from cache to disk. |
| currentdncachesize |
The total size, in bytes, of DNs currently present in the DN cache.
To increase the size of the entries which can be present in the DN cache, increase the value of the
nsslapd-dncachememsize attribute in the cn=database_name, cn=ldbm database,cn=plugins,cn=config entry for the database.
|
| maxdncachesize |
The maximum size, in bytes, of DNs that can be maintained in the DN cache.
To increase the size of the entries which can be present in the cache, increase the value of the
nsslapd-dncachememsize attribute in the cn=database_name, cn=ldbm database,cn=plugins,cn=config entry for the database.
|
| currentdncachecount | The number of DNs currently present in the DN cache. |
3.3. Monitoring Database Link Activity
ldapsearch to return the monitoring attributes that are required. The monitoring attributes are stored in the cn=monitor,cn=database_link_name,cn=chaining database,cn=plugins,cn=config.
ldapsearch -D "cn=directory manager" -W -p 389 -h server.example.com -x -s sub -b "cn=monitor,cn=DBLink1,cn=chaining database,cn=plugins,cn=config" "(objectclass=*)" nsAddCount
Table 11. Database Link Monitoring Attributes
| Attribute Name | Description |
|---|---|
| nsAddCount | The number of add operations received. |
| nsDeleteCount | The number of delete operations received. |
| nsModifyCount | The number of modify operations received. |
| nsRenameCount | The number of rename operations received. |
| nsSearchBaseCount | The number of base-level searches received. |
| nsSearchOneLevelCount | The number of one-level searches received. |
| nsSearchSubtreeCount | The number of subtree searches received. |
| nsAbandonCount | The number of abandon operations received. |
| nsBindCount | The number of bind request received. |
| nsUnbindCount | The number of unbinds received. |
| nsCompareCount | The number of compare operations received. |
| nsOperationConnectionCount | The number of open connections for normal operations. |
| nsBindConnectionCount | The number of open connections for bind operations. |
3.4. Monitoring the Local Disk for Graceful Shutdown
slapd) crashes. Any abrupt shutdown runs the risk of corrupting the database or losing directory data.
slapd process. A disk monitoring thread is enabled using the nsslapd-disk-monitoring configuration attribute. This creates a monitoring thread that wakes every ten (10) seconds to check for available disk space in certain areas.
slapd begins a series of steps (by default) to reduce the amount of disk space it is consuming:
- Verbose logging is disabled.
- Access logging and error logging are disabled.
- Rotated (archived) logs are deleted.
Note
slapd begins a graceful shut down process (within a grace period); and if the available disk space ever drops to 4KB, then the slapd process shuts down immediately. If the disk space is freed up, then the shutdown process is aborted, and all of the previously disabled log settings are re-enabled.
nsslapd-disk-monitoring-logging-critical) can be set to include the logs directory when evaluating disk space.
cn=config entry. Table 12, “Disk Monitoring Configuration Attributes” lists all of the configuration options.
- Using
ldapmodify, add the disk monitoring attributes. At a minimum, turn on thensslapd-disk-monitoringattribute to enable disk monitoring. The default threshold is 2MB; this can be configured (optionally) in thensslapd-disk-monitoring-thresholdattribute.For example:[jsmith@server ~]$ ldapmodify -D "cn=directory manager" -W -p 389 -x dn: cn=config changetype: modify add: nsslapd-disk-monitoring nsslapd-disk-monitoring: on - add: nsslapd-disk-monitoring-threshold nsslapd-disk-monitoring-threshold: 3000000 - add: nsslapd-disk-monitoring-grace-period nsslapd-disk-monitoring-grace-period: 20
- Restart the Directory Server to load the new configuration.
[root@server ~]# service dirsrv restart
Table 12. Disk Monitoring Configuration Attributes
| Configuration Attribute | Description |
|---|---|
| nsslapd-disk-monitoring | Enabled disk monitoring. This is the only required attribute, since the other configuration options have usable defaults. |
| nsslapd-disk-monitoring-grace-period | Sets a grace period to wait before shutting down the server after it hits half of the disk space limit. This gives an administrator time to address the situation. The default value is 60 (minutes). |
| nsslapd-disk-monitoring-logging-critical | Sets whether to shut down the server if the log directories pass the halfway point set in the disk space limit.This prevents the monitoring thread from disabling audit or access logging or from deleting rotated logfiles. |
| nsslapd-disk-monitoring-threshold | Sets the amount of disk space, in bytes, to use to evaluate whether the server has enough available disk space. Once the space reaches half of this threshold, then the server begins a shut down process. The default value is 2000000 (2MB). |
3.5. Viewing Log Files
Note
- In the Directory Server Console, select the Status tab.
- In the navigation tree, expand the Log folder. There are three folders available, for the access, error, and audit logs.

- When you select the log type to view, a table displays a list of the last 25 entries in the selected log.
- Optionally, change the settings of the log display and click to update the display.

- The Select Log pull-down menu allows you to select an archived (rotated) log rather than the currently active log.
- The Lines to show text box changes the number of log entries to display in the window.
- The Show only lines containing text box sets a filter, including regular expressions, to use to display only certain matching log entries.
Note
3.6. Replacing Log Files with a Named Pipe
- Logging certain events, like failed bind attempts or connections from specific users or IP addresses
- Logging entries which match a specific regular expression pattern
- Keeping the log to a certain length (logging only the last number of lines)
- Sending a notification, such as an email, when an event occurs
ds-logpipe.py
named_pipe
[
--user pipe_user
] [
--maxlines number
] [[
--serverpidfile file.pid
] | [
--serverpid PID
]] [
--servertimeout seconds
] [
--plugin=/path/to/plugin.py
| [
pluginfile.arg=value
]]
logconv.pl) that expect to access a real file will fail.
- The log file to use has to be changed to the pipe (
nsslapd-*log) - Buffering should be disabled because the script already buffers the log entries (
nsslapd-*log-logbuffering) - Log rotation should be disabled so that the server does not attempt to rotate the named pipe (
nsslapd-*log-maxlogsperdir,nsslapd-*log-logexpirationtime, andnsslapd-*log-logrotationtime)
ldapmodify.
access.pipe:
ldapmodify -D "cn=directory manager" -W -p 389 -h server.example.com -x dn: cn=config changetype: modify replace: nsslapd-accesslog nsslapd-accesslog: /var/log/dirsrv/slapd-instance_name/access.pipe - replace: nsslapd-accesslog-logbuffering nsslapd-accesslog-logbuffering: off - replace: nsslapd-accesslog-maxlogsperdir nsslapd-accesslog-maxlogsperdir: 1 - replace: nsslapd-accesslog-logexpirationtime nsslapd-accesslog-logexpirationtime: -1 - replace: nsslapd-accesslog-logrotationtime nsslapd-accesslog-logexpirationtime: -1
Note
-f option will cause the server to close the current log file and switch to the named pipe immediately. This can be very helpful for debugging a running server and sifting the log output for specific messages.
3.7. Improving Logging Performance
ldapmodify -D "cn=directory manager" -W -p 389 -x dn: cn=config changetype: modify replace: nsslapd-accesslog-logbuffering nsslapd-accesslog-logbuffering: on
ldapmodify -D "cn=directory manager" -W -p 389 -x dn: cn=config changetype: modify replace: nsslapd-accesslog-enabled nsslapd-accesslog-enabled: off
Warning
4. Optimizing System Performance
Note
4.1. Tuning and Sizing System Memory
Note
4.1.1. Setting the Minimum System Page Cache
vm.min_free_kbytes parameter in the system configuration. For example:
# echo vm.min_free_kbytes=1024 >> /etc/sysctl.conf
4.1.2. Managing the Swap Space
/proc/sys/vm/swappiness kernel parameter sets a threshold for when processes should be swapped out in favor of I/O caching. The value of this is a percentage; the higher the percentage, the higher the I/O cache and the faster that pages are swapped. The default value is 60. This can be changed by editing the system configuration as root:
# echo vm.swappiness=10 >> /etc/sysctl.conf
4.1.3. Tuning for 32-Bit Systems
- Check the amount of memory available for huge pages.
grep Hugepagesize /proc/meminfo Hugepagesize: 4096 kB
This means that each huge page is 4GB. - Set the number of huge pages that can be used through the
nr_hugepageskernel parameter.# echo "vm.nr_hugepages=512" >> /etc/sysctl.conf
- Check the new huge page settings.The defined value for huge pages is viewable in
Hugepagesize, while the total number of huge pages (set innr_hugepages) is shown inHugePages_Total, both in the/proc/meminfo:HugePages_Total: 512 HugePages_Free: 512 HugePages_Rsvd: 0 Hugepagesize: 4096 kB
- For the Directory Server databases to be able to use huge pages, add or set the
memlockparameter for the Directory Server user (nobodyby default) to a high enough seting to allow them to lock that much memory.vim /etc/security/limits.conf nobody soft memlock 1048576 nobody hard memlock 1048576
Important
Red Hat strongly recommends to change the default Directory Server user values and to create adirsrv:dirsrvuser instead of using the defaultnobody:nobodyuser.
4.2. Using dsktune for Preliminary Tuning
dsktune which checks the current machine settings and compares them to the requirements for Directory Server.
[jsmith@example ~]$ dsktune Red Hat Directory Server system tuning analysis version 10-AUGUST-2007. NOTICE : System is i686-unknown-linux2.6.18-164.2.1.el5 (2 processors). NOTICE : The net.ipv4.tcp_keepalive_time is set to 7200000 milliseconds (120 minutes). This may cause temporary server congestion from lost client connections. WARNING: There are only 1024 file descriptors (hard limit) available, which limit the number of simultaneous connections. WARNING: There are only 1024 file descriptors (soft limit) available, which limit the number of simultaneous connections.
4.3. Tuning File Descriptors
4.3.1. Resetting the Host Machine's File Descriptors
4.3.2. Setting Directory Server File Descriptor Values
nsslapd-maxdescriptors attribute. This tells the Directory Server how many file descriptors it has available. (This value cannot be larger than the system setting, or the server ignores it.)
- The server is replicating to a large number of consumer servers (more than 10), or the server is maintaining a large number of index files (more than 30).
- The server is servicing a large number of LDAP connections.
- There are error messages reporting that the server is unable to open file descriptors (the actual error message differs depending on the operation that the server is attempting to perform), but these error messages are not related to managing client LDAP connections.
nsslapd-reservedescriptors = 20 + (NldbmBackends * 4) + NglobalIndex + ReplicationDescriptor + ChainingBackendDescriptors + PTADescriptors + SSLDescriptors
- NldbmBackends is the number of ldbm databases.
- NglobalIndex is the total number of configured indexes for all databases including system indexes. (By default 8 system indexes and 17 additional indexes per database).
- ReplicationDescriptor is eight (8) plus the number of replicas in the server that can act as a supplier or hub (NSupplierReplica).
- ChainingBackendDescriptors is NchainingBackend times the nsOperationConnectionsLimit (a chaining or database link configuration attribute;
10by default). - PTADescriptors is
3if PTA is configured and0if PTA is not configured. - SSLDescriptors is
5(4 files + 1 listensocket) if SSL is configured and0if SSL is not configured.
- Edit the
/etc/sysconfig/dirsrvfile and add a new line setting the processulimit.ulimit -n 8192
- Update the
nsslapd-maxdescriptorsandnsslapd-reservedescriptorsvalues.ldapmodify -D "cn=directory manager" -W -p 389 -h server.example.com -x dn: cn=config changetype: modify replace: nsslapd-maxdescriptors nsslapd-maxdescriptors: 8192 - replace: nsslapd-reservedescriptors nsslapd-reservedescriptors: 40 -
- Restart the Directory Server.
service dirsrv restart
4.3.3. Setting the Socket Connection Backlog
nsslapd-listen-backlog-size attribute.
ldapmodify -D "cn=directory manager" -W -p 389 -x dn: cn=config changetype: modify replace: nsslapd-listen-backlog-size nsslapd-listen-backlog-size: 256
4.4. Setting Shell Limits for the Directory Server User
nobody. However, Red Hat strongly recommends to use a different user and group name such as dirsrv during the installation. Once system settings have been changed, then the limits for that user can be updated.
Note
4.4.1. Setting Shell Limits for File Descriptors
- As
root, open the system's/etc/security/limits.conffile. - Add two lines that set the hard and soft limits for the file descriptors (
nofile) for the Directory Server user. By default, that user isnobody. However, Red Hat strongly recommends to use a different user and group name such asdirsrvduring the installation. The soft limit sets how many file descriptors the user has available by default; the user can manually adjust that setting until they hit the hard limit.nobody soft nofile 4096 nobody hard nofile 63536
Important
Do not set the hard limit for the Directory Server user equal to (or higher than) the maximum number of file descriptors assigned to the system itself in/proc/sys/fs/file-max. If the hard limit is too high and the user users all of those file descriptors, then the entire system runs out of file descriptors.
4.4.2. Setting Shell Limits for the Max Number of Processes
- As
root, open the system's/etc/security/limits.conffile. - Add two lines that set the hard and soft limits for the number of processes (
nproc) for the Directory Server user. By default, that user isnobody. However, Red Hat strongly recommends to use a different user and group name such asdirsrvduring the installation. The soft limit sets how many processes the user has available by default; the user can manually adjust that setting until they hit the hard limit.nobody soft nproc 2047 nobody hard nproc 16384
Important
Do not set the hard limit for the Directory Server user equal to (or higher than) the maximum number of file descriptors assigned to the system itself in/proc/sys/fs/file-max. If the hard limit is too high and the user users all of those file descriptors, then the entire system runs out of file descriptors.
4.5. Tuning TCP Ports
echo "1024 65000" > /proc/sys/net/ipv4/ip_local_port_range
4.6. Changing Firewall Settings for the Directory Server Console
iptables configuration allows those connections past the firewall.
iptables.
- Open the
iptablesfile.# vi /etc/sysconfig/iptables
- Add a line to the configuration for each port that is in use for the Directory Server:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 389 -j ACCEPT -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 636 -j ACCEPT -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 9830 -j ACCEPT
Note
Only add the TLS/SSL port (636) if TLS/SSL is actually enabled for the server. - Restart the firewall:
# service iptables restart
4.7. DNS Requirements
/etc/resolv.conf, /etc/nsswitch.conf, and /etc/netconfig files, and set the DNS resolver for name resolution.
/etc/defaultdomain file to include the NIS domain name. This ensures that the fully-qualified host and domain names used for the Directory Server resolve to a valid IP address and that that IP address resolves back to the correct host name.
5. Tuning the Number of Locks
imports/ directory to prevent any other ns-slapd (normal), ldif2db (another import), or db2ldif (export) operations from running. If the server is running as normal, there is a lock in the server/ directory, which prevents import operations (but not export operations), while if there is an export operation, the lock in the exports/ directory allows normal server operations but prevents import operations.
libdb: Lock table is out of available locks), double the value of the nsslapd-db-locks attribute in the cn=config,cn=ldbm database,cn=plugins,cn=config entry.
10000, set it to 20000. If the problem persists, double the number again. To monitor the current and maximum number of locks, do a search on cn=database,cn=monitor,cn=ldbm database,cn=plugins,cn=config. For example:
ldapsearch -D "cn=directory manager" -W -p 389 -h server.example.com -x -sub -b "cn=database,cn=monitor,cn=ldbm database,cn=plugins,cn=config" objectclass=* | grep -- -locks: )
6. Improving Search Performance (and Balancing Read Performance)
6.1. Using Indexes
- Presence index (pres) simply shows what entries contain an attribute.
- Equality index (eq) shows which attribute values match a specific search string.
- Approximate index (approx) is used for efficient sounds-like searches, which shows entries which have a value that phonetically matches a string.
- Substring index (sub) matches any substring of an attribute value to the given search string. (This index if very expensive for the server to maintain.)
- International index uses a matching rule to match strings in a directory which contains values in languages other than English.
- Browsing index, or virtual list view (VLV) index, sets an index to use to display entries in the Directory Server Console.
Note
- The Directory Server receives an add or modify operation.
- The Directory Server examines the indexing attributes to determine whether an index is maintained for the attribute values.
- If the created attribute values are indexed, then the Directory Server generates the new index entries.
- Once the server completes the indexing, the actual attribute values are created according to the client request.
dn: cn=John Doe, ou=People,dc=example,dc=com objectclass: top objectClass: person objectClass: orgperson objectClass: inetorgperson cn: John Doe cn: John sn: Doe ou: Manufacturing ou: people telephoneNumber: 408 555 8834 description: Manufacturing lead for the Z238 line of widgets.
- Equality, approximate, and substring indexes for
cn(common name) andsn(surname) attributes. - Equality and substring indexes for the telephone number attribute.
- Substring indexes for the description attribute.
- Create the
cnequality index entry forJohnandJohn Doe. - Create the appropriate
cnapproximate index entries forJohnandJohn Doe. - Create the appropriate
cnsubstring index entries forJohnandJohn Doe. - Create the
snequality index entry forDoe. - Create the appropriate
snapproximate index entry forDoe. - Create the appropriate
snsubstring index entries forDoe. - Create the telephone number equality index entry for
408 555 8834. - Create the appropriate telephone number substring index entries for
408 555 8834. - Create the appropriate description substring index entries for
Manufacturing lead for the Z238 line of widgets. A large number of substring entries are generated for this string.
- Approximate indexes are not efficient for attributes commonly containing numbers, such as telephone numbers.
- Substring indexes do not work for binary attributes.
- Equality indexes should be avoided if the value is big (such as attributes intended to contain photographs or passwords containing encrypted data).
- Maintaining indexes for attributes not commonly used in a search increases overhead without improving global searching performance.
- Attributes that are not indexed can still be specified in search requests, although the search performance may be degraded significantly, depending on the type of search.
- The more indexes you maintain, the more disk space you require.
Note
6.2. Tuning Directory Server Resource Settings
- The maximum number of entries the server returns to the client in response to a search operation (size limit attribute).
- The maximum amount of real time (in seconds) for the server to spend performing a search request (time limit attribute).
- The time (in seconds) during which the server maintains an idle connection before terminating it (idle timeout attribute).
- The maximum number of file descriptors available to the Directory Server (max number of file descriptors attribute).
- In the Directory Server Console, select the Configuration tab, and then select the topmost entry in the navigation tree in the left pane.
- Select the Performance tab in the right pane.

- Set the maximum number of entries the server will return to the client in response to a search operation by entering a new value in the Size Limit text box.To keep from setting a limit, type
-1in this text box. - Enter the maximum amount of real time (in seconds) for the server to spend performing a search request in the Time Limit text box.To keep from setting a limit, type
-1in this text box. - Enter the time (in seconds) for the server to maintain an idle connection before terminating it in the Idle Timeout text box.To keep from setting a limit, type zero (
0) in this text box. - Set the maximum number of file descriptors available to the Directory Server in the Max Number of File Descriptors text box. For more information on this parameter, see the Directory Server Configuration, Command, and File Reference.
6.3. Setting Index Scan Limits
inetorgperson entries would have a million entries that were returned with a filter like (objectclass=inetorgperson), and an index for the sn attribute would have at least a million entries in it.
nsslapd-idlistscanlimit, sets a limit on the number of IDs that are read before a key is considered to match the entire primary index (meaning the search is treated as an unindexed search with a different set of resource limits).
nsslapd-idlistscanlimit attribute is 4000, which is gives good performance for a common range of database sizes and access patterns. It's usually not necessary to change this value. If the database index is slightly larger than the 4000 entries, but still significantly smaller than the overall directory, then raising the scan limit improves searches which would otherwise hit the default limit of 4000.
6.4. Fine Grained ID List Size
nsslapd-idlistscanlimit attribute. However in some cases it is useful to define a limit for certain indexes, or use no ID list. You can set individual settings for ID list scan limits for different types of search filters using the nsIndexIDListScanLimit attribute.
objectClass attribute, add the nsIndexIDListScanLimit parameter to the DN cn=objectclass,cn=index,cn=userRoot,cn=ldbm database,cn=plugins,cn=config.
nsIndexIDListScanLimit attribute is multi valued and takes the following list of parameters as a value:
nsIndexIDListScanLimit: limit=NNN [type=eq[,sub,...]] [flags=AND[,XXX,...]] [values=val[,val,...]]
limit: The maximum size of the ID list. Valid values are:-1: Unlimited.0: Do not use the index.1 to the maximum 32-bit integer (2147483647): Maximum number of IDs.
type: Optional. The type of the index.eq,sub,pres, and so on. The value must be one of the actualnsIndexTypespecified for the index definition. For example, you cannot usetype=eqif you do not havensIndexType=eqdefined.flags: Optional. Flags that alter the behavior of applying the scan limit. Valid values are:AND: Apply the scan limit only to searches in which the attribute appears in anANDclause.OR: Apply the scan limit only to searches in which the attribute appears in anORclause.
values: Optional. Comma separated list of values which must match the search filter in order for the limit to be applied. Since the matches are done one at a time, the values will match if any of the values matches.The values must be used with only one type at a time.The values must correspond to the index type, and must correspond to the syntax of the attribute to which the index is applied. For example, if you specified the integer based attributeuidNumberand it is indexed foreq, you cannot usetype=eq values=abc.If the value contains spaces, commas, NULL, or other values which require to be escaped, the LDAP filter escape syntax should be used: backslash (\) followed by the 2 hex digit code for the character. In the following example, the commas in the DN value are escaped with\2C.nsIndexIDListScanLimit: limit=0 type=eq values=uid=user\2Cou=People\2Cdc=example\2Cdc=com
Example 1. Setting nsIndexIDListScanLimit
inetOrgPerson, a search for (&(objectClass=inetOrgPerson)(uid=user)) creates first an ID list containing all 10 million IDs matching objectClass=inetOrgPerson. When the database applies the second part of the filter, it searches the result list for objects matching uid=user. In this cases it is useful to define a limit for certain indexes, or use no ID list at all.
objectClass=inetOrgPerson in AND clauses, add the following nsIndexIDListScanLimit:
ldapmodify -D "cn=directory manager" -W -p 389 -h server.example.com -x
dn: cn=objectclass,cn=index,cn=userRoot,cn=ldbm database,cn=plugins,cn=config
changetype: modify
replace: nsIndexIDListScanLimit
nsIndexIDListScanLimit: limit=0 type=eq flags=AND values=inetOrgPerson
modifying entry "cn=objectclass,cn=index,cn=userRoot,cn=ldbm database,cn=plugins,cn=config"objectClass=inetOrgPerson when used in an AND clause. In all other situations the value of nsslapd-idlistscanlimit is applied.
6.5. Tuning the Database Cache for Searches
NetscapeRoot database, can be resized.
nsslapd-dbcachesize attribute.
6.6. Tuning the Database Settings for Searches
NetscapeRoot database. However, the server uses another database to manage these. On this database, the following attributes can be changed to improve performance:
- The amount of memory to make available for all databases (maximum cache size), which is described in Section 8.2, “Tuning the Entry Cache”.
- The maximum number of entries for the server to verify in response to a search request (look-through limit).
- The amount of memory to make available for import (import cache size).
- In the Directory Server Console, select the Configuration tab; then, in the navigation tree, expand the Data icon, and highlight the Database Settings node.
- Select the LDBM Plug-in Settings tab in the right pane.This tab contains the database attributes for all databases stored on this server.

- In the Maximum Cache Size field, enter a value corresponding to the amount of memory to make available for all databases. This value is for the total of the entire backend, meaning all databases cumulatively rather than the amount per single database instance.
- In the Look-Through Limit field, enter the maximum number of entries for the server to check in response to a search request.
- There are two ways to set the amount of memory in bytes to make available for import. The default is to have auto cache sizing, meaning 50% of the free memory is allocated for the import cache. It is also possible to set the import cache size manually by deselecting the Use Cache Auto-Size check box and then setting the value in the Import Cache Size field. For creating a very large database from LDIF, set this attribute as large as possible, depending on the memory available on the machine. The larger this parameter, the faster the database is created.
Warning
Setting this value too high can cause import failures because of a lack of memory.
6.7. Managing Special Entries
cn=config entry in the simple, flat dse.ldif configuration file is not stored in the same highly scalable database as regular entries. As a result, if many entries, particularly entries that are likely to be updated frequently, are stored under cn=config, performance will probably suffer.
cn=config for performance reasons, it can be useful to store special user entries such as the Directory Manager entry or replication manager (supplier bind DN) entry under cn=config since this centralizes configuration information.
7. Tuning Transaction Logging
Warning
7.1. Changing the Location of the Database Transaction Log
/var/lib/dirsrv/slapd-instance_name/db directory along with the database files themselves. Because the purpose of the transaction log is to aid in the recovery of a directory database that was shut down abnormally, it is a good idea to store the database transaction log on a different disk from the one containing the directory database. Storing the database transaction log on a separate physical disk may also improve directory performance.
Important
/var/lib/dirsrv directory, then you need to label the new location with the dirsrv_var_lib_t context. Otherwise, SELinux may prevent the server from writing to the directory and database operations may fail.
# /usr/sbin/semanage file -a -t dirsrv_var_lib_t -f /new/database-txns/directory
- Stop Directory Server.
service dirsrv stop [instance_name]
- Edit the
dse.ldiffile and change thensslapd-db-logdirectoryattribute to show the new log file location. Provide the full path to the log directory in the attribute.For information on thensslapd-db-logdirectoryattribute syntax, see the Directory Server Configuration, Command, and File Reference. - Copy the existing transation logs and the
DBVERSIONfile into the new transaction log directory.cp /var/lib/dirsrv/slapd-instance_name/db/{log.*,DBVERSION} /path/to/newdirectory - Restart Directory Server.
service dirsrv start [instance_name]
7.2. Changing the Database Checkpoint Interval
ldapmodify command-line utility to add the nsslapd-db-checkpoint-interval attribute to the cn=config,cn=ldbm database,cn=plugins,cn=config entry.
ldapmodify -D "cn=directory manager" -W -p 389 -h server.example.com -x dn: cn=config,cn=ldbm database,cn=plugins,cn=config changetype: modify add: nsslapd-db-checkpoint-interval nsslapd-db-checkpoint-interval: 120
nsslapd-db-checkpoint-interval attribute, see the Directory Server Configuration, Command, and File Reference.
7.3. Disabling Durable Transactions
Warning
- Use the
ldapmodifycommand-line utility to add thensslapd-db-durable-transactionsattribute to thecn=config,cn=ldbm database,cn=plugins,cn=configentry, and set the value of this attribute tooff.ldapmodify -D "cn=directory manager" -W -p 389 -h server.example.com -x dn: cn=config,cn=ldbm database,cn=plugins,cn=config changetype: modify add: nsslapd-db-durable-transactions nsslapd-db-durable-transactions: off
For information on the syntax of thensslapd-db-durable-transactionsattribute, see the Directory Server Configuration, Command, and File Reference. - Restart the Directory Server.
service dirsrv restart
7.4. Specifying Transaction Batching
nsslapd-db-transaction-batch-val attribute to specify how many transactions will be batched before being committed to the transaction log. Setting this attribute to a value of greater than 0 causes the server to delay committing transactions until the number of queued transactions is equal to the attribute value. This is similar to disabling durable transaction logging (in the nsslapd-db-durable-transaction attribute), but setting the batch value gives more control over how many transactions can be potentially lost.
ldapmodify command-line utility to add the nsslapd-db-transaction-batch-val attribute to the cn=config,cn=ldbm database,cn=plugins,cn=config entry.
ldapmodify -D "cn=directory manager" -W -p 389 -x dn: cn=config,cn=ldbm database,cn=plugins,cn=config changetype: modify add: nsslapd-db-transaction-batch-val nsslapd-db-transaction-batch-val: 1
nsslapd-db-transaction-batch-val attribute, see the Directory Server Configuration, Command, and File Reference.
8. Managing the Database Cache Settings
- The Entry cache, which contains individual directory entries.
- The DN cache is used to associate DNs and RDNs with entries.
- The Database cache, which contains the database index files
*.dband*.db4files.
8.1. Determining the Required Cache Sizes
dbmon.sh script enables you to monitor cache statistics at runtime and continuously outputs the statistics. To terminate the script, press the Ctrl+C key combination.
Note
dbmon.sh requires you to pass the options as environment variables to the script. For further details see the Directory Server Configuration, Command, and File Reference.
Example 2. Using the dbmon.sh Script
# BINDDN="cn=Directory Manager" BINDPW=secret HOST=server.example.com PORT=389 dbmon.sh
dbcachefree 397310 free% 2.2 roevicts 9282348 hit% 50 pagein 2934772 pageout 219075
dbname count free free% size
userroot:ent 50000 2400 0.8 8972.7
userroot:dn 100000 4294735 69.8 130.0userroot database, enter:
#dbscan -f /var/lib/dirsrv/slapd-instance_name/db/userRoot/id2entry.db -t 200 | \grep -c rdn:
count column of the dbmon.sh script's output. Additionally, if all of the entries and DNs fit within their respective caches, the userroot:ent count value matches the userroot:dn count value.
dbmon.sh script example shows:
- Only 2.2% free database cache is left:
dbcachefree 397310 free% 2.2 roevicts 9282348 hit% 50 pagein 2934772 pageout 219075However, to operate efficiently, at least 15% free database cache is required. To determine the optimal size of the database cache, calculate the sizes of all*.dband*.db4files in the/var/lib/dirsrv/slapd-instance_name/db/directory including subdirectories and the changelog database, and add 12% for overhead.To set the database cache, see Section 8.4, “Tuning the Database Cache”. - The DN cache of the
userrootdatabase is well-chosen:dbname count free free% size userroot:dn 100000 4294735 69.8 130.0
The DN cache of the database contains 100000 records. 69,8% of the cache is free. Based on thecountvalue and the bytes used, each DN in memory requires 130 bytes on average.To set the DN cache, see Section 8.4, “Tuning the Database Cache”. - The statistics on the entry cache of the
userrootdatabase indicates that the entry cache value should be increased for better performance:dbname count free free% size userroot:ent 50000 2400 0.8 8972.7
The entry cache contains in this database 50000 records and only 2 Kilobytes of free space are left. To enable Directory Server to cache all 100000 DNs, reported by thedbscanutility's output, the cache must be increased to minimum of 856 Megabytes (100000 DNs * 8972,7 bytes average entry size). However, it is recommended to round the minimum required size to the next highest Gigabyte and double the result. In this example, the entry cache should be set to 2 Gigabytes.To set the entry cache, see Section 8.2, “Tuning the Entry Cache”.
8.2. Tuning the Entry Cache
id2entry.db database file and converts the DNs from the on-disk format to the in-memory format. Entries that are stored in the cache enable the server to skip the disk I/O and conversion steps.
8.2.1. Setting the Entry Cache Size in the Directory Server Console
cn=userRoot database to 2 GB:
- Start the Directory Server Console.
- Select the Configuration tab and, in the navigation tree, expand the Data icon.
- Expand the suffix associated with the database, such as
dc=example,dc=com, and then select the database. - In the Database Settings tab, fill the Memory available for cache field and select the unit. For example:

- Click .
- Restart the Directory Server instance:
# systemctl restart dirsrv.target
8.2.2. Setting the Entry Cache Size From the Command Line
- Set the value in the Directory Server configuration:
# ldapmodify -D "cn=directory manager" -W -x dn: cn=database_name,cn=ldbm database,cn=plugins,cn=config changetype: modify replace: nsslapd-cachememsize nsslapd-cachememsize: 2147483648
- Restart the Directory Server instance:
# systemctl restart dirsrv.target
8.3. Tuning the DN Cache
entryrdn index is used to associate DNs and RDNs with entries. It enables the server to efficiently perform subtree rename, entry move, and moddn operations. The DN cache is used to cache the in-memory representation of the entryrdn index to avoid expensive file I/O and transformation operations. For best performance, especially with but not limited to entry rename and move operations, set the DN cache to a size that enables Directory Server to cache all DNs in the database.
entryrdn.db index database file and converts the DNs from the on-disk format to the in-memory format. DNs that are stored in the cache enable the server to skip the disk I/O and conversion steps.
- Update the value in the Directory Server configuration:
# ldapmodify -D "cn=directory manager" -W -x dn: cn=database_name,cn=ldbm database,cn=plugins,cn=config changetype: modify replace: nsslapd-dncachememsize nsslapd-dncachememsize: 20971520
- Restart the Directory Server instance:
# systemctl restart dirsrv.target
8.4. Tuning the Database Cache
*.db and other files used for attribute indexing by the database. This value is passed to the Berkeley DB API function set_cachesize().
Note
8.4.1. Setting the Database Cache Size in the Directory Server Console
- Start the Directory Server Console.
- Select the Configuration tab and, in the navigation tree, expand the Data icon.
- Select the Database Settings entry.
- In the LMDB Plug-in Settings tab, fill the Maximum cache size field and select the unit.

- Click .The Directory Server Console returns an
LDAP_UNWILLING_TO_PERFORMerror message when you set:- a value that is not a number.
- a value that is too big for a 32-bit signed integer (2147483647) on a 32-bit system.
- a value that is too big for a 64-bit signed integer (9223372036854775807) on a 64-bit system.
- Restart the Directory Server instance:
# systemctl restart dirsrv.target
8.4.2. Setting the Database Cache Size From the Command Line
- Update the value in the Directory Server configuration:
# ldapmodify -D "cn=directory manager" -W -x dn: cn=config,cn=ldbm database,cn=plugins,cn=config changetype: modify replace: nsslapd-dbcachesize nsslapd-dbcachesize: 268435456
- Restart the Directory Server instance:
# systemctl restart dirsrv.target
8.4.3. Storing the Database Cache on a RAM Disk
- Create a directory for the database cache and metadata on the RAM disk:
# mkdir -p /dev/shm/slapd-instance_name/
- Set the path to the directory on the RAM disk in the
nsslapd-db-home-directoryattribute:# ldapmodify -D "cn=directory manager" -W -x dn: cn=config,cn=ldbm database,cn=plugins,cn=config changetype: modify replace: nsslapd-db-home-directory nsslapd-db-home-directory: /dev/shm/slapd-instance_name/
- Restart the Directory Server instance:
# systemctl restart dirsrv.target
Note
9. Tuning the Replication Performance
9.1. Improving the Multi-Master Replication Efficiency
nsds5ReplicaReleaseTimeout parameter on replication masters and hubs. For example, to set a 60 seconds timeout, enter:
[root@server ~]# ldapmodify -D "cn=Directory Manager" -W -x dn: cn=replica,cn=dc\3Dexample\2Cdc\3Dcom,cn=mapping tree,cn=config changetype: modify replace: nsds5ReplicaReleaseTimeout nsds5ReplicaReleaseTimeout: 60
60 second default value is ideal for most environments. A value set too high or too low can have a negative impact on the replication performance. If the value is set too low, replication servers are constantly reacquiring one another and servers are not able to send many updates. In a high-traffic replication environment, a longer timeout can improve situations where one master exclusively accesses a replica. However, in most cases, a value higher than 120 seconds slows down replication.
10. Tuning Database Link Performance
10.1. Managing Connections to the Remote Server
10.1.1. Managing Connections to the Remote Server Using the Console
- Select the Configuration tab, expand the Data folder in the left pane, and select the suffix, then the database link to change.

- Click the Limits and Controls tab in the right navigation pane.

- In the Connection Management section, make changes to any of the following fields:
- Maximum TCP connection(s). The maximum number of TCP connections that the database link establishes with the remote server. The default value is
3connections. - Bind timeout. Amount of time, in seconds, before the database link's bind attempt times out. The default value is
15seconds. - Maximum binds per connection. Maximum number of outstanding bind operations per TCP connection. The default value is
10outstanding bind operations per connection. - Time out before abandon (sec). Number of seconds before the server checks to see if a timed-out connection should be abandoned. The default value is
1second. - Maximum LDAP connection(s). Maximum number of LDAP connections that the database link establishes with the remote server. The default value is
10connections. - Maximum bind retries. Number of times a database link attempts to bind to the remote server. A value of
0indicates that the database link will try to bind only once. The default value is3attempts. - Maximum operations per connection. Maximum number of outstanding operations per LDAP connection. The default value is
2operations per connection. - Connection lifetime (sec). How long a connection made between the database link and remote server remains open. Connections between the database link and the remote server can be kept open for an unspecified time or closed after a specific period of time. It is faster to keep the connections open, but it uses more resources. For slow connections, it may be desirable to limit the connection time. A value of
0indicates there is no limit. By default, the value is set to0.
10.1.2. Managing Connections to the Remote Server from the Command Line
ldapmodify to add connection attributes to the database link entry.
cn=default instance config,cn=chaining database,cn=plugins,cn=config
cn=database_link,cn=chaining database,cn=plugins,cn=config
cn=default instance config entry.
Table 13. Database Link Connection Management Attributes
| Attribute Name | Description |
|---|---|
| nsOperationConnectionsLimit | Maximum number of LDAP connections that the database link establishes with the remote server. The default value is 20 connections per database link instance. |
| nsBindConnectionsLimit | Maximum number of TCP connections that the database link establishes with the remote server. The default value is 3 connections. |
| nsConcurrentOperationsLimit | Maximum number of outstanding operations per LDAP connection. The default value is 2 operations per connection. |
| nsConcurrentBindLimit | Maximum number of outstanding bind operations per TCP connection. The default value is 10 outstanding bind operations. |
| nsBindRetryLimit | Number of times a database link attempts to bind to the remote server. A value of zero (0) indicates that the database link will try to bind only once. The default value is 3 attempts. |
| nsConnectionLife | Connection lifetime, in seconds. Connections between the database link and the remote server can be kept open for an unspecified time or closed after a specific period of time. It is faster to keep the connections open, but it uses more resources. For example, it may be wise to limit the connection time for a slow connection. A value of 0 indicates there is no limit. By default, the value is set to 0. When the value is 0 and there is a list of failover servers in the nsFarmServerURL attribute, the first server is never contacted after failover to the alternate server. The default value is 0 seconds. |
| nsBindTimeout | Amount of time, in seconds, before the bind attempt times out. The default value is 15 seconds. |
| nsAbandonedSearchCheckInterval | Number of seconds that pass before the server checks for abandoned operations. The default value is 1 second. |
10.2. Detecting Errors During Normal Processing
nsMaxResponseDelay and nsMaxTestResponseDelay — which work together to determine if the remote server is no longer responding.
nsMaxResponseDelay, sets a maximum duration for an LDAP operation to complete. If the operation takes more than the amount of time specified in this attribute, the database link's server suspects that the remote server is no longer online.
nsMaxResponseDelay period has been met, the database link pings the remote server. During the ping, the database link issues another LDAP request, a simple search request for an object that does not exist in the remote server. The duration of the ping is set using the nsMaxTestResponseDelay.
nsMaxTestResponseDelay period has passed, then an error is returned, and the connection is flagged as down. All connections between the database link and remote server will be blocked for 30 seconds, protecting the server from a performance degradation. After 30 seconds, operation requests made by the database link to the remote server continue as normal.
cn=config,cn=chaining database,cn=plugins,cn=config entry. The following table describes the attributes in more detail:
Table 14. Database Link Processing Error Detection Parameters
| Attribute Name | Description |
|---|---|
| nsMaxResponseDelay | Maximum amount of time it can take a remote server to respond to an LDAP operation request made by a database link before an error is suspected. This period is given in seconds. The default delay period is 60 seconds. Once this delay period has been met, the database link tests the connection with the remote server. |
| nsMaxTestResponseDelay | Duration of the test issued by the database link to check whether the remote server is responding. If a response from the remote server is not returned before this period has passed, the database link assumes the remote server is down, and the connection is not used for subsequent operations. This period is given in seconds. The default test response delay period is 15 seconds. |
10.3. Managing Threaded Operations
nsslapd-threadnumber global configuration attribute in the cn=config entry. The default thread number is 30. Restart the server after changing the thread count to apply the changes.
11. Improving Import Performance
11.1. Importing Entries with Large Attributes
nsslapd-cachememsize attribute defines the size allowed for the entry cache.
nsslapd-cachememsize attribute high enough so that the import buffer has enough memory to process the entries.
11.2. Importing Large Numbers of Entries
ulimit value to the maximum number of allows processes for the system user.
[root@server ~]# ulimit -u 4096
A. Revision History
| Revision History | |||
|---|---|---|---|
| Revision 9.1-9 | Mon Jun 26, 2017 | ||
| |||
| Revision 9.1-8 | Fri Feb 24, 2017 | ||
| |||
| Revision 9.1-6 | Wed Jun 22, 2016 | ||
| |||
| Revision 9.1-5 | May 23, 2013 | ||
| |||
| Revision 9.1-1 | February 21, 2013 | ||
| |||
| Revision 9.0-1 | December 7, 2011 | ||
| |||
