HI!
Using back-mdb there's one thing which could cause trouble: One has to configure olcDbMaxSize which cannot be changed later.
So when monitoring OpenLDAP with back-mdb it would be interesting to see how much space of configured olcDbMaxSize is already occupied.
Does it make sense to compare the real file size shown by du -h /path/to/data.mdb to configured olcDbMaxSize?
Ciao, Michael.
Hi,
On Thu, 19 Dec 2013, Michael Ströder wrote:
HI!
Using back-mdb there's one thing which could cause trouble: One has to configure olcDbMaxSize which cannot be changed later.
So when monitoring OpenLDAP with back-mdb it would be interesting to see how much space of configured olcDbMaxSize is already occupied.
Does it make sense to compare the real file size shown by du -h /path/to/data.mdb to configured olcDbMaxSize?
something like mdb_stat:
[ldaptest1]# mdb_stat -e /var/lib/ldap Environment Info Map address: (nil) Map size: 1073741824 Page size: 4096 Max pages: 262144 Number of pages used: 2604 Last transaction ID: 125386 Max readers: 126 Number of readers used: 9 Status of Main DB Tree depth: 1 Branch pages: 0 Leaf pages: 1 Overflow pages: 0 Entries: 17 [ldaptest1]#
Although I am not 100% sure what would be the best values to monitor.
Propably Number of pages used and max pages.
Greetings Christian
On Thu, 19 Dec 2013 17:15:31 +0100 (CET) Christian Kratzer ck-lists@cksoft.de wrote
On Thu, 19 Dec 2013, Michael Ströder wrote:
Using back-mdb there's one thing which could cause trouble: One has to configure olcDbMaxSize which cannot be changed later.
So when monitoring OpenLDAP with back-mdb it would be interesting to see how much space of configured olcDbMaxSize is already occupied.
Does it make sense to compare the real file size shown by du -h /path/to/data.mdb to configured olcDbMaxSize?
something like mdb_stat:
[ldaptest1]# mdb_stat -e /var/lib/ldap Environment Info Map address: (nil) Map size: 1073741824 Page size: 4096 Max pages: 262144 Number of pages used: 2604 Last transaction ID: 125386 Max readers: 126 Number of readers used: 9 Status of Main DB Tree depth: 1 Branch pages: 0 Leaf pages: 1 Overflow pages: 0 Entries: 17 [ldaptest1]#
Although I am not 100% sure what would be the best values to monitor.
Propably Number of pages used and max pages.
Hmm, I'd prefer to use pure Python and avoid calling external command-line programs.
How about plain file status information like described here? After all I'm just interested in a percentage of the used space.
http://stackoverflow.com/questions/3211999/sparse-file-usage-in-python
There's a hard-coded block-size of 512 bytes used therein which seems to match output of command "du -h" on my system. Not sure about other systems though.
Ciao, Michael.
On 2013-12-19 16:46, Michael Ströder wrote:
So when monitoring OpenLDAP with back-mdb it would be interesting to see how much space of configured olcDbMaxSize is already occupied.
Does it make sense to compare the real file size shown by du -h /path/to/data.mdb to configured olcDbMaxSize?
That would depend on the filesystem supporting holes in files, which sounds OS- and filesystem-dependent.
The fill ratio is (MDB_envinfo.me_last_pgno + 1.0) * MDB_stat.ms_psize / MDB_envinfo.me_mapsize from mdb_env_info() and mdb_env_stat(). Inconvenient formula though. Oh well.
On Thu, 19 Dec 2013 17:28:27 +0100 Hallvard Breien Furuseth h.b.furuseth@usit.uio.no wrote
On 2013-12-19 16:46, Michael Ströder wrote:
So when monitoring OpenLDAP with back-mdb it would be interesting to see how much space of configured olcDbMaxSize is already occupied.
Does it make sense to compare the real file size shown by du -h /path/to/data.mdb to configured olcDbMaxSize?
That would depend on the filesystem supporting holes in files, which sounds OS- and filesystem-dependent.
Currently I'm only interested in ext4 on Linux.
The fill ratio is (MDB_envinfo.me_last_pgno + 1.0) * MDB_stat.ms_psize / MDB_envinfo.me_mapsize from mdb_env_info() and mdb_env_stat(). Inconvenient formula though. Oh well.
Would be good to have this in cn=monitor:
http://www.openldap.org/its/?findid=7770
Ciao, Michael.
--On Thursday, December 19, 2013 4:46 PM +0100 Michael Ströder michael@stroeder.com wrote:
HI!
Using back-mdb there's one thing which could cause trouble: One has to configure olcDbMaxSize which cannot be changed later.
I change olcDbMaxSize all the time without issue. So this doesn't seem a particularly valid concern to me. In fact I have a script that monitors the max size configured in cn=config, compares it to the current size, and also checks the total amount of free disk space. If the actual size gets too close to the max size, and there is room, it will, if configured to do so, increase the max size by a configured percentage.
--Quanah
--
Quanah Gibson-Mount Architect - Server Zimbra, Inc. -------------------- Zimbra :: the leader in open source messaging and collaboration
openldap-technical@openldap.org