Este conteúdo não está disponível no idioma selecionado.

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
Copy to Clipboard Toggle word wrap

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
    Copy to Clipboard Toggle word wrap
  2. Restart the instance:

    # dsctl instance_name restart
    Copy to Clipboard Toggle word wrap

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
    Copy to Clipboard Toggle word wrap

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
    Copy to Clipboard Toggle word wrap

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
    Copy to Clipboard Toggle word wrap

    The command sets the number of locks to 20000.

  2. Restart the instance:

    # dsctl instance_name restart
    Copy to Clipboard Toggle word wrap

Verification

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

    # dsconf instance_name backend config get | grep "nsslapd-db-locks:"
    nsslapd-db-locks: 20000
    Copy to Clipboard Toggle word wrap

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.
Voltar ao topo
Red Hat logoGithubredditYoutubeTwitter

Aprender

Experimente, compre e venda

Comunidades

Sobre a documentação da Red Hat

Ajudamos os usuários da Red Hat a inovar e atingir seus objetivos com nossos produtos e serviços com conteúdo em que podem confiar. Explore nossas atualizações recentes.

Tornando o open source mais inclusivo

A Red Hat está comprometida em substituir a linguagem problemática em nosso código, documentação e propriedades da web. Para mais detalhes veja o Blog da Red Hat.

Sobre a Red Hat

Fornecemos soluções robustas que facilitam o trabalho das empresas em plataformas e ambientes, desde o data center principal até a borda da rede.

Theme

© 2025 Red Hat