Chapter 3. Tuning the Number of Locks

Lock mechanisms in Directory Server control how many copies of Directory Server processes can run at the same time. For example, during an import job, Directory Server sets a lock in the /run/lock/dirsrv/slapd-instance_name/imports/ directory to prevent ns-slapd (Directory Server), ldif2db (another import), or db2ldif (export) operations from running.
If the server runs out of available locks, the following error is logged in the /var/log/dirsrv/slapd-instance_name/errors file:
libdb: Lock table is out of available locks

Monitoring the Current and Maximum Number of Locks

To monitor the current and maximum number of locks:
# ldapsearch -D "cn=Directory Manager" -W -p 389 -h server.example.com -x
     -s sub -b "cn=database,cn=monitor,cn=ldbm database,cn=plugins,cn=config"
     nsslapd-db-current-locks nsslapd-db-max-locks
For details about the monitoring attributes, see the descriptions in the Directory Server Configuration, Command, and File Reference.

Setting the Number of Locks

If error messages indicate that the lock table is out of available locks, double the value set in the nsslapd-db-locks parameter in the cn=config,cn=ldbm database,cn=plugins,cn=config entry. If the problem persists, double the value again.
For example, to set the parameter to 20000:
# ldapmodify -D "cn=Directory Manager" -W -p 389 -h server.example.com -x

dn: cn=config
changetype: modify
replace: nsslapd-db-locks
nsslapd-db-locks: 20000
For details about nsslapd-db-locks, see the parameter's description in the Directory Server Configuration, Command, and File Reference.