[Date Prev][Date Next] [Chronological] [Thread] [Top]

Index for objectclass does not work...



Hello again,

I can't solve my problem on my own... please help.
As I can see at the moment, the Index for objectclass is not used.

The searchtime with and without index for objectclass is the same!
The search looks like:

ldapsearch -x -h localhost -wpassword  -D"uid=admin,ou=root"
-b"cn=ownPath,ou=root" "(ObjectClass=subEngine)"

The first serach, it takes about 40seconds. So after the cache is filled, the
next searches takes only about 2 seconds (during both logging is turned off!)...
It doesn't matter whether the index is set up in the config or not.

To check, that the index is really set up (or not), I set loglevel 64
ind the slapd.conf:
#######################################################################
@(#) $OpenLDAP: slapd 2.4.23 $#012#011opensuse-buildservice@opensuse.org
line 30 (rootpw ***)
line 31 (directory#011/var/lib/ldap_hdb)
line 32 (logfile#011#011/var/log/openldap.log)
line 33 (cachesize 1000000)
line 34 (dncachesize 1000000)
line 34 (idlcachesize 3000000)
line 36 (dbnosync)
line 38 (index objectClass eq)
index objectClass 0x0004
line 39 (index cn eq,sub)
index cn 0x0714
hdb_monitor_db_open: monitoring disabled; configure monitor database to enable
slapd starting
#######################################################################




The searched  objectClass=subEngine exists 104384 times in the entire directory:
(=> ldapsearch -x -h localhost -D"uid=admin,ou=root" -b"cn=ou=root>"
"(ObjectClass=subEngine)" dn | grep "^dn:" | wc -l)

If I configure with index for Objectclass, I get for the search
following messages:
#######################################################################
=> bdb_equality_candidates (objectClass)
=> key_read
<= bdb_index_read 470601 candidates
<= bdb_equality_candidates: id=-1, first=228, last=470828
<= bdb_filter_candidates: id=-1 first=228 last=470828
<= bdb_list_candidates: id=-1 first=228 last=470828
<= bdb_filter_candidates: id=-1 first=228 last=470828
<= bdb_list_candidates: id=-1 first=40595 last=470828
<= bdb_filter_candidates: id=-1 first=40595 last=470828
bdb_search_candidates: id=-1 first=40595 last=470828
#######################################################################

If I search then in the logfile, I see 430233 messages like:
"hdb_search: <candidate> <message: does not match filter | scope not
okay>"



If I configure without index for objectclass, I get for the search
following messages:
#######################################################################
 => bdb_equality_candidates (objectClass)
 <= bdb_equality_candidates: (objectClass) not indexed
 <= bdb_filter_candidates: id=-1 first=1 last=470828
 <= bdb_list_candidates: id=-1 first=1 last=470828
 <= bdb_filter_candidates: id=-1 first=1 last=470828
 <= bdb_list_candidates: id=-1 first=40595 last=470828
 <= bdb_filter_candidates: id=-1 first=40595 last=470828
 bdb_search_candidates: id=-1 first=40595 last=470828
#######################################################################




During initial set up of the  Database (slapadd, copied from
production, off-line with slapcat), the index for objectclass was
build. I also tried to
rebuild the index with slapindex.


I configured a 64bit system, with 16GByte RAM and 2 CPUs
under VMware ESX with own SAS-Storage (RAID10) for only this Machine.


The entire directory holds 470812 entires.
(=> ldapsearch -x -h localhost -wpassword -D"uid=admin,ou=root"
-b"ou=root" "(objectClass=*)" dn | grep "^dn:" | wc -l)



I configured slapd.conf as following:
#######################################################################
include         /etc/openldap/schema/core.schema
include         /etc/openldap/schema/cosine.schema
include         /etc/openldap/schema/inetorgperson.schema
include         /etc/openldap/schema/rfc2307bis.schema
include         /etc/openldap/schema/own.schema

pidfile         /var/run/slapd/slapd.pid
argsfile        /var/run/slapd/slapd.args

modulepath      /usr/lib/ldap
moduleload      back_hdb

sizelimit               -1
timelimit               300
disallow bind_anon

gentlehup on
tool-threads 2

# hdb database definitions

database        hdb
suffix          "ou=root"
rootdn          "uid=admin,ou=root"
checkpoint  4096 15
# loglevel only for test, not during time measuring
loglevel       33
# or for config file processing
# loglevel       64
rootpw   password
directory       /var/lib/ldap_hdb
logfile         /var/log/openldap.log
cachesize 1000000
dncachesize 1000000
idlcachesize 3000000
dbnosync

index objectClass,entryUUID,entryCSN     eq
index cn eq,sub
#######################################################################


In DB_CONF I set 2GB BDB page cache (set_cachesize 2 0 1)


Thanks for help,

kindly regards Steeg


PS: During the first search, the disk is heavy used (iotop) by writing
from slapd.conf ... why it - should only read ...?
-