Show Table of Contents
10. Tuning Database Link Performance
Database link performance can be improved through changes to the Directory Server's connection and thread management.
10.1. Managing Connections to the Remote Server
Each database link maintains a pool of connections to a remote server. The connections to optimize resources can be configured for the directory.
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
Use
ldapmodify to add connection attributes to the database link entry.
The default connection management attributes are stored in the following entry:
cn=default instance config,cn=chaining database,cn=plugins,cn=config
The connection management attributes for a specific database link are stored in the following entry:
cn=database_link,cn=chaining database,cn=plugins,cn=config
The connection management attributes specified in this entry take precedence over the attributes specified in the
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
Protect server performance by detecting errors during the normal chaining operation between the database link and the remote server. The database link has two attributes —
nsMaxResponseDelay and nsMaxTestResponseDelay — which work together to determine if the remote server is no longer responding.
The first attribute,
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.
Once the
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.
If the remote server does not respond before the
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.
Both attributes are stored in the
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
Generally, Directory Server performs best using a limited number of threads for processing operations. A limited number of threads can generally process operations very quickly, preventing the queue of operations waiting for a free thread from growing too long.
On multi-core or multi-CPU machines, a good starting point is to use two threads per core or CPU. This gives a good balance between performance and concurrency. If performance becomes an issue, or clients are not being served as quickly as possible, increase the number of threads.
However, the database link forwards operations to remote servers for processing. The database link contacts the remote server, forwards the operation, waits for the result, and then sends the result back to the client application. The entire operation can take much longer than a local operation.
While the database link waits for results from the remote server, it can process additional operations. When using database links, performance can be improved by increasing the number of threads available for processing operations. While the local CPU waits for a response from a remote server, it can process other operations rather than stand idle.
To change the number of threads used for processing operations, change the
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.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.