Product SiteDocumentation Site

3.4. Database Plug-in Attributes

The database plug-in is also organized in an information tree, as shown in Figure 3.1, “Database Plug-in”.
Database Plug-in
Figure 3.1. Database Plug-in

All plug-in technology used by the database instances is stored in the cn=ldbm database plug-in node. This section presents the additional attribute information for each of the nodes in bold in the cn=ldbm database, cn=plugins, cn=config information tree.

3.4.1. Database Attributes under cn=config, cn=ldbm database, cn=plugins, cn=config

This section covers global configuration attributes common to all instances are stored in the cn=config, cn=ldbm database, cn=plugins, cn=config tree node.
This sets the amount of time in seconds after which the Directory Server sends a checkpoint entry to the database transaction log. The database transaction log contains a sequential listing of all recent database operations and is used for database recovery only. A checkpoint entry indicates which database operations have been physically written to the directory database. The checkpoint entries are used to determine where in the database transaction log to begin recovery after a system failure. The nsslapd-db-checkpoint-interval attribute is absent from dse.ldif. To change the checkpoint interval, add the attribute to dse.ldif. This attribute can be dynamically modified using ldapmodify. For further information on modifying this attribute, see the "Tuning Directory Server Performance" chapter in the Directory Server Administrator's Guide.
This attribute is provided only for system modification/diagnostics and should be changed only with the guidance of Red Hat technical support or Red Hat professional services. Inconsistent settings of this attribute and other configuration attributes may cause the Directory Server to be unstable.
For more information on database transaction logging, refer to the "Monitoring Server and Database Activity" chapter in the Directory Server Administrator's Guide.
Parameter Description
Entry DN cn=config, cn=ldbm database, cn=plugins, cn=config
Valid Range 10 to 300 seconds
Default Value 60
Syntax Integer
Example nsslapd-db-checkpoint-interval: 120
This attribute sets whether database transaction log entries are immediately written to the disk. The database transaction log contains a sequential listing of all recent database operations and is used for database recovery only. With durable transactions enabled, every directory change will always be physically recorded in the log file and, therefore, able to be recovered in the event of a system failure. However, the durable transactions feature may also slow the performance of the Directory Server. When durable transactions is disabled, all transactions are logically written to the database transaction log but may not be physically written to disk immediately. If there were a system failure before a directory change was physically written to disk, that change would not be recoverable. The nsslapd-db-durable-transactions attribute is absent from dse.ldif. To disable durable transactions, add the attribute to dse.ldif.
This attribute is provided only for system modification/diagnostics and should be changed only with the guidance of Red Hat Technical Support or Red Hat Professional Services. Inconsistent settings of this attribute and other configuration attributes may cause the Directory Server to be unstable.
For more information on database transaction logging, refer to the "Monitoring Server and Database Activity" chapter in the Directory Server Administrator's Guide.
Parameter Description
Entry DN cn=config, cn=ldbm database, cn=plugins, cn=config
Valid Values on | off
Default Value on
Syntax DirectoryString
Example nsslapd-db-durable-transactions: on
This is usually applicable to Solaris only, and is used to fix a situation in Solaris where the operating system endlessly flushes pages. This flushing can be so excessive that performance of the entire system is severely degraded.
For users of other systems, to move the database to another physical location for performance reasons, use this parameter to specify the home directory.
This situation will occur only for certain combinations of the database cache size, the size of physical memory, and kernel tuning attributes. In particular, this situation should not occur if the database cache size is less than 100 megabytes.
If the Solaris host seems excessively slow and the database cache size is around 100 megabytes or more, then use the iostat utility to diagnose the problem by monitoring the activity of the disk where the Directory Server's database files are stored. There are three conditions required before resetting the nsslapd-db-home-directory attribute:
  • The disk is heavily used (more than 1 megabyte per second of data transfer).
  • There is a long service time (more than 100ms).
  • There is mostly write activity.
If these are all true, use the nsslapd-db-home-directory attribute to specify a subdirectory of a tempfs type filesystem.
The directory referenced by the nsslapd-db-home-directory attribute must be a subdirectory of a filesystem of type tempfs (such as /tmp). However, Directory Server does not create the subdirectory referenced by this attribute. This directory must be created either manually or by using a script. Failure to create the directory referenced by the nsslapd-db-home-directory attribute will result in Directory Server being unable to start.
Also, if there are multiple Directory Servers on the same machine, their nsslapd-db-home-directory attributes must be configured with different directories. Failure to do so will result in the databases for both directories becoming corrupted.
The use of this attribute causes internal Directory Server database files to be moved to the directory referenced by the attribute. It is possible, but unlikely, that the server will no longer start after the files have been moved because not enough memory can be allocated. This is a symptom of an overly large database cache size being configured for the server. If this happens, reduce the size of the database cache size to a value where the server will start again.
Parameter Description
Entry DN cn=config, cn=ldbm database, cn=plugins, cn=config
Valid Values Any valid directory name in a tempfs filesystem, such as /tmp
Default Value
Syntax DirectoryString
Example nsslapd-db-home-directory: /tmp/slapd-phonebook
This attribute specifies how many transactions will be batched before being committed. This attribute can improve update performance when full transaction durability is not required. This attribute can be dynamically modified using ldapmodify. For further information on modifying this attribute, refer to the "Tuning Directory Server Performance" chapter in the Directory Server Administrator's Guide.

WARNING

Setting this value will reduce data consistency and may lead to loss of data. This is because if there is a power outage before the server can flush the batched transactions, those transactions in the batch will be lost.
Do not set this value unless specifically requested to do so by Red Hat support.
If this attribute is not defined or is set to a value of 0, transaction batching will be turned off, and it will be impossible to make remote modifications to this attribute via LDAP. However, 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. A value greater than 0 also allows modififications to this attribute remotely via LDAP. A value of 1 for this attribute allows modifications to the attribute setting remotely via LDAP, but results in no batching behavior. A value of 1 at server startup is therefore useful for maintaining normal durability while also allowing transaction batching to be turned on and off remotely when desired. Remember that the value for this attribute may require modifying the nsslapd-db-logbuf-size attribute to ensure sufficient log buffer size for accommodating the batched transactions.

NOTE

The nsslapd-db-transaction-batch-val attribute is only valid if the nsslapd-db-durable-transaction attribute is set to on.
For more information on database transaction logging, refer to the "Monitoring Server and Database Activity" chapter in the Directory Server Administrator's Guide.
Parameter Description
Entry DN cn=config, cn=ldbm database, cn=plugins, cn=config
Valid Range 0 to 30
Default Value 0 (or turned off)
Syntax Integer
Example nsslapd-db-transaction-batch-val: 5
This attribute can split the LDBM cache into equally sized separate pieces of memory. It is possible to specify caches that are large enough so that they cannot be allocated contiguously on some architectures; for example, some releases of Solaris limit the amount of memory that may be allocated contiguously by a process. If nsslapd-dbncache is 0 or 1, the cache will be allocated contiguously in memory. If it is greater than 1, the cache will be broken up into ncache, equally sized separate pieces of memory.
To configure a dbcache size larger than 4 gigabytes, add the nsslapd-dbncache attribute to cn=config, cn=ldbm database, cn=plugins, cn=config between the nsslapd-dbcachesize and nsslapd-db-logdirectory attribute lines.
Set this value to an integer that is one-quarter (1/4) the amount of memory in gigabytes. For example, for a 12 gigabyte system, set the nsslapd-dbncache value to 3; for an 8 gigabyte system, set it to 2.
This attribute is provided only for system modification/diagnostics and should be changed only with the guidance of Red Hat technical support or Red Hat professional services. Inconsistent settings of this attribute and other configuration attributes may cause the Directory Server to be unstable.
The server has to be restarted for changes to this attribute to go into effect.
Parameter Description
Entry DN cn=config, cn=ldbm database, cn=plugins, cn=config
Valid Values 1 to 4
Default Value 1
Syntax Integer
Example nsslapd-dbncache: 1
This performance tuning-related attribute automatically sets the size of the import cache (importCache) to be used during the command-line-based import process of LDIF files to the database (the ldif2db operation).
In Directory Server, the import operation can be run as a server task or exclusively on the command-line. In the task mode, the import operation runs as a general Directory Server operation. The nsslapd-import-cache-autosize attribute enables the importCache to be set automatically to a predetermined size when the import operation is run on the command-line. The attribute can also be used by Directory Server during the task mode import for allocating a specified percentage of free memory for importCache.
By default, the nsslapd-import-cache-autosize attribute is enabled and is set to a value of -1. This value autosizes importCache for the ldif2db operation only, automatically allocating fifty percent (50%) of the free physical memory for importCache. The percentage value (50%) is hardcoded and cannot be changed.
Setting the attribute value to 50 (nsslapd-import-cache-autosize: 50) has the same effect on performance during an ldif2db operation. However, such a setting will have the same effect on performance when the import operation is run as a Directory Server task. The -1 value autosizes importCache just for the ldif2db operation and not for any, including import, general Directory Server tasks.

NOTE

The purpose of a -1 setting is to enable the ldif2db operation to benefit from free physical memory but, at the same time, not compete for valuable memory with entryCache, which is used for general operations of the Directory Server.
There are three caches in the context of Directory Server: dbCache, entryCache, and importCache. importCache is only used during the import operation. The nsslapd-cache-autosize attribute, which is used for autosizing entryCache and dbCache, is used during the Directory Server operations only and not during the ldif2db command-line operation; the attribute value is the percentage of free physical memory to be allocated for entryCache and dbCache.
If both the autosizing attributes, nsslapd-cache-autosize and nsslapd-import-cache-autosize, are enabled, ensure that their sum is less than 100.
Parameter Description
Entry DN cn=config, cn=ldbm database, cn=plugins, cn=config
Valid Range -1, 0 (turns import cache autosizing off) to 100
Default Value -1 (turns import cache autosizing on for ldif2db only and allocates 50% of the free physical memory to importCache)
Syntax Integer
Example nsslapd-import-cache-autosize: -1
This performance tuning-related attribute specifies the cache size in terms of the entries it can hold. However, it is simpler to limit by memory size only (as in Section 3.4.3.2, “nsslapd-cachememsize”). Attempting to set a value that is not a number or is too big for a 32-bit signed integer returns an LDAP_UNWILLING_TO_PERFORM error message with additional error information explaining the problem.
The server has to be restarted for changes to this attribute to go into effect.
Parameter Description
Entry DN cn=NetscapeRoot, cn=ldbm database, cn=plugins, cn=config or cn=UserRoot, cn=ldbm database, cn=plugins, cn=config
Valid Range 1 to 2,147,483,647 (or -1, which means limitless) entries
Default Value -1
Syntax Integer
Example nsslapd-cachesize: -1

For example, the index file for the aci attribute under o=UserRoot appears in the Directory Server as follows:
dn:cn=aci, cn=index, cn=UserRoot, cn=ldbm database, cn=plugins, cn=config
objectclass:top
objectclass:nsIndex
cn:aci
nssystemindex:true
nsindextype:pres

3.4.8. Database Attributes under cn=attributeName, cn=encrypted attributes, cn=database_name, cn=ldbm database, cn=plugins, cn=config

The nsAttributeEncryption object class allows selective encryption of attributes within a database. Extremely sensitive information such as credit card numbers and government identification numbers may not be protected enough by routine access control measures. Normally, these attribute values are stored in CLEAR within the database; encrypting them while they are stored adds another layer of protection. This object class has one attribute, nsEncryptionAlgorithm, which sets the encryption cipher used per attribute. Each encrypted attribute represents a subentry under the above cn=config information tree nodes, as shown in the following diagram:
Encrypted Attributes under the cn=config Node
Figure 3.3. Encrypted Attributes under the cn=config Node

For example, the database encryption file for the userPassword attribute under o=UserRoot appears in the Directory Server as follows:
dn:cn=userPassword, cn=encrypted attributes,o=UserRoot, cn=ldbm database,
cn=plugins, cn=config
objectclass:top
objectclass:nsAttributeEncryption
cn:userPassword
nsEncryptionAlgorithm:AES
To configure database encryption, see the "Database Encryption" section of the "Configuring Directory Databases" chapter in the Directory Server Administrator's Guide. For more information about indexes, refer to the "Managing Indexes" chapter in the Directory Server Administrator's Guide.

3.4.8.1. nsEncryptionAlgorithm

nsEncryptionAlgorithm selects the cipher used by nsAttributeEncryption. The algorithm can be set per encrypted attribute.
Parameter Description
Entry DN cn=attributeName, cn=encrypted attributes, cn=databaseName, cn=ldbm database, cn=plugins, cn=config
Valid Values The following are supported ciphers:
  • Advanced Encryption Standard Block Cipher (AES)
  • Triple Data Encryption Standard Block Cipher (3DES)
Default Value
Syntax DirectoryString
Example nsEncryptionAlgorithm: AES