1SLAPD-MDB(5)                  File Formats Manual                 SLAPD-MDB(5)
2
3
4

NAME

6       slapd-mdb - Memory-Mapped DB backend to slapd
7

SYNOPSIS

9       /etc/openldap/slapd.conf
10

DESCRIPTION

12       The  mdb backend to slapd(8) uses OpenLDAP's Lightning Memory-Mapped DB
13       (LMDB) library to store data.  It relies completely on  the  underlying
14       operating  system for memory management and does no caching of its own.
15       It is the recommended primary database backend.
16
17       The mdb backend is similar to the hdb backend in that it uses a hierar‐
18       chical  database layout which supports subtree renames. It is both more
19       space-efficient and more  execution-efficient  than  the  bdb  backend,
20       while being overall much simpler to manage.
21

CONFIGURATION

23       These  slapd.conf  options apply to the mdb backend database.  That is,
24       they must follow a "database mdb" line and come before  any  subsequent
25       "backend" or "database" lines.  Other database options are described in
26       the slapd.conf(5) manual page.
27
28       checkpoint <kbyte> <min>
29              Specify the frequency for flushing the  database  disk  buffers.
30              This setting is only needed if the dbnosync option is used.  The
31              checkpoint will occur if either <kbyte> data has been written or
32              <min> minutes have passed since the last checkpoint.  Both argu‐
33              ments default to zero, in which case they are ignored. When  the
34              <min>  argument  is  non-zero,  an  internal task will run every
35              <min> minutes to perform the checkpoint.   Note:  currently  the
36              <kbyte> setting is unimplemented.
37
38       dbnosync
39              Specify that on-disk database contents should not be immediately
40              synchronized with in memory changes.  Enabling this  option  may
41              improve performance at the expense of data security. In particu‐
42              lar, if the operating system crashes before changes are flushed,
43              some  number  of  transactions  may be lost.  By default, a full
44              data flush/sync is performed when each transaction is committed.
45
46       directory <directory>
47              Specify the directory where the LMDB files containing this data‐
48              base  and associated indexes live.  A separate directory must be
49              specified for each database.  The default is /var/openldap-data.
50
51       envflags {nosync,nometasync,writemap,mapasync,nordahead}
52              Specify flags for finer-grained control of  the  LMDB  library's
53              operation.
54
55              nosync This is exactly the same as the dbnosync directive.
56
57              nometasync
58                     Flush the data on a commit, but skip the sync of the meta
59                     page. This mode is slightly  faster  than  doing  a  full
60                     sync,  but can potentially lose the last committed trans‐
61                     action if the operating system crashes. If  both  nometa‐
62                     sync  and  nosync  are  set, the nosync flag takes prece‐
63                     dence.
64
65              writemap
66                     Use a writable memory map instead of just read-only. This
67                     speeds up write operations but makes the database vulner‐
68                     able to corruption in case any bugs in slapd cause  stray
69                     writes into the mmap region.
70
71              mapasync
72                     When  using  a writable memory map and performing flushes
73                     on each commit, use an asynchronous flush  instead  of  a
74                     synchronous  flush  (the default). This option has no ef‐
75                     fect if writemap has not been set. It also has no  effect
76                     if nosync is set.
77
78              nordahead
79                     Turn  off  file readahead. Usually the OS performs reada‐
80                     head on every read request. This usually boosts read per‐
81                     formance but can be harmful to random access read perfor‐
82                     mance if the system's memory is full and the DB is larger
83                     than RAM. This option is not implemented on Windows.
84
85
86       index {<attrlist>|default} [pres,eq,approx,sub,<special>]
87              Specify the indexes to maintain for the given attribute (or list
88              of attributes).  Some attributes only support a  subset  of  in‐
89              dexes.   If  only  an <attr> is given, the indices specified for
90              default are maintained.  Note that setting a  default  does  not
91              imply  that  all attributes will be indexed. Also, for best per‐
92              formance, an eq index should always be configured  for  the  ob‐
93              jectClass attribute.
94
95              A  number of special index parameters may be specified.  The in‐
96              dex type sub can be decomposed into subinitial, subany, and sub‐
97              final indices.  The special type nolang may be specified to dis‐
98              allow use of this index by language subtypes.  The special  type
99              nosubtypes  may  be  specified  to disallow use of this index by
100              named subtypes.  Note: changing index settings in  slapd.conf(5)
101              requires  rebuilding  indices,  see slapindex(8); changing index
102              settings dynamically by LDAPModifying "cn=config"  automatically
103              causes rebuilding of the indices online in a background task.
104
105       maxreaders <integer>
106              Specify  the  maximum number of threads that may have concurrent
107              read access to the database. Tools such as slapcat  count  as  a
108              single  thread,  in addition to threads in any active slapd pro‐
109              cesses. The default is 126.
110
111       maxsize <bytes>
112              Specify the maximum size of the database in bytes. A memory  map
113              of  this size is allocated at startup time and the database will
114              not be allowed to grow beyond this size. The default is 10485760
115              bytes.  This  setting  may  be  changed upward if the configured
116              limit needs to be increased.
117
118              Note: It is important to set this to as large a value as  possi‐
119              ble,  (relative  to  anticipated  growth of the actual data over
120              time) since growing the size later may not be practical when the
121              system is under heavy load.
122
123       mode <integer>
124              Specify  the  file  protection  mode that newly created database
125              files should have.  The default is 0600.
126
127       rtxnsize <entries>
128              Specify the maximum number of entries to  process  in  a  single
129              read  transaction when executing a large search. Long-lived read
130              transactions prevent old database pages  from  being  reused  in
131              write  transactions,  and so can cause significant growth of the
132              database file when there is heavy write  traffic.  This  setting
133              causes the read transaction in large searches to be released and
134              reacquired after the given number of entries has been  read,  to
135              give  writers the opportunity to reclaim old database pages. The
136              default is 10000.
137
138       searchstack <depth>
139              Specify the depth of the stack used for  search  filter  evalua‐
140              tion.   Search  filters  are evaluated on a stack to accommodate
141              nested AND / OR clauses. An individual stack is assigned to each
142              server  thread.  The depth of the stack determines how complex a
143              filter can be evaluated without requiring any additional  memory
144              allocation. Filters that are nested deeper than the search stack
145              depth will cause a separate stack to be allocated for that  par‐
146              ticular  search  operation.  These  allocations can have a major
147              negative impact on server performance, but specifying  too  much
148              stack  will  also  consume  a great deal of memory.  Each search
149              stack uses 512K bytes per level. The default stack depth is  16,
150              thus 8MB per thread is used.
151

ACCESS CONTROL

153       The  mdb  backend  honors  access  control  semantics  as  indicated in
154       slapd.access(5).
155

FILES

157       /etc/openldap/slapd.conf
158              default slapd configuration file
159

SEE ALSO

161       slapd.conf(5),  slapd-config(5),  slapd(8),   slapadd(8),   slapcat(8),
162       slapindex(8), OpenLDAP LMDB documentation.
163

ACKNOWLEDGEMENTS

165       OpenLDAP  Software  is developed and maintained by The OpenLDAP Project
166       <http://www.openldap.org/>.  OpenLDAP Software is derived from the Uni‐
167       versity of Michigan LDAP 3.3 Release.  Written by Howard Chu.
168
169
170
171OpenLDAP                          2021/06/03                      SLAPD-MDB(5)
Impressum