On Fri, 29 Oct 2004, Stewart Walker wrote:

> Redhat ES 3.1
> qmail-ldap-1.03-20040401.patch
> qmail-smtpd-auth-0.30.
> php-ldap-4.3.2-14.ent
> courier-imap-ldap-3.0.3.20040411-1.3ES
> openldap-servers-2.1.22-8
> openldap-2.1.22-8
>
> Getting errors  in /var/log/qmail/current after adding 15000+
> records to the LDAP db.
>
> did the qmail-lookup and the initial search took longer then I
> expected but was less then 30 seconds. A second or third lookup
> was almost instantanious.
>
> Am now deleting  all but one LDAP record from the db and it is
> taking forever up to 15 seconds per record.
>
> Is there something like cach or memory setting I need to bump up.
> What can you do to re-index or make the search delete faster after
> adding or deleteing a large amount of records from the db?
>
> Stewart Walker
> [EMAIL PROTECTED]


Make sure you index the things that you are searching on, i.e. mail, uid,
etc. You also want to index "objectClass" which is not so obvious. I index
these in my ldap db:

index   objectClass     eq
index   cn              pres,eq,sub
index   mail            pres,eq,sub
index   uid             pres,eq,sub

I believe that is all you really need to make it fast, I also index a
bunck of other attributes solely for the purpose of making troubleshooting
faster. For instance:
index   mailForwardingAddress   eq

allows me to run a search a mailForwardingAddress and get a result in >1
second, vs. a good 30-60 seconds without an index (on a db w/ 150,000
records) You don't need the 'sub' unless you want to search against a
wildcard, which I do search [EMAIL PROTECTED] sometimes.

Hope this helps.

Andreas

Reply via email to