Questo contenuto non è disponibile nella lingua selezionata.

Chapter 4. Tuning the number of BDB locks


When a Directory Server instance uses Berkeley Database (BDB), lock mechanism controls 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 the ns-slapd Directory Server process, another import, or export operations from running.

If the server runs out of available locks, Directory Server logs the following error in the /var/log/dirsrv/slapd-instance_name/errors file:

libdb: Lock table is out of available locks

However, the Directory Server default settings try to prevent the server from running out of locks to avoid data corruption. For details, see Avoiding data corruption by monitoring free database locks

4.1. Avoiding data corruption by monitoring free BDB database locks

Running out of Berkeley Database (BDB) locks can lead to data corruption. To avoid this, Directory Server, by default, monitors the remaining number of free locks every 500 milliseconds and, if the number of active database locks is equal or higher than the 90%, Directory Server stops all searches.

The following procedure changes the interval to 600 milliseconds and the threshold to 85 percent.

Note

If you set a too high interval, the server can run out of locks before the next monitoring check happens. Setting a too short interval can slow down the server.

Prerequisites

  • The Directory Server instance uses BDB.

Procedure

  1. Set the interval and threshold:

    # dsconf instance_name backend config set --locks-monitoring-enabled on --locks-monitoring-pause 600 --locks-monitoring-threshold 85
  2. Restart the instance:

    # dsctl instance_name restart

Verification

  • Display the locks monitoring settings:

    # dsconf -D "cn=Directory Manager" ldap://supplier.example.com backend config get | grep "nsslapd-db-locks-monitoring"
    nsslapd-db-locks-monitoring-enabled: on
    nsslapd-db-locks-monitoring-threshold: 85
    nsslapd-db-locks-monitoring-pause: 600

4.2. Manually monitoring the number of BDB locks

Directory Server tracks the current number of Berkeley Database (BDB) locks in the nsslapd-db-current-locks and nsslapd-db-max-locks attributes in cn=database,cn=monitor,cn=ldbm database,cn=plugins,cn=config.

Prerequisites

  • The Directory Server instance uses BDB.

Procedure

  • To display the number of locks, enter:

    # ldapsearch -D "cn=Directory Manager" -W -H ldap://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
    ...
    nsslapd-db-current-locks: 37
    nsslapd-db-max-locks: 39

4.3. Setting the number of BDB locks using the command line

Use the dsconf backend config set command to update the number of Berkeley Database (BDB) locks that Directory Server can use.

Prerequisites

  • The Directory Server instance uses BDB.

Procedure

  1. Set the number of locks:

    # dsconf instance_name backend config set --locks=20000

    The command sets the number of locks to 20000.

  2. Restart the instance:

    # dsctl instance_name restart

Verification

  • Display the value of the nsslapd-db-locks parameter:

    # dsconf instance_name backend config get | grep "nsslapd-db-locks:"
    nsslapd-db-locks: 20000

4.4. Setting the number of BDB locks using the web console

You can set the number of Berkeley Database (BDB) locks that Directory Server uses in the global database configuration in the web console.

Prerequisites

  • You are logged in to the instance in the web console.
  • The Directory Server instance uses BDB.

The following procedure sets the number of locks to 2000.

Procedure

  1. Navigate to Database Global Database Configuration Database Locks.
  2. Update the Database Locks field to 2000.
  3. Click Save Config.
  4. Click Actions Restart Instance.

Verification

  • Verify that the new value is present in Database Global Database Configuration Database Locks.
Red Hat logoGithubredditYoutubeTwitter

Formazione

Prova, acquista e vendi

Community

Informazioni sulla documentazione di Red Hat

Aiutiamo gli utenti Red Hat a innovarsi e raggiungere i propri obiettivi con i nostri prodotti e servizi grazie a contenuti di cui possono fidarsi. Esplora i nostri ultimi aggiornamenti.

Rendiamo l’open source più inclusivo

Red Hat si impegna a sostituire il linguaggio problematico nel codice, nella documentazione e nelle proprietà web. Per maggiori dettagli, visita il Blog di Red Hat.

Informazioni su Red Hat

Forniamo soluzioni consolidate che rendono più semplice per le aziende lavorare su piattaforme e ambienti diversi, dal datacenter centrale all'edge della rete.

Theme

© 2026 Red Hat
Torna in cima