Difference between revisions of "OpenLDAP MDB vs HDB performance"

 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{ZC}}{{Article Infobox|{{admin}}|{{ZCS 8.0}}|||}}=Zimbra OpenLDAP Server=
+
{{BC|Certified}}
 +
__FORCETOC__
 +
<div class="col-md-12 ibox-content">
 +
=OpenLDAP MDB vs HDB performance=
 +
{{KB|{{ZC}}|{{ZCS 8.0}}||}}
 +
{{WIP}}
 +
=Zimbra OpenLDAP Server=
 
== Performance differences between the mdb and hdb backends for OpenLDAP ==
 
== Performance differences between the mdb and hdb backends for OpenLDAP ==
Using real-world client data, I've compiled some brief performance differences between using the mdb and hdb backends to OpenLDAP with Zimbra.  This particular client has 25,208 entries in their LDAP database.  I dumped their accesslog and converted it to LDIF to give me a full weeks worth of real change data, and then ran that back against the database.  This results in approximately 28,000 modifications performed against the DB.
+
Using real-world client data, I've compiled some brief performance differences between using the mdb and hdb backends to OpenLDAP with Zimbra.  This particular client has 25,208 entries in their LDAP database.  I dumped their accesslog and converted it to LDIF to give me a full weeks worth of real change data, and then ran that back against the database.  This results in approximately 28,000 modifications performed against the DB.  Tests were done using OpenLDAP 2.4.34.
  
 
=== Database configuration information ===
 
=== Database configuration information ===
Line 29: Line 35:
  
 
Advantage: MDB.  It is 2.11 times smaller than the hdb database.
 
Advantage: MDB.  It is 2.11 times smaller than the hdb database.
 
=== Search time ===
 
This is the time to search the entire db via ldapsearch.  Note that with hdb, since it has to preload the cache, two times are given.  cold (Cache not loaded) and hot (cache loaded).  mdb never needs to preload the cache.
 
mdb: 0m1.435s
 
hdb cold: 0m5.304s
 
hdb hot: 0m3.103s
 
hdb-shm cold: 0m5.220s
 
hdb-shm hot: 0m1.472s
 
 
Advantage MDB.  It is 1.03 times faster than hdb on the hot hdb search when hdb uses SHM keys.  Note that hdb performance degrades as the number of concurrent searches increases, while mdb performance is static.
 
  
 
=== Write performance ===
 
=== Write performance ===
Line 53: Line 49:
 
  mdb: 0m20.628s
 
  mdb: 0m20.628s
 
  hdb: 25m46.477s
 
  hdb: 25m46.477s
 +
hdb-shm: 24m39.658s
  
Advantage: MDB. It is 74.97 times faster than hdb at performing 28,000 modifications.
+
Advantage: MDB. It is 71.73 times faster than hdb at performing 28,000 modifications.
  
 
==== Master node accesslog DB sizes ====
 
==== Master node accesslog DB sizes ====
 
  mdb: 100M
 
  mdb: 100M
 
  hdb: 234M
 
  hdb: 234M
 +
hdb-shm: 234MB
  
 
Advantage: MDB. It is 2.34 times smaller than the hdb accesslog DB.
 
Advantage: MDB. It is 2.34 times smaller than the hdb accesslog DB.
 +
 +
=== Read Performance ===
 +
* Read performance is examined on my blog: [http://mishikal.wordpress.com/2013/05/16/openldap-a-comparison-of-back-mdb-and-back-hdb-performance/ MDB vs HDB performance]
  
 
{{Article_Footer|ZCS 8.0|2/21/2013}}
 
{{Article_Footer|ZCS 8.0|2/21/2013}}

Latest revision as of 00:33, 11 July 2015

OpenLDAP MDB vs HDB performance

   KB 20393        Last updated on 2015-07-11  




0.00
(0 votes)

Zimbra OpenLDAP Server

Performance differences between the mdb and hdb backends for OpenLDAP

Using real-world client data, I've compiled some brief performance differences between using the mdb and hdb backends to OpenLDAP with Zimbra. This particular client has 25,208 entries in their LDAP database. I dumped their accesslog and converted it to LDIF to give me a full weeks worth of real change data, and then ran that back against the database. This results in approximately 28,000 modifications performed against the DB. Tests were done using OpenLDAP 2.4.34.

Database configuration information

The following documents the pertinent configuration information for MDB and HDB.

MDB configuration

For MDB, the following database flags were set:

writemap
nometasync

HDB configuration

For both single node and master node tests, hdb had a 1GB cache defined via DB_CONFIG. This was more than sufficient for the DB in all tests. Two sets of tests were done, one with a shared memory key for BDB, and one without. The back-hdb database was configured to fully cache all entries (cachesize, idlcachesize settings for cn=config).

Database load

This is the amount of time to load the database using slapadd -q

mdb: 0m11.237s
hdb: 0m38.727s
hdb-shm: 0m26.677s

Advantage: MDB. It is at least 2.37 times faster loading the data than hdb.

Database size

Size of database on disk after slapadd completes. For hdb, this includes the hdb cache as well as db size. mdb has no cache.

mdb: 296MB
hdb: 627MB
hdb-shm: 627MB

Advantage: MDB. It is 2.11 times smaller than the hdb database.

Write performance

The following write performance was done with the 28,000 modification LDIF described above. It was done two ways -- Single node (no replication setup) and Master node (accesslog delta-sync database enabled). Time to do all 28,000 modifications is tracked. In the master node scenario, the size of the resulting accesslog DB is also compared.

Single node

mdb: 0m14.013s
hdb: 13m3.394s
hdb-shm: 12m4.885s

Advantage: MDB. It is 51.73 times faster than hdb at performing 28,000 modifications.

Master node

mdb: 0m20.628s
hdb: 25m46.477s
hdb-shm: 24m39.658s

Advantage: MDB. It is 71.73 times faster than hdb at performing 28,000 modifications.

Master node accesslog DB sizes

mdb: 100M
hdb: 234M
hdb-shm: 234MB

Advantage: MDB. It is 2.34 times smaller than the hdb accesslog DB.

Read Performance

Verified Against: ZCS 8.0 Date Created: 2/21/2013
Article ID: https://wiki.zimbra.com/index.php?title=OpenLDAP_MDB_vs_HDB_performance Date Modified: 2015-07-11



Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »

Jump to: navigation, search