]> git.sur5r.net Git - openldap/blob - doc/guide/admin/tuning.sdf
Minor adjustments to paths due to reorganization
[openldap] / doc / guide / admin / tuning.sdf
1 # Copyright 1999, The OpenLDAP Foundation, All Rights Reserved.
2 # COPYING RESTRICTIONS APPLY, see COPYRIGHT.
3
4 H1: Performance Tuning
5
6 There are several things you can do to tune the performance of
7 slapd for your system. Most of them have to do with the LDBM
8 backend. LDBM uses an index mechanism to store and retrieve
9 information in slapd. Each entry is assigned a unique ID, used to
10 refer to the entry in the indexes. A search for entries with a
11 surname of "Jensen", for example, would look up the index entry
12 "=JENSEN" in the surname index. The data returned is a list of
13 IDs of entries having that value for the surname attribute. We
14 have found several things to be useful in improving the
15 performance of this indexing scheme, especially on modify
16 operations.
17
18
19
20 H2: The allIDs threshold
21
22 Some index entries become so large as to be useless. For
23 example, if every entry in your database is a person entry, the
24 "=PERSON" index entry in the objectclass index contains every
25 entry. This returns very little useful information, and can cause
26 significant delays, especially on updates. To alleviate this
27 problem, we have introduced the idea of an allIDs index entry.
28
29 The allIDs entry stands for a real index entry containing the IDs
30 of every entry in the database, but it takes up very little space,
31 never needs updating, and can be manipulated quickly and
32 efficiently. The trade-off is that it does not prune the set of
33 candidate entries at all during a search. This must be done
34 using other, more "high-powered" index entries.
35
36 You can set the minimum number of IDs that an index entry may
37 contain before it turns into an allIDs block by changing the
38 {{EX: SLAPD_LDBM_MIN_MAXIDS}} variable in the
39 {{EX: include/ldapconfig.h}} file. The actual number is determined at
40 runtime by the LDBM backend, depending on the block size of
41 the underlying device (i.e., the number you provide is rounded up
42 to the nearest multiple of a block size).
43
44
45
46 H2: The entry cache
47
48 The LDBM backend can be configured to keep a cache of
49 entries in memory. Since the LDBM database spends much of its
50 time reading entries from the id2entry file into memory, this cache
51 can greatly speed performance. The trade-off is that the cache
52 uses some extra memory. The default cache size is 1000
53 entries. See the discussion of the cachesize option in Section
54 5.2.3 on LDBM configuration.
55
56
57
58 H2: The DB cache
59
60 The LDBM backend uses a number of disk-based index files. If
61 the underlying hash or B-tree package supports in-memory
62 caching of these files, performance can be greatly improved,
63 especially on modifies. The size of this in-memory file cache is
64 given by the dbcachesize option, discussed in more detail in
65 section 5.2.3 on LDBM configuration. The default {{EX: dbcachesize}} is
66 100K.
67
68
69
70 H2: Maintain the right indices
71
72 Finally, one of the best performance tune-ups you can do is to
73 make sure you are maintaining the right indices. Too few indices
74 can lead to poor search performance. Too many indices can
75 lead to poor update performance. For example, the LDBM
76 backend would be perfectly happy to maintain substring and
77 approximate indices for the {{EX: objectclass attribute}}, but this would
78 not be useful and would just slow down update operations. If
79 your database has many entries and is handling queries for
80 substring equality on the surname attribute, you should make
81 sure to maintain a surname substring index so these queries are
82 answered quickly.
83
84 So, take a look at the index lines in your slapd configuration file to
85 ensure that only those indices that make sense and are needed
86 are being maintained.
87
88 PB:
89