Administrator’s Guide
Red Hat Directory Server                                                            

Previous
Contents
Index
Next

Chapter 14

Tuning Directory Server Performance


This chapter describes the tools provided with Red Hat Directory Server (Directory Server) to help optimize performance. It also provides tips to improve the performance of your directory.

This chapter contains the following sections:

Tuning Server Performance

You can manage your server's performance by limiting the amount of resources the server uses to proces client search requests. You can define:

To configure Directory Server to optimize performance:

  1. In the Directory Server Console, select the Configuration tab, and then select the topmost entry in the navigation tree in the left pane.
The tabs that are displayed in the right pane control server-wide configuration attributes.
  1. Select the Performance tab in the right pane.
The current server performance settings appear.
  1. 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.
If you do not want to set a limit, type -1 in this text box.
  1. Enter the maximum amount of real time (in seconds) you want the server to spend performing a search request in the Time Limit text box.
If you do not want to set a limit, type zero (0) in this text box.
  1. Enter the time (in seconds) during which you want the server to maintain an idle connection before terminating it in the Idle Timeout text box.
If you do not want to set a limit, type zero (0) in this text box.
  1. 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 Red Hat Directory Server Configuration, Command, and File Reference.

For a better understanding of how these parameters impact your server's search performance, see "About Indexes," on page 391.

Tuning Database Performance

This section is divided into the following parts which describe methods for tuning database performance:

Optimizing Search Performance

You can improve server performance on searches by tuning database settings. The database attributes that affect performance mainly define the amount of memory available to the server.

To improve the cache hit ratio on search operations, you can increase the amount of data that the Directory Server maintains in the database cache. Do this by increasing the number of entries stored in the cache and by increasing the cache size. The maximum values that you can set for these attributes depends on the amount of real memory on your machine. Roughly, the amount of available memory on your machine should always be greater than Maximum Entries in Cache x Average Entry Size.

Use caution when changing these two attributes. Your ability to improve server performance with these attributes depends on the size of your database, the amount of physical memory available on your machine, and whether directory searches are random (that is, if your directory clients are searching for random and widely scattered directory data).

If your database does not fit into memory and if searches are random, attempting to increase the values set on these attributes does not help directory performance. In fact, changing these attributes may harm overall performance.

You can tune the following attributes:

To configure the default database attributes that apply to all other database instances:

  1. In the Directory Server Console, select the Configuration tab; then, in the navigation tree, expand the Data Icon, and highlight the Database Settings node.
This displays the Database tabs in the right pane.
  1. Select the LDBM Plugin Settings tab in the right pane.
This tab contains the database attributes for all databases stored on this server.
  1. In the Maximum Cache Size field, enter a value corresponding to the amount of memory that you want to make available for all databases.
  2. In the look-through limit field, enter the maximum number of entries you want the server to check in response to a search request.
If you do not want to set a limit, type -1 in this text box. If you bind to the directory as the Directory Manager, by default the look-through limit is unlimited and overrides any settings you specify here.

To configure the attributes of each database that stores your directory data:

  1. In the Directory Server Console, select the Configuration tab; then, in the navigation tree, expand the Data Icon. Expand the suffix of the database you want to tune, and highlight the database.
The tabs displayed in the right pane control parameter settings for this database.
  1. Select the Database Settings tab in the right pane.
  2. Enter the number of entries you want the server to keep in memory in the Maximum Entries in Cache field.
  3. Enter the amount of memory you want to make available for cached entries in the Memory Available for Cache field.
If you are creating a very large database from LDIF, set this attribute as large as possible, depending on the memory available on your machine. The larger this parameter, the faster your database will be created.
When you have finished creating your database, be sure to set this parameter back to some lower value before you run your server in a production environment.

Tuning Transaction Logging

Every Directory Server contains a transaction log which logs operations for all the databases it manages. Whenever a directory database operation such as a write is performed, the server logs the operation to the transaction log. For best performance, the directory does not perform the operation immediately. Instead, the operation is stored in a temporary memory cache on the Directory Server until the operation is completed.

If the server experiences a failure, such as a power outage, and shuts down abnormally, the information about recent directory changes that were stored in the cache is lost. However, when the server restarts, the directory automatically detects the error condition and uses the database transaction log to recover the database.

Although database transaction logging and database recovery are automatic processes that require no intervention, you may want to tune some of the database transaction logging attributes to optimize performance.

Caution

The transaction logging attributes are provided only for system modifications and diagnostics. These settings should be changed only with the guidance of Red Hat Professional Services or Red Hat Technical Support.

Setting these attributes and other configuration attributes inconsistently may cause the directory to be unstable.


Changing the Location of the Database Transaction Log

By default, the database transaction log file is stored in the serverRoot/slapd-serverID/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.

To change the location of the database transaction log file, use the following procedure:

  1. Stop the Directory Server.
For instructions, refer to "Starting and Stopping the Server from the Console," on page 38.
  1. Use the ldapmodify command-line utility to add the nsslapd-db-logdirectory attribute to the cn=config,cn=ldbm database,cn=plugins,cn=config entry. Provide the full path to the log directory in the attribute.
For information on the nsslapd-db-logdirectory attribute syntax, see the Red Hat Directory Server Configuration, Command, and File Reference. For instructions on using ldapmodify, refer to "Adding and Modifying Entries Using ldapmodify," on page 60.
  1. Restart Directory Server.

Changing the Database Checkpoint Interval

At regular intervals, the Directory Server writes operations logged in the transaction log to the disk and logs a checkpoint entry in the database transaction log. By indicating which changes have already been written to the directory, checkpoint entries indicate where to begin recovery from the transaction log, thus speeding up the recovery process.

By default, the Directory Server is set up to send a checkpoint entry to the database transaction log every 60 seconds. Increasing the checkpoint interval may increase the performance of directory write operations. However, increasing the checkpoint interval may also increase the amount of time required to recover directory databases after a disorderly shutdown and require more disk space due to large database transaction log files. Therefore, you should only modify this attribute if you are familiar with database optimization and can fully assess the effect of the change.

To modify the checkpoint interval while the server is running, use the ldapmodify command-line utility to add the nsslapd-db-checkpoint-interval attribute to the cn=config,cn=ldbm database,cn=plugins,cn=config entry.

For more information on the syntax of the nsslapd-db-checkpoint-interval attribute, refer to the Red Hat Directory Server Configuration, Command, and File Reference. For instructions on using ldapmodify, refer to "Adding and Modifying Entries Using ldapmodify," on page 60.

Disabling Durable Transactions

Durable transaction logging means that the temporary database transaction log is, in fact, physically written to disk.

When durable transaction logging is disabled, every directory database operation is written to the database transaction log file but may not be physically written to disk immediately. If a directory change was written to the logical database transaction log file but not physically written to disk at the time of a system crash, you cannot recover the change. When durable transactions are disabled, the recovered database is consistent but does not reflect the results of any LDAP write operations that completed just before the system crash.

By default, durable database transaction logging is enabled. To disable durable transaction logging, use the following procedure:

  1. Stop the Directory Server.
For instructions, refer to "Starting and Stopping the Server from the Command-Line," on page 38.
  1. Use the ldapmodify command-line utility to add the nsslapd-db-durable-transactions attribute to the cn=config,cn=ldbm database,cn=plugins,cn=config entry, and set the value of this attribute to off.
For information on the syntax of the nsslapd-db-durable-transactions attribute, see the Red Hat Directory Server Configuration, Command, and File Reference. For instructions on using ldapmodify, refer to "Adding and Modifying Entries Using ldapmodify," on page 60.
  1. Restart the Directory Server.

Specifying Transaction Batching

To improve update performance when full transaction durability is not required, you can use the 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. For transaction batching to be valid, the nsslapd-db-durable-transaction attribute must be set to on.

To specify or modify transaction batching while the server is running, use the 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.

For more information on the syntax and values of the nsslapd-db-transaction-batch-val attribute, refer to the Red Hat Directory Server Configuration, Command, and File Reference. For instructions on using ldapmodify, refer to "Adding and Modifying Entries Using ldapmodify," on page 60.

Miscellaneous Tuning Tips

This section provides you with some performance related tips and concepts you ought to remember.

Avoid Creating Entries Under the cn=config Entry in the dse.ldif File

The 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.

Although we recommend you do not store simple user entries under 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, as this allows you to centralize configuration information.




Previous
Contents
Index
Next

© 2001 Sun Microsystems, Inc. Used by permission. © 2005 Red Hat, Inc. All rights reserved.
Read the Full Copyright and Third-Party Acknowledgments.

last updated May 20, 2005