Does the server have access to a nameserver?
I've seen dns timeouts cause this kind of thing.

On 1/04/2015 12:09 AM, Saša-Stjepan Bakša wrote:
Hi,

Year ago we have tested openldap with back_mdb and it was fantastic. Search worked as a charm. Database was filled with 20 mil. users and serach returned some 20 k results per sec (my colegue did the test).

Now we need that setup for some tests and we encountered very slow response - 1 search for user data with some aliased data need 8 to 20 seconds to be retrieved.

ldapsearch  -h 10.14.252.104 -p 389 -D cn=admin,dc=spr -w test -s sub -a always -b num=1234563123,dc=num,dc=SPR ObjectClass=*

num=1234563123,dc=num,dc=SPR is alias to uid
aliasedObjectName: uid=1234563123,ds=USERS,o=STANDARD,dc=spr


We build our openldap from git source. We have tried new as older versions as well and no change is seen.

Hardware: SuperMicro, 2xQuad core, 32 GB RAM, RAID 10 storage.
HP blade 2xQuad core, 64 GB RAM sorage 2 disks in mirror.
Results are the same and not depending on hardware.

Openldap ver:

root@centdevel openldap# git log
commit 68d9aa207f51b4d1ef29bb9876e7da8c7eaf0eee
Author: Quanah Gibson-Mount <quanah@openldap.org>
Date:   Tue Apr 8 21:16:52 2014 -0500

    ITS#7430, ITS#6359

OS is Centos 6.4 (also tryed on Centos 6.6)numx

mdb config part is:

[root@spr2 cn=config]# cat olcDatabase\=\{1\}mdb.ldif
# AUTO-GENERATED FILE - DO NOT EDIT!! Use ldapmodify.
# CRC32 2c245069
dn: olcDatabase={1}mdb
objectClass: olcDatabaseConfig
objectClass: olcMdbConfig
olcDatabase: {1}mdb
olcDbDirectory: /opt/openldap/var/openldap-data
olcSuffix: dc=spr
olcAccess: {0}to attrs=userPassword,shadowLastChange by self write by anonymou
 s auth by dn="cn=admin,dc=spr" write by * none
olcAccess: {1}to attrs=shadowLastChange by self write by * read
olcAccess: {2}to dn.base="" by * read
olcAccess: {3}to * by self write by dn="cn=admin,dc=spr" write by * read
olcLastMod: TRUE
olcRootDN: cn=admin,dc=spr
olcRootPW:: xyzdgsdsadeew
olcDbCheckpoint: 4096 10
olcDbNoSync: TRUE
olcDbIndex: objectClass eq
olcDbIndex: uid eq
olcDbIndex: num eq
olcDbIndex: numx eq
olcDbIndex: Username eq
olcDbIndex: entryCSN eq
olcDbIndex: entryUUID eq
olcDbIndex: contextCSN eq
olcDbMaxSize: 16106127360
structuralObjectClass: olcMdbConfig
entryUUID: 21ac150c-6b30-1034-9009-81396a683c5e
creatorsName: cn=admin,cn=config
createTimestamp: 20150330135513Z
entryCSN: 20150330135513.544218Z#000000#000#000000
modifiersName: cn=admin,cn=config
modifyTimestamp: 20150330135513Z


MDB database stat:

[root@spr2 openldap]# /opt/openldap/sbin/mdb_stat /opt/openldap/var/openldap-data/ -e -rr -a
Environment Info
  Map address: (nil)
  Map size: 16106127360
  Page size: 4096
  Max pages: 3932160
  Number of pages used: 1523336
  Last transaction ID: 16058165
  Max readers: 126
  Number of readers used: 0
Reader Table Status
(no active readers)
  0 stale readers cleared.
(no active readers)
Status of Main DB
  Tree depth: 1
  Branch pages: 0
  Leaf pages: 1
  Overflow pages: 0
  Entries: 11
Status of ad2i
  Tree depth: 1
  Branch pages: 0
  Leaf pages: 1
  Overflow pages: 0
  Entries: 38
Status of contextCSN
  Tree depth: 0
  Branch pages: 0
  Leaf pages: 0
  Overflow pages: 0
  Entries: 0
Status of dn2i
  Tree depth: 4
  Branch pages: 2937
  Leaf pages: 333338
  Overflow pages: 0
  Entries: 16000069
Status of entryCSN
  Tree depth: 3
  Branch pages: 3
  Leaf pages: 307
  Overflow pages: 0
  Entries: 8000034
Status of entryUUID
  Tree depth: 3
  Branch pages: 259
  Leaf pages: 62932
  Overflow pages: 0
  Entries: 8000034
Status of id2e
  Tree depth: 4
  Branch pages: 4446
  Leaf pages: 1000005
  Overflow pages: 0
  Entries: 8000034
Status of numx
  Tree depth: 3
  Branch pages: 128
  Leaf pages: 22295
  Overflow pages: 0
  Entries: 2000004
Status of num
  Tree depth: 3
  Branch pages: 129
  Leaf pages: 22325
  Overflow pages: 0
  Entries: 2000004
Status of objectClass
  Tree depth: 1
  Branch pages: 0
  Leaf pages: 1
  Overflow pages: 0
  Entries: 29
Status of Username
  Tree depth: 0
  Branch pages: 0
  Leaf pages: 0
  Overflow pages: 0
  Entries: 0
Status of uid
  Tree depth: 3
  Branch pages: 34
  Leaf pages: 7883
  Overflow pages: 0
  Entries: 1000004

Build config:
make clean
./configure --enable-hdb=no \
            --enable-bdb=no \
            --enable-monitor=yes \
            --prefix=/opt/openldap \
            --enable-local=yes \
            --enable-accesslog=yes \
            --enable-syncprov=yes \
            --enable-debug=yes
make depend
make #STRIP=''
rm -r /opt/openldap/etc/openldap/schema
make install #STRIP=''

removing debug has no efect

Do you have any hint for us?

Br

Sasa