[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openldap-technical
Subject:    Re: How to properly monitor MDB usage
From:       Howard Chu <hyc () symas ! com>
Date:       2024-05-07 15:55:50
Message-ID: 9dfc4c6a-cbea-433b-a854-b13d1fd0f4f4 () symas ! com
[Download RAW message or body]

Clément OUDOT wrote:
> 
> Le 07/05/2024 à 17:07, Benjamin Renard a écrit  :
> > Hi,
> > 
> > I'm looking for the right method to monitor the usage of an MDB database according to the \
> > limit of its size imposed via the parameter olcDbMaxSize. Currently, I am using the \
> > following command: 
> > # mdb_stat -e /var/lib/ldap/accesslog/
> > Environment Info
> > Map address: (nil)
> > Map size: 4294967296
> > Page size: 4096
> > Max pages: 1048576
> > Number of pages used: 1048572
> > Last transaction ID: 24153425
> > Max readers: 126
> > Number of readers used: 18
> > Status of Main DB
> > Tree depth: 1
> > Branch pages: 0
> > Leaf pages: 1
> > Overflow pages: 0
> > Entries: 6
> > 
> > Here, I determine the percentage of database usage with the information "Number of pages \
> > used" and "Max pages". 
> > This seemed to be a good method, but I noticed that after a significant purge of objects in \
> > the directory, the number of used pages does not seem to decrease.

You also need to account for the freelist. Use `mdb_stat -ef`.
> > 
> > Is there another and/or better method to monitor this? Failing that, is there a solution to \
> > release "falsely" used pages, ideally without too much downtime of the service (so not a \
> > dump/restore)? I read that it was possible to use the "mdb_copy -c" command, but I am a \
> > little concerned about the duration on a database with approximately 1,000,000 entries.

There is no reason to release free pages. They will get reused again anyway.

> Hello Benjamin,
> 
> if it helps, we have created a monitoring script for this: \
> https://ltb-project.org/documentation/check_lmdb_usage.html 


-- 
  -- Howard Chu
  CTO, Symas Corp.           http://www.symas.com
  Director, Highland Sun     http://highlandsun.com/hyc/
  Chief Architect, OpenLDAP  http://www.openldap.org/project/


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic