We use ldap to store customer metadata like users, customers and other stuff. Right now each node has a ldap and we are trying to consolidate ldaps across different nodes. So I loaded one ldap with data from 20 nodes and some of the queries were taking 4000 msec. So I saw that indexes were missing .
I went to slapd.conf and added
index customerNumber,customerDomain,email eq
index customerName eq,sub
I also updated the cache size to 4G in DB_CONFIG file
set_cachesize 4 0 1
I restarted ldap and suddenly things were flying but something was fishy as the new numbers for 100 threads was faster then previous 1 thread time for all operations. So I picked one query and ran it manually and found that a simple query like below was coming empty
ldapsearch -x -H ldap://localhost:389 -b "dc=xxx,dc=com" "(&(objectclass=objuser)(email=kpatel@comcast1.net))"|grep email|more
I removed the index and restarted ldap and same query started returning results. Upon googling I found that if you add a new index you have to reindex your data, wth. so I
1) shutdown ldap
2) ran
/usr/sbin/slapindex -f ~/openldap/etc/slapd.conf -b "dc=xxx,dc=com"
3) started ldap
and now the query was returning results.
And LDAP rocks even 500 threads its rocking fast.
I went to slapd.conf and added
index customerNumber,customerDomain,email eq
index customerName eq,sub
I also updated the cache size to 4G in DB_CONFIG file
set_cachesize 4 0 1
I restarted ldap and suddenly things were flying but something was fishy as the new numbers for 100 threads was faster then previous 1 thread time for all operations. So I picked one query and ran it manually and found that a simple query like below was coming empty
ldapsearch -x -H ldap://localhost:389 -b "dc=xxx,dc=com" "(&(objectclass=objuser)(email=kpatel@comcast1.net))"|grep email|more
I removed the index and restarted ldap and same query started returning results. Upon googling I found that if you add a new index you have to reindex your data, wth. so I
1) shutdown ldap
2) ran
/usr/sbin/slapindex -f ~/openldap/etc/slapd.conf -b "dc=xxx,dc=com"
3) started ldap
and now the query was returning results.
And LDAP rocks even 500 threads its rocking fast.
Comments
Post a Comment