]> git.sur5r.net Git - openldap/blob - doc/man/man5/slapd-mdb.5
Merge remote-tracking branch 'origin/mdb.master'
[openldap] / doc / man / man5 / slapd-mdb.5
1 .TH SLAPD-MDB 5 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" Copyright 2011-2013 The OpenLDAP Foundation All Rights Reserved.
3 .\" Copying restrictions apply.  See COPYRIGHT/LICENSE.
4 .\" $OpenLDAP$
5 .SH NAME
6 slapd\-mdb \- Memory-Mapped DB backend to slapd
7 .SH SYNOPSIS
8 .B ETCDIR/slapd.conf
9 .SH DESCRIPTION
10 The \fBmdb\fP backend to
11 .BR slapd (8)
12 uses OpenLDAP's Lightning Memory-Mapped DB (LMDB) library to store data.
13 It relies completely on the underlying operating system for memory
14 management and does no caching of its own.
15 .LP
16 The \fBmdb\fP backend is similar to the \fBhdb\fP backend in that
17 it uses a hierarchical database layout which
18 supports subtree renames. It is both more space-efficient and more
19 execution-efficient than the \fBbdb\fP backend, while being overall
20 much simpler to manage.
21 .SH CONFIGURATION
22 These
23 .B slapd.conf
24 options apply to the \fBmdb\fP backend database.
25 That is, they must follow a "database mdb" line and
26 come before any subsequent "backend" or "database" lines.
27 Other database options are described in the
28 .BR slapd.conf (5)
29 manual page.
30 .TP
31 .BI checkpoint \ <kbyte>\ <min>
32 Specify the frequency for flushing the database disk buffers.
33 This setting is only needed if the \fBdbnosync\fP option is used.
34 The checkpoint will occur if either \fI<kbyte>\fP data has been written or
35 \fI<min>\fP minutes have passed since the last checkpoint.
36 Both arguments default to zero, in which case they are ignored. When
37 the \fI<min>\fP argument is non-zero, an internal task will run every 
38 \fI<min>\fP minutes to perform the checkpoint.
39 Note: currently the \fI<kbyte>\fP setting is unimplemented.
40 .TP
41 .B dbnosync
42 Specify that on-disk database contents should not be immediately
43 synchronized with in memory changes.
44 Enabling this option may improve performance at the expense of data
45 security. In particular, if the operating system crashes before changes are
46 flushed, some number of transactions may be lost.
47 By default, a full data flush/sync is performed when each
48 transaction is committed.
49 .TP
50 .BI directory \ <directory>
51 Specify the directory where the LMDB files containing this database and
52 associated indexes live.
53 A separate directory must be specified for each database.
54 The default is
55 .BR LOCALSTATEDIR/openldap\-data .
56 .TP
57 \fBenvflags \fR{\fBnosync\fR,\fBnometasync\fR,\fBwritemap\fR,\fBmapasync\fR,\fBnordahead\fR}
58 Specify flags for finer-grained control of the LMDB library's operation.
59 .RS
60 .TP
61 .B nosync
62 This is exactly the same as the
63 .I dbnosync
64 directive.
65 .RE
66 .RS
67 .TP
68 .B nometasync
69 Flush the data on a commit, but skip the sync of the meta page. This mode is
70 slightly faster than doing a full sync, but can potentially lose the last
71 committed transaction if the operating system crashes. If both
72 .I nometasync
73 and
74 .I nosync
75 are set, the
76 .I nosync
77 flag takes precedence.
78 .RE
79 .RS
80 .TP
81 .B writemap
82 Use a writable memory map instead of just read-only. This speeds up write operations
83 but makes the database vulnerable to corruption in case any bugs in slapd
84 cause stray writes into the mmap region.
85 .RE
86 .RS
87 .TP
88 .B mapasync
89 When using a writable memory map and performing flushes on each commit, use an
90 asynchronous flush instead of a synchronous flush (the default). This option
91 has no effect if
92 .I writemap
93 has not been set. It also has no effect if
94 .I nosync
95 is set.
96 .RE
97 .RS
98 .TP
99 .B nordahead
100 Turn off file readahead. Usually the OS performs readahead on every read
101 request. This usually boosts read performance but can be harmful to
102 random access read performance if the system's memory is full and the DB
103 is larger than RAM. This option is not implemented on Windows.
104 .RE
105
106 .TP
107 \fBindex \fR{\fI<attrlist>\fR|\fBdefault\fR} [\fBpres\fR,\fBeq\fR,\fBapprox\fR,\fBsub\fR,\fI<special>\fR]
108 Specify the indexes to maintain for the given attribute (or
109 list of attributes).
110 Some attributes only support a subset of indexes.
111 If only an \fI<attr>\fP is given, the indices specified for \fBdefault\fR
112 are maintained.
113 Note that setting a default does not imply that all attributes will be
114 indexed. Also, for best performance, an
115 .B eq
116 index should always be configured for the
117 .B objectClass
118 attribute.
119
120 A number of special index parameters may be specified.
121 The index type
122 .B sub
123 can be decomposed into
124 .BR subinitial ,
125 .BR subany ,\ and
126 .B subfinal
127 indices.
128 The special type
129 .B nolang
130 may be specified to disallow use of this index by language subtypes.
131 The special type
132 .B nosubtypes
133 may be specified to disallow use of this index by named subtypes.
134 Note: changing \fBindex\fP settings in 
135 .BR slapd.conf (5)
136 requires rebuilding indices, see
137 .BR slapindex (8);
138 changing \fBindex\fP settings
139 dynamically by LDAPModifying "cn=config" automatically causes rebuilding
140 of the indices online in a background task.
141 .TP
142 .BI maxreaders \ <integer>
143 Specify the maximum number of threads that may have concurrent read access
144 to the database. Tools such as slapcat count as a single thread,
145 in addition to threads in any active slapd processes. The
146 default is 126.
147 .TP
148 .BI maxsize \ <bytes>
149 Specify the maximum size of the database in bytes. A memory map of this
150 size is allocated at startup time and the database will not be allowed
151 to grow beyond this size. The default is 10485760 bytes. This setting
152 may be changed upward if the configured limit needs to be increased.
153
154 Note: It is important to set this to as large a value as possible,
155 (relative to anticipated growth of the actual data over time) since
156 growing the size later may not be practical when the system is under
157 heavy load.
158 .TP
159 .BI mode \ <integer>
160 Specify the file protection mode that newly created database 
161 files should have.
162 The default is 0600.
163 .TP
164 .BI searchstack \ <depth>
165 Specify the depth of the stack used for search filter evaluation.
166 Search filters are evaluated on a stack to accommodate nested AND / OR
167 clauses. An individual stack is assigned to each server thread.
168 The depth of the stack determines how complex a filter can be
169 evaluated without requiring any additional memory allocation. Filters that
170 are nested deeper than the search stack depth will cause a separate
171 stack to be allocated for that particular search operation. These
172 allocations can have a major negative impact on server performance,
173 but specifying too much stack will also consume a great deal of memory.
174 Each search stack uses 512K bytes per level. The default stack depth
175 is 16, thus 8MB per thread is used.
176 .SH ACCESS CONTROL
177 The 
178 .B mdb
179 backend honors access control semantics as indicated in
180 .BR slapd.access (5).
181 .SH NOTES
182 This is an early release; the database file format or other
183 characteristics may change incompatibly in future releases.
184 .SH FILES
185 .TP
186 .B ETCDIR/slapd.conf
187 default 
188 .B slapd 
189 configuration file
190 .SH SEE ALSO
191 .BR slapd.conf (5),
192 .BR slapd\-config (5),
193 .BR slapd (8),
194 .BR slapadd (8),
195 .BR slapcat (8),
196 .BR slapindex (8),
197 OpenLDAP LMDB documentation.
198 .SH ACKNOWLEDGEMENTS
199 .so ../Project
200 Written by Howard Chu.