Problem: MDB_MAP_FULL

Problem

You notice a message from OpenLDAP MDB_MAP_FULL and your see related entries in /var/log/syslog:
MDB_MAP_FULL: Environment mapsize limit reached

Or maybe you find something like this in the listener.log:
ldapError: Other (e.g., implementation specific) error: entry update failed
this also means the maxium databasesize is reached

In the listener.log you may see:
LISTENER ( ERROR ) : couldn't receive header
Could be an indication of the mdb size full, too.

Investigation

Check the usage percentage of the database to verify it is close to 100%:

$ for i in /var/lib/univention-ldap/ldap /var/lib/univention-ldap/translog  /var/lib/univention-directory-listener/cache; do 
used_pages=$(mdb_stat -e $i | sed -n 's/^ *Number of pages used: //p') 
max_pages=$(mdb_stat -e $i | sed -n 's/^ *Max pages: //p') 
free_pages=$(mdb_stat -ef $i | sed -n 's/^ *Free pages: //p')
python -c "print('In $i are %.1f percent used' % (((float($used_pages) - float($free_pages)) / $max_pages) * 100))"  
done

In /var/lib/univention-ldap/ldap are 0.4 percent used
In /var/lib/univention-ldap/translog are 0.2 percent used
In /var/lib/univention-directory-listener/cache are 99.5 percent used

From UCS 5.0-7 on also:

$ for i in /var/lib/univention-ldap/internal; do 
used_pages=$(mdb_stat -e $i | sed -n 's/^ *Number of pages used: //p') 
max_pages=$(mdb_stat -e $i | sed -n 's/^ *Max pages: //p') 
free_pages=$(mdb_stat -ef $i | sed -n 's/^ *Free pages: //p')
python -c "print('In $i are %.1f percent used' % (((float($used_pages) - float($free_pages)) / $max_pages) * 100))"  
done

In /var/lib/univention-ldap/internal are 0.0 percent used

Solution

Option 1

UCS uses three (four from 5.0-7 on) mdb databases. If it is a 64-bit system, the maximum size of the database can be increased. This should be done on all Master, Backup and Slave servers. The default value in UCS 4.x is 2147483648 bytes = 2 GB:

ucr set ldap/database/mdb/maxsize=3000000000
ucr set listener/cache/mdb/maxsize=3000000000
systemctl restart slapd
systemctl restart univention-directory-listener

Note:
Read the comments from man slapd-maxsize regarding this parameter. Setting it too high might increase memory usage.
Note:
The MDB database is not “enlarged” when the LDAP server is restarted but only at the next access (write).
If this also did not decrease e.g. the shown translog persentage and new changes do not apply, you may want to use Step 2 from the following article Problem: Prune transaction log

maxsize <bytes>
Specify the maximum size of the database in bytes. A memory map of this size is allocated at startup time and the database will not be allowed to grow beyond this size. The default is 10485760 bytes. This setting may be changed upward if the configured limit needs to be increased.

Option 2

With UCS 4.4-0e81 we introduced a new tool to reduce the translog database. So instead of increasing the size of the database you might purge old entries instead.
Please see this article for details:

/usr/share/univention-directory-notifier/univention-translog [-v] prune <TID>
Note: Old entries are usually not needed any more as the matching transction has already taken place a while ago. Usually it is safe to purge them.

Suchbegriffe:
ldapError: Other (e.g., implementation specific) error: entry update failed
MDB_MAP_FULL: Environment mapsize limit reached
LISTENER ( ERROR ) : couldn’t receive header

1 Like
Mastodon