389ds / 389-ds-base

The enterprise-class Open Source LDAP server for Linux
https://www.port389.org/
Other
213 stars 94 forks source link

CLI reports inconsistent value for nsslapd-mdb-max-readers #6293

Open jchapma opened 3 months ago

jchapma commented 3 months ago

Issue Description When LMDB specific attributes are requested using the CLI, nsslapd-max-readers is 0, but dbscan reports the default of 126.

Package Version and Platform:

Steps to Reproduce 1.Run dbscan on an LDMB DB

sudo dbscan -L /var/lib/dirsrv/slapd-inst01/db | grep size
MDB environment created with maxsize=21474836480.
MDB environment created with max readers=126.
MDB environment created with max database instances=512.
 GLOBAL STATS: pages max=5242880 alloced=84 used=54 size=4096```
  1. Use CLI to request LMDB DB attributes
    sudo dsconf ldapi://%2fvar%2frun%2fslapd-inst01.socket backend config get  | grep mdb
    nsslapd-backend-implement: mdb
    nsslapd-mdb-max-size: 21474836480
    nsslapd-mdb-max-readers: 0
    nsslapd-mdb-max-dbs: 512
  2. Notice the difference in the value of nsslapd-mdb-max-readers

Expected results Values should be the same

progier389 commented 3 months ago

The assumption that the configuration value (reported by the CLI) and the real value provided to lmdb layer should be the same is wrong.

Because a configuration value of 0 means that the server compute the real value from others config parameters.

That said readers=126 seems a bit strange (it is liblmdb default value). I tried with setting nsslapd-threadnumber: 200 ans I also see 126 So there is a bug in the way the default value is computed.