|Previous Contents Index DocHome Next|
|iPlanet Directory Server 5.1 Administrator's Guide|
Chapter 14 Tuning Directory Server Performance
This chapter describes the tools provided with iPlanet 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 process client search requests. You can define:
The maximum number of entries the server returns to the client in response to a search operation (size limit attribute) To configure iPlanet Directory Server to optimize performance:
On the iPlanet 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.
Select the Performance tab in the right pane.
The current server performance settings appear.
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.
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 -1 in this text box.
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.
Set the maximum number of file descriptors available to the directory server in the Max Number of File Descriptors text box. For a better understanding of how these parameters impact your server's search performance, see "About Indexes," on page 347.
Tuning Database Performance
This section is divided into the following parts which describe methods for tuning database performance:
"Optimizing Search 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 + Maximum Cache Size) 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:
The attributes of the database that manages all other database instances. In iPlanet Directory Server Console, you can see only the databases that contain your directory data, and the NetscapeRoot database. However, the server uses another database to manage these. On this database, you can change the following attributes to improve performance:
The amount of memory that you want to make available for all databases (maximum cache size attribute)
The attributes of each database that you use to store directory data, including the server configuration data in the NetscapeRoot database. On these databases, you can change the following attributes to improve performance:
To configure the default database attributes that apply to all other database instances:
On the iPlanet 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.
Select the LDBM Plugin 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 that you want to make available for all databases.
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:
On the iPlanet 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.
Select the Database Settings tab in the right pane.
Enter the number of entries you want the server to keep in memory in the Maximum Entries in Cache field.
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 iPlanet 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 are 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.
The transaction logging attributes are provided only for system modifications and diagnostics. These settings should be changed only with the guidance of iPlanet Professional Services or iPlanet Support.
Changing the Location of the Database Transaction Log
By default, the database transaction log file is stored along with the database files themselves in the following directory:
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:
Stop the iPlanet Directory Server.
For instructions, refer to "Starting/Stopping the Server From the Console," on page 35.
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 iPlanet Directory Server Configuration, Command, and File Reference. For instructions on using ldapmodify, refer to "Adding and Modifying Entries Using ldapmodify," on page 53.
Restart iPlanet 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 only 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 following procedure:
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 iPlanet Directory Server Configuration, Command, and File Reference. For instructions on using ldapmodify, refer to "Adding and Modifying Entries Using ldapmodify," on page 53.
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:
Stop the iPlanet Directory Server.
For instructions, refer to "Starting/Stopping the Server From the Command Line," on page 35.
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 iPlanet Directory Server Configuration, Command, and File Reference. For instructions on using ldapmodify, refer to "Adding and Modifying Entries Using ldapmodify," on page 53.
Restart the iPlanet 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 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 iPlanet Directory Server Configuration, Command, and File Reference. For instructions on using ldapmodify, refer to "Adding and Modifying Entries Using ldapmodify," on page 53.
Miscellaneous Tuning Tips
This section provides you with some performance related tips and concepts you should consider.
Creating Entries Under cn=config
The cn=config entry is stored in the simple, flat dse.ldif configuration file, and not in the same highly scalable database as regular entries. As a result, if many entries, and particularly entries that are likely to be updated frequently, are stored under cn=config, performance will probably suffer.
However, 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 DocHome Next
Copyright © 2002 Sun Microsystems, Inc. Some preexisting portions Copyright © 2001 Netscape Communications Corp. All rights reserved.
Last Updated February 26, 2002