1 .lf 1 stdin 2 .TH SLAPD-BDB 5 "2020/04/28" "OpenLDAP 2.4.50" 3 .\" Copyright 1998-2020 The OpenLDAP Foundation All Rights Reserved. 4 .\" Copying restrictions apply. See COPYRIGHT/LICENSE. 5 .\" $OpenLDAP$ 6 .SH NAME 7 slapd\-bdb, slapd\-hdb \- Berkeley DB backends to slapd 8 .SH SYNOPSIS 9 .B /etc/openldap/slapd.conf 10 .SH DESCRIPTION 11 The \fBbdb\fP backend to 12 .BR slapd (8) 13 uses the Oracle Berkeley DB (BDB) package to store data. 14 It makes extensive use of indexing and caching to speed data access. 15 .LP 16 Note that BDB is deprecated and support will be dropped in future 17 OpenLDAP releases. Installations should use the \fBmdb\fP 18 backend instead. 19 .LP 20 \fBhdb\fP is a variant of 21 the \fBbdb\fP backend that uses a hierarchical database layout which 22 supports subtree renames. It is both more space-efficient and more 23 execution-efficient than the \fBbdb\fP backend. It is otherwise identical 24 to the \fBbdb\fP behavior, and all the same configuration options apply. 25 .LP 26 It is noted that these options are intended to complement 27 Berkeley DB configuration options set in the environment's 28 .B DB_CONFIG 29 file. See Berkeley DB documentation for details on 30 .B DB_CONFIG 31 configuration options. 32 Where there is overlap, settings in 33 .B DB_CONFIG 34 take precedence. 35 .SH CONFIGURATION 36 These 37 .B slapd.conf 38 options apply to the \fBbdb\fP and \fBhdb\fP backend database. 39 That is, they must follow a "database bdb" or "database hdb" line and 40 come before any subsequent "backend" or "database" lines. 41 Other database options are described in the 42 .BR slapd.conf (5) 43 manual page. 44 .TP 45 .BI cachesize \ <integer> 46 Specify the size in entries of the in-memory entry cache maintained 47 by the \fBbdb\fP or \fBhdb\fP backend database instance. 48 The default is 1000 entries. 49 .TP 50 .BI cachefree \ <integer> 51 Specify the number of entries to free from the entry cache when the 52 cache reaches the \fBcachesize\fP limit. 53 The default is 1 entry. 54 .TP 55 .BI checkpoint \ <kbyte>\ <min> 56 Specify the frequency for checkpointing the database transaction log. 57 A checkpoint operation flushes the database buffers to disk and writes 58 a checkpoint record in the log. 59 The checkpoint will occur if either \fI<kbyte>\fP data has been written or 60 \fI<min>\fP minutes have passed since the last checkpoint. 61 Both arguments default to zero, in which case they are ignored. When 62 the \fI<min>\fP argument is non-zero, an internal task will run every 63 \fI<min>\fP minutes to perform the checkpoint. 64 See the Berkeley DB reference guide for more details. 65 .TP 66 .B checksum 67 Enable checksum validation of DB pages whenever they are read from disk. 68 This setting can only be configured before any database files are created. 69 .TP 70 .BI cryptfile \ <file> 71 Specify the pathname of a file containing an encryption key to use for 72 encrypting the database. Encryption is performed using Berkeley DB's 73 implementation of AES. Note that encryption can only be configured before 74 any database files are created, and changing the key can only be done 75 after destroying the current database and recreating it. Encryption is 76 not enabled by default, and some distributions of Berkeley DB do not 77 support encryption. 78 .TP 79 .BI cryptkey \ <key> 80 Specify an encryption key to use for encrypting the database. This option 81 may be used when a separate 82 .I cryptfile 83 is not desired. Only one of 84 .B cryptkey 85 or 86 .B cryptfile 87 may be configured. 88 .TP 89 .BI dbconfig \ <Berkeley-DB-setting> 90 Specify a configuration directive to be placed in the 91 .B DB_CONFIG 92 file of the database directory. The 93 .B dbconfig 94 directive is just a convenience 95 to allow all necessary configuration to be set in the 96 .B slapd.conf 97 file. 98 The options set using this directive will only be written to the 99 .B DB_CONFIG 100 file if no such file existed at server startup time, otherwise 101 they are completely ignored. This allows one 102 to set initial values without overwriting/destroying a 103 .B DB_CONFIG 104 file that was already customized through other means. 105 This directive may be specified multiple times, as needed. 106 For example: 107 .RS 108 .nf 109 dbconfig set_cachesize 0 1048576 0 110 dbconfig set_lg_bsize 2097152 111 .fi 112 .RE 113 .TP 114 .B dbnosync 115 Specify that on-disk database contents should not be immediately 116 synchronized with in memory changes. 117 Enabling this option may improve performance at the expense of data 118 security. 119 See the Berkeley DB reference guide for more details. 120 .TP 121 \fBdbpagesize \fR \fI<dbfile> <size>\fR 122 Specify the page size to use for a particular database file, in units 123 of 1024 bytes. The default for the 124 .B id2entry 125 file is 16, the default for all other files depends on the size of the 126 underlying filesystem's block size (typically 4 or 8). 127 The maximum that BerkeleyDB supports is 64. This 128 setting usually should not need to be changed, but if BerkeleyDB's 129 "db_stat \-d" shows a large amount of overflow pages in use in a file, 130 setting a larger size may increase performance at the expense of 131 data integrity. This setting only takes effect when a database is 132 being newly created. See the Berkeley DB reference guide for more details. 133 .TP 134 .BI directory \ <directory> 135 Specify the directory where the BDB files containing this database and 136 associated indexes live. 137 A separate directory must be specified for each database. 138 The default is 139 .BR /var/openldap/openldap\-data . 140 .TP 141 .B dirtyread 142 Allow reads of modified but not yet committed data. 143 Usually transactions are isolated to prevent other operations from 144 accessing uncommitted data. 145 This option may improve performance, but may also return inconsistent 146 results if the data comes from a transaction that is later aborted. 147 In this case, the modified data is discarded and a subsequent search 148 will return a different result. 149 .TP 150 .BI dncachesize \ <integer> 151 Specify the maximum number of DNs in the in-memory DN cache. 152 Ideally this cache should be 153 large enough to contain the DNs of every entry in the database. If 154 set to a smaller value than the \fBcachesize\fP it will be silently 155 increased to equal the \fBcachesize\fP. The default value is 0 which 156 means unlimited, i.e. the DN cache will grow without bound. 157 158 It should be noted that the \fBDN cache\fP is allowed to temporarily 159 grow beyond the configured size. It does this if many entries are 160 locked when it tries to do a purge, because that means they're 161 legitimately in use. Also, the \fBDN cache\fP never purges entries 162 that have cached children, so depending on the shape of the DIT, it 163 could have lots of cached DNs over the defined limit. 164 .TP 165 .BI idlcachesize \ <integer> 166 Specify the size of the in-memory index cache, in index slots. The 167 default is zero. A larger value will speed up frequent searches of 168 indexed entries. An \fBhdb\fP database needs a large \fBidlcachesize\fP 169 for good search performance, typically three times the 170 .B cachesize 171 (entry cache size) 172 or larger. 173 .TP 174 \fBindex \fR{\fI<attrlist>\fR|\fBdefault\fR} [\fBpres\fR,\fBeq\fR,\fBapprox\fR,\fBsub\fR,\fI<special>\fR] 175 Specify the indexes to maintain for the given attribute (or 176 list of attributes). 177 Some attributes only support a subset of indexes. 178 If only an \fI<attr>\fP is given, the indices specified for \fBdefault\fR 179 are maintained. 180 Note that setting a default does not imply that all attributes will be 181 indexed. Also, for best performance, an 182 .B eq 183 index should always be configured for the 184 .B objectClass 185 attribute. 186 187 A number of special index parameters may be specified. 188 The index type 189 .B sub 190 can be decomposed into 191 .BR subinitial , 192 .BR subany ,\ and 193 .B subfinal 194 indices. 195 The special type 196 .B nolang 197 may be specified to disallow use of this index by language subtypes. 198 The special type 199 .B nosubtypes 200 may be specified to disallow use of this index by named subtypes. 201 Note: changing \fBindex\fP settings in 202 .BR slapd.conf (5) 203 requires rebuilding indices, see 204 .BR slapindex (8); 205 changing \fBindex\fP settings 206 dynamically by LDAPModifying "cn=config" automatically causes rebuilding 207 of the indices online in a background task. 208 .TP 209 .B linearindex 210 Tell 211 .B slapindex 212 to index one attribute at a time. By default, all indexed 213 attributes in an entry are processed at the same time. With this option, 214 each indexed attribute is processed individually, using multiple passes 215 through the entire database. This option improves 216 .B slapindex 217 performance 218 when the database size exceeds the \fBdbcache\fP size. When the \fBdbcache\fP is 219 large enough, this option is not needed and will decrease performance. 220 Also by default, 221 .B slapadd 222 performs full indexing and so a separate 223 .B slapindex 224 run is not needed. With this option, 225 .B slapadd 226 does no indexing and 227 .B slapindex 228 must be used. 229 .TP 230 .BR lockdetect \ { oldest | youngest | fewest | random | default } 231 Specify which transaction to abort when a deadlock is detected. 232 The default is 233 .BR random . 234 .TP 235 .BI mode \ <integer> 236 Specify the file protection mode that newly created database 237 index files should have. 238 The default is 0600. 239 .TP 240 .BI searchstack \ <depth> 241 Specify the depth of the stack used for search filter evaluation. 242 Search filters are evaluated on a stack to accommodate nested AND / OR 243 clauses. An individual stack is assigned to each server thread. 244 The depth of the stack determines how complex a filter can be 245 evaluated without requiring any additional memory allocation. Filters that 246 are nested deeper than the search stack depth will cause a separate 247 stack to be allocated for that particular search operation. These 248 allocations can have a major negative impact on server performance, 249 but specifying too much stack will also consume a great deal of memory. 250 Each search stack uses 512K bytes per level. The default stack depth 251 is 16, thus 8MB per thread is used. 252 .TP 253 .BI shm_key \ <integer> 254 Specify a key for a shared memory BDB environment. By default the 255 BDB environment uses memory mapped files. If a non-zero value is 256 specified, it will be used as the key to identify a shared memory 257 region that will house the environment. 258 .SH ACCESS CONTROL 259 The 260 .B bdb 261 and 262 .B hdb 263 backends honor access control semantics as indicated in 264 .BR slapd.access (5). 265 .SH FILES 266 .TP 267 .B /etc/openldap/slapd.conf 268 default 269 .B slapd 270 configuration file 271 .TP 272 .B DB_CONFIG 273 Berkeley DB configuration file 274 .SH SEE ALSO 275 .BR slapd.conf (5), 276 .BR slapd\-config (5), 277 .BR slapd\-mdb (5), 278 .BR slapd (8), 279 .BR slapadd (8), 280 .BR slapcat (8), 281 .BR slapindex (8), 282 Berkeley DB documentation. 283 .SH ACKNOWLEDGEMENTS 284 .lf 1 ./../Project 285 .\" Shared Project Acknowledgement Text 286 .B "OpenLDAP Software" 287 is developed and maintained by The OpenLDAP Project <http://www.openldap.org/>. 288 .B "OpenLDAP Software" 289 is derived from the University of Michigan LDAP 3.3 Release. 290 .lf 284 stdin 291 Originally begun by Kurt Zeilenga. Caching mechanisms originally designed 292 by Jong-Hyuk Choi. Completion and subsequent work, as well as 293 back-hdb, by Howard Chu. 294