S Y M S
The LDAP guys.
TMA
MDB: A Memory-Mapped Database and Backend for OpenLDAP Howard Chu - - PowerPoint PPT Presentation
TM S Y M A S The LDAP guys. MDB: A Memory-Mapped Database and Backend for OpenLDAP Howard Chu CTO, Symas Corp. hyc@symas.com Chief Architect, OpenLDAP hyc@openldap.org TM S Y M A S The LDAP guys. OpenLDAP Project Open source
S Y M S
The LDAP guys.
TMA
S Y M S
The LDAP guys.
TMA
S Y M S
The LDAP guys.
TMA
S Y M S
The LDAP guys.
TMA
S Y M S
The LDAP guys.
TMA
S Y M S
The LDAP guys.
TMA
S Y M S
The LDAP guys.
TMA
S Y M S
The LDAP guys.
TMA
S Y M S
The LDAP guys.
TMA
S Y M S
The LDAP guys.
TMA
S Y M S
The LDAP guys.
TMA
S Y M S
The LDAP guys.
TMA
S Y M S
The LDAP guys.
TMA
S Y M S
The LDAP guys.
TMA
S Y M S
The LDAP guys.
TMA
S Y M S
The LDAP guys.
TMA
– Write-ahead transaction logs are unnecessary
– Read accesses require no locks
S Y M S
The LDAP guys.
TMA
– Either the server must be heavily over-provisioned, or updates must be
stopped while pruning is done
S Y M S
The LDAP guys.
TMA
S Y M S
The LDAP guys.
TMA
S Y M S
The LDAP guys.
TMA
S Y M S
The LDAP guys.
TMA
Pgno Misc... Database Page Pgno Misc...
key, data Data Page Pgno Misc... Root Meta Page
S Y M S
The LDAP guys.
TMA
Pgno: 0 Misc... Root : EMPTY Meta Page Write-Ahead Log
S Y M S
The LDAP guys.
TMA
Pgno: 0 Misc... Root : EMPTY Meta Page Add 1,foo to page 1 Write-Ahead Log
S Y M S
The LDAP guys.
TMA
Pgno: 1 Misc...
1,foo Data Page Pgno: 0 Misc... Root : 1 Meta Page Add 1,foo to page 1 Write-Ahead Log
S Y M S
The LDAP guys.
TMA
Pgno: 1 Misc...
1,foo Data Page Pgno: 0 Misc... Root : 1 Meta Page Add 1,foo to page 1 Commit Write-Ahead Log
S Y M S
The LDAP guys.
TMA
Pgno: 1 Misc...
1,foo Data Page Pgno: 0 Misc... Root : 1 Meta Page Add 1,foo to page 1 Commit Add 2,bar to page 1 Write-Ahead Log
S Y M S
The LDAP guys.
TMA
Pgno: 1 Misc...
2,bar 1,foo Data Page Pgno: 0 Misc... Root : 1 Meta Page Add 1,foo to page 1 Commit Add 2,bar to page 1 Write-Ahead Log
S Y M S
The LDAP guys.
TMA
Pgno: 1 Misc...
2,bar 1,foo Data Page Pgno: 0 Misc... Root : 1 Meta Page Add 1,foo to page 1 Commit Add 2,bar to page 1 Commit Write-Ahead Log
S Y M S
The LDAP guys.
TMA
Pgno: 1 Misc...
2,bar 1,foo Data Page Pgno: 0 Misc... Root : 1 Meta Page Add 1,foo to page 1 Commit Add 2,bar to page 1 Commit Checkpoint Write-Ahead Log
Pgno: 1 Misc...
2,bar 1,foo Data Page Pgno: 0 Misc... Root : 1 Meta Page RAM Disk
S Y M S
The LDAP guys.
TMA
Pgno: 0 Misc... Root : EMPTY Meta Page
S Y M S
The LDAP guys.
TMA
Pgno: 1 Misc...
1,foo Data Page Pgno: 0 Misc... Root : EMPTY Meta Page
S Y M S
The LDAP guys.
TMA
Pgno: 1 Misc...
1,foo Data Page Pgno: 0 Misc... Root : EMPTY Meta Page Pgno: 2 Misc... Root : 1 Meta Page
S Y M S
The LDAP guys.
TMA
Pgno: 1 Misc...
1,foo Data Page Pgno: 0 Misc... Root : EMPTY Meta Page Pgno: 2 Misc... Root : 1 Meta Page Pgno: 3 Misc...
2,bar 1,foo Data Page
S Y M S
The LDAP guys.
TMA
Pgno: 1 Misc...
1,foo Data Page Pgno: 0 Misc... Root : EMPTY Meta Page Pgno: 2 Misc... Root : 1 Meta Page Pgno: 3 Misc...
2,bar 1,foo Data Page Pgno: 4 Misc... Root : 3 Meta Page
S Y M S
The LDAP guys.
TMA
Pgno: 1 Misc...
1,foo Data Page Pgno: 0 Misc... Root : EMPTY Meta Page Pgno: 2 Misc... Root : 1 Meta Page Pgno: 3 Misc...
2,bar 1,foo Data Page Pgno: 4 Misc... Root : 3 Meta Page Pgno: 5 Misc...
2,bar 1,blah Data Page
S Y M S
The LDAP guys.
TMA
Pgno: 1 Misc...
1,foo Data Page Pgno: 0 Misc... Root : EMPTY Meta Page Pgno: 2 Misc... Root : 1 Meta Page Pgno: 3 Misc...
2,bar 1,foo Data Page Pgno: 4 Misc... Root : 3 Meta Page Pgno: 5 Misc...
2,bar 1,blah Data Page Pgno: 6 Misc... Root : 5 Meta Page
S Y M S
The LDAP guys.
TMA
Pgno: 1 Misc...
1,foo Data Page Pgno: 0 Misc... Root : EMPTY Meta Page Pgno: 2 Misc... Root : 1 Meta Page Pgno: 3 Misc...
2,bar 1,foo Data Page Pgno: 4 Misc... Root : 3 Meta Page Pgno: 5 Misc...
2,bar 1,blah Data Page Pgno: 6 Misc... Root : 5 Meta Page Pgno: 7 Misc...
2,xyz 1,blah Data Page
S Y M S
The LDAP guys.
TMA
Pgno: 1 Misc...
1,foo Data Page Pgno: 0 Misc... Root : EMPTY Meta Page Pgno: 2 Misc... Root : 1 Meta Page Pgno: 3 Misc...
2,bar 1,foo Data Page Pgno: 4 Misc... Root : 3 Meta Page Pgno: 5 Misc...
2,bar 1,blah Data Page Pgno: 6 Misc... Root : 5 Meta Page Pgno: 7 Misc...
2,xyz 1,blah Data Page Pgno: 8 Misc... Root : 7 Meta Page
S Y M S
The LDAP guys.
TMA
Pgno: 0 Misc... TXN: 0 FRoot: EMPTY DRoot: EMPTY Meta Page
Pgno: 1 Misc... TXN: 0 FRoot: EMPTY DRoot: EMPTY Meta Page
S Y M S
The LDAP guys.
TMA
Pgno: 0 Misc... TXN: 0 FRoot: EMPTY DRoot: EMPTY Meta Page
Pgno: 1 Misc... TXN: 0 FRoot: EMPTY DRoot: EMPTY Meta Page Pgno: 2 Misc...
1,foo Data Page
S Y M S
The LDAP guys.
TMA
Pgno: 0 Misc... TXN: 0 FRoot: EMPTY DRoot: EMPTY Meta Page
Pgno: 1 Misc... TXN: 1 FRoot: EMPTY DRoot: 2 Meta Page Pgno: 2 Misc...
1,foo Data Page
S Y M S
The LDAP guys.
TMA
Pgno: 0 Misc... TXN: 0 FRoot: EMPTY DRoot: EMPTY Meta Page
Pgno: 1 Misc... TXN: 1 FRoot: EMPTY DRoot: 2 Meta Page Pgno: 2 Misc...
1,foo Data Page Pgno: 3 Misc...
2,bar 1,foo Data Page
S Y M S
The LDAP guys.
TMA
Pgno: 0 Misc... TXN: 0 FRoot: EMPTY DRoot: EMPTY Meta Page
Pgno: 1 Misc... TXN: 1 FRoot: EMPTY DRoot: 2 Meta Page Pgno: 2 Misc...
1,foo Data Page Pgno: 3 Misc...
2,bar 1,foo Data Page Pgno: 4 Misc...
txn 2,page 2 Data Page
S Y M S
The LDAP guys.
TMA
Pgno: 0 Misc... TXN: 2 FRoot: 4 DRoot: 3 Meta Page
Pgno: 1 Misc... TXN: 1 FRoot: EMPTY DRoot: 2 Meta Page Pgno: 2 Misc...
1,foo Data Page Pgno: 3 Misc...
2,bar 1,foo Data Page Pgno: 4 Misc...
txn 2,page 2 Data Page
S Y M S
The LDAP guys.
TMA
Pgno: 0 Misc... TXN: 2 FRoot: 4 DRoot: 3 Meta Page
Pgno: 1 Misc... TXN: 1 FRoot: EMPTY DRoot: 2 Meta Page Pgno: 2 Misc...
1,foo Data Page Pgno: 3 Misc...
2,bar 1,foo Data Page Pgno: 4 Misc...
txn 2,page 2 Data Page Pgno: 5 Misc...
2,bar 1,blah Data Page
S Y M S
The LDAP guys.
TMA
Pgno: 0 Misc... TXN: 2 FRoot: 4 DRoot: 3 Meta Page
Pgno: 1 Misc... TXN: 1 FRoot: EMPTY DRoot: 2 Meta Page Pgno: 2 Misc...
1,foo Data Page Pgno: 3 Misc...
2,bar 1,foo Data Page Pgno: 4 Misc...
txn 2,page 2 Data Page Pgno: 5 Misc...
2,bar 1,blah Data Page Pgno: 6 Misc...
txn 3,page 3,4 txn 2,page 2 Data Page
S Y M S
The LDAP guys.
TMA
Pgno: 0 Misc... TXN: 2 FRoot: 4 DRoot: 3 Meta Page
Pgno: 1 Misc... TXN: 3 FRoot: 6 DRoot: 5 Meta Page Pgno: 2 Misc...
1,foo Data Page Pgno: 3 Misc...
2,bar 1,foo Data Page Pgno: 4 Misc...
txn 2,page 2 Data Page Pgno: 5 Misc...
2,bar 1,blah Data Page Pgno: 6 Misc...
txn 3,page 3,4 txn 2,page 2 Data Page
S Y M S
The LDAP guys.
TMA
Pgno: 0 Misc... TXN: 2 FRoot: 4 DRoot: 3 Meta Page
Pgno: 1 Misc... TXN: 3 FRoot: 6 DRoot: 5 Meta Page Pgno: 2 Misc...
2,xyz 1,blah Data Page Pgno: 3 Misc...
2,bar 1,foo Data Page Pgno: 4 Misc...
txn 2,page 2 Data Page Pgno: 5 Misc...
2,bar 1,blah Data Page Pgno: 6 Misc...
txn 3,page 3,4 txn 2,page 2 Data Page
S Y M S
The LDAP guys.
TMA
Pgno: 0 Misc... TXN: 2 FRoot: 4 DRoot: 3 Meta Page
Pgno: 1 Misc... TXN: 3 FRoot: 6 DRoot: 5 Meta Page Pgno: 2 Misc...
2,xyz 1,blah Data Page Pgno: 3 Misc...
2,bar 1,foo Data Page Pgno: 4 Misc...
txn 2,page 2 Data Page Pgno: 5 Misc...
2,bar 1,blah Data Page Pgno: 6 Misc...
txn 3,page 3,4 txn 2,page 2 Data Page Pgno: 5 Misc...
2,bar 1,blah Data Page Pgno: 7 Misc...
txn 4,page 5,6 txn 3,page 3,4 Data Page
S Y M S
The LDAP guys.
TMA
Pgno: 0 Misc... TXN: 4 FRoot: 7 DRoot: 2 Meta Page
Pgno: 1 Misc... TXN: 3 FRoot: 6 DRoot: 5 Meta Page Pgno: 2 Misc...
2,xyz 1,blah Data Page Pgno: 3 Misc...
2,bar 1,foo Data Page Pgno: 4 Misc...
txn 2,page 2 Data Page Pgno: 5 Misc...
2,bar 1,blah Data Page Pgno: 6 Misc...
txn 3,page 3,4 txn 2,page 2 Data Page Pgno: 5 Misc...
2,bar 1,blah Data Page Pgno: 7 Misc...
txn 4,page 5,6 txn 3,page 3,4 Data Page
S Y M S
The LDAP guys.
TMA
S Y M S
The LDAP guys.
TMA
S Y M S
The LDAP guys.
TMA
S Y M S
The LDAP guys.
TMA
mdb multi mdb double mdb single hdb multi hdb double hdb single
00:00:00 00:14:24 00:28:48 00:43:12 00:57:36 01:12:00 01:26:24 01:40:48 01:55:12 00:29:47 00:24:16 00:27:05 00:52:50 00:45:59 00:50:08
Time to slapadd -q 5 million entries
real user sys
Time HH:MM:SS
S Y M S
The LDAP guys.
TMA
slapd size DB size
5 10 15 20 25 30 26 15.6 6.7 9
Process and DB sizes
hdb mdb
GB
S Y M S
The LDAP guys.
TMA
– Higher page fill factor, less wasted space – slapd process size down to only ~25% of back-hdb size
S Y M S
The LDAP guys.
TMA
1st 2nd 2 4 8 16
00:00.00 00:43.20 01:26.40 02:09.60 02:52.80 03:36.00 04:19.20 05:02.40 04:15.40 00:16.20 00:24.62 00:32.17 01:04.82 03:04.46 00:12.47 00:09.94 00:10.39 00:10.87 00:10.81 00:11.82
Initial / Concurrent Search Times
hdb mdb
S Y M S
The LDAP guys.
TMA
Searches/sec
20000 40000 60000 80000 100000 120000 140000
SLAMD Search Rate Comparison
hdb mdb
S Y M S
The LDAP guys.
TMA
Modifies/sec
5000 10000 15000 20000 25000
SLAMD Modify Rate Results
hdb mdb
S Y M S
The LDAP guys.
TMA
Searches/sec Modifies/sec
10000 20000 30000 40000 50000 60000 70000 80000 90000 100000
SLAMD Search with Modify
hdb mdb
S Y M S
The LDAP guys.
TMA
– no periodic cleanup / maintenance required – no particular tuning required
– code size and complexity drastically reduced
– read performance is significantly increased
S Y M S
The LDAP guys.
TMA
– A port to SQLite 3.7.1 is available on gitorious – Replacements for BerkeleyDB in Cyrus-SASL, Heimdal, and
– There are probably many other suitable applications for a
S Y M S
The LDAP guys.
TMA