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
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 Copiar o linkLink copiado para a área de transferência!
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.
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
Set the interval and threshold:
dsconf instance_name backend config set --locks-monitoring-enabled on --locks-monitoring-pause 600 --locks-monitoring-threshold 85
# dsconf instance_name backend config set --locks-monitoring-enabled on --locks-monitoring-pause 600 --locks-monitoring-threshold 85
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Restart the instance:
dsctl instance_name restart
# dsctl instance_name restart
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Display the locks monitoring settings:
dsconf -D "cn=Directory Manager" ldap://supplier.example.com backend config get | grep "nsslapd-db-locks-monitoring"
# 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 Copied! Toggle word wrap Toggle overflow
4.2. Manually monitoring the number of BDB locks Copiar o linkLink copiado para a área de transferência!
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
# 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 Copied! Toggle word wrap Toggle overflow
4.3. Setting the number of BDB locks using the command line Copiar o linkLink copiado para a área de transferência!
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
Set the number of locks:
dsconf instance_name backend config set --locks=20000
# dsconf instance_name backend config set --locks=20000
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The command sets the number of locks to
20000
.Restart the instance:
dsctl instance_name restart
# dsctl instance_name restart
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Display the value of the
nsslapd-db-locks
parameter:dsconf instance_name backend config get | grep "nsslapd-db-locks:"
# dsconf instance_name backend config get | grep "nsslapd-db-locks:" nsslapd-db-locks: 20000
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
4.4. Setting the number of BDB locks using the web console Copiar o linkLink copiado para a área de transferência!
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
-
Navigate to
. -
Update the Database Locks field to
2000
. - Click .
-
Click
.
Verification
-
Verify that the new value is present in
.