Question

We configured a Drupal 7 instance with simple_ldap module pointing to a local OpenLDAP (on Ubuntu 12.04.4 LTS server).

When multiple users log in to the site, and use it, the CPU of the computer goes wild : slapd is using nearly 100% of the CPU.

The result is that the Drupal site answers so slowly (more than 15s a page...)

In /var/log/syslog we can see that :

Feb 20 14:56:53 cas slapd[2029]: <= bdb_equality_candidates: (uid) not indexed
Feb 20 14:56:53 cas slapd[2029]: <= bdb_equality_candidates: (mail) not indexed
Feb 20 14:56:53 cas slapd[2029]: <= bdb_equality_candidates: (member) not indexed
Feb 20 14:56:53 cas slapd[2029]: <= bdb_equality_candidates: (cn) not indexed

What's going on ?

Was it helpful?

Solution

We had to create the correct index for that.

As said here, first stop the service :

sudo service slapd stop

Then edit /etc/ldap/slapd.d/cn=config/olcDatabase={1}hdb.ldif and add (just after line olcDbIndex: objectClass eq) :

...
olcDbIndex: uid eq
olcDbIndex: member eq
olcDbIndex: mail eq
olcDbIndex: cn eq
...

Then re-index, set the correct rights and restart the service :

sudo slapindex -F /etc/ldap/slapd.d
sudo chown -R openldap:openldap /var/lib/ldap
sudo service slapd start
sudo service apache2 restart
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top