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

(ITS#6298) ldapsearch hangs after ldapadd

Full_Name: Tihomir Culjaga
Version: 2.4.18
OS: CentOS 5.3
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (


i have an issue with ldapsearch. I have a ldif file that i use to recreate the
database using slapadd.

When this is done, i perform a ldapsearch of an entire tree (~ 100k entries) and
this is done in an acceptable time 40 - 60 seconds.

After that, i add some more entries (4 of them to be precise) using ldapadd and
perform the same whole-tree search. The search works (ldapsearch returning
entries) until it reaches the last entry present in the initial ldif file. It
hangs here for a while (1 - 10 minutes) and after that returns the remaining 4
entries i've previously added using ldapadd.

When doing the 1st ldapsearch, slapd process takes about 30% of total memory.
Later, when performing the search again, and when it hangs, slapd process takes
97% of the total system memory. The increased meory usage is noticed when the
hang apairs. During this time i see the CPU usage reaching 90% as well.

When it finishes, i try to stop & start ldap and i get "FAILED" on stop!

/etc/init.d/ldap stop
Stopping slapd:                                    [FAILED]

sudo /etc/init.d/ldap start
Checking configuration files for slapd:  bdb_db_open: database "dc=ot,dc=hr":
unclean shutdown detected; attempting recovery.
bdb_db_open: database "dc=ot,dc=hr": recovery skipped in read-only mode. Run
manual recovery if errors are encountered.
bdb_monitor_db_open: monitoring disabled; configure monitor database to enable
config file testing succeeded
                                                           [  OK  ]
Starting slapd:                                            [  OK  ]
[root@l01lnp1 ~]# 

My enviorment is:

/usr/local/sbin/slapd -V
   @(#) $OpenLDAP: slapd 2.4.18 (Sep 17 2009 10:00:09) $

With Backend BDB

db_stat -V
   Berkeley DB 4.7.25: (May 15, 2008) <= patched with all 4 patches from oracle

uname -a
   Linux l01lnp1 2.6.18-128.el5 #1 SMP Wed Jan 21 10:41:14 EST 2009 x86_64
x86_64 x86_64 GNU/Linux

cat /etc/issue
   CentOS release 5.3 (Final)
   Kernel \r on an \m

The machine HW
   CPU:          2 x Xeon at 3.0 GHz (bogomips: 6000.22) - dualcore
   RAM:          10 GB 
   HDD:          60 GB SCSI

my slapd.conf

   threads        4
   sizelimit      unlimited
   timelimit      3600
   database       bdb
   cachesize      7000000
   dncachesize    0
   idlcachesize   21000000
   cachefree      10000


   set_cachesize      5 0 1
   set_lg_regionmax   262144
   set_lg_bsize       2097152

my custom schema


my ldif file used to recreate the DB


my ldif file used to load remaining 4 entries


commands to recreate the DB from ldif file

   slapadd -f /usr/local/etc/openldap/slapd.conf -l /home/tculjaga/all.ldif

commands to add entries with ldapadd

   ldapadd -h localhost -x -D cn=admin,dc=ot,dc=hr -w passwd -f
/home/tculjaga/test.ldif -c

commands to perform whole-tree ldapsearch

   ldapsearch  -h localhost -x -b
ou=bestMatchPrefixList,ou=sipDirektor,dc=ot,dc=hr -D cn=admin,dc=ot,dc=hr -w

DB information

3437278 entries

du -c -h /var/lib/ldap/*.bdb
  204K	/var/lib/ldap/bestMatchPrefix.bdb
  982M	/var/lib/ldap/dn2id.bdb
  2.4G	/var/lib/ldap/id2entry.bdb
  1.9M	/var/lib/ldap/objectClass.bdb
  1.3M	/var/lib/ldap/originatorPrefixID.bdb
  48M	/var/lib/ldap/uniqueID.bdb
  3.4G	total

I have strace logs when i perormed th esearch


please let me know how can i transfer you the logs and config files.