Query/Bind speed degraded after updating to Red Hat Enterprise Linux 7 389-ds
Environment
- Red Hat Enterprise Linux 7
- Red Hat Directory Server 10
- Red Hat Identity Management
Issue
- After updating to Red Hat Directory Server 10, LDAP binds and initial connections are extremely slow.
- After upgrading Red Hat Identity Management to Red Hat Enterprise Linux 7, LDAP binds and initial connections are extremely slow.
Resolution
-
Turn off the new
Turbo Modefeature of389-ds
(you will need to type this line by line)# ldapmodify -D "cn=directory manager" -W dn: cn=config changetype: modify replace: nsslapd-enable-turbo-mode nsslapd-enable-turbo-mode: off
When you are fininished, press CTRL+D
Root Cause
The Turbo Mode feature in Red Hat Enterprise Linux 7 389 Directory Server (RHDS/IPA) causes worker threads to handle LDAP jobs differently.
- The
nsslapd-enable-turbo-modeparameter is documented here. - You can also read more about the Turbo Mode source code here.
Diagnostic Steps
To profile the activity of ns-slapd and ldapsearch to understand what precisely they are doing, strace and pstack are use to show their flow of function calls and execution.
-
Capture
pstackofns-slapdandstracefor further analysis as shown below:# pstack $(pidof ns-slapd) > /tmp/pstack_$(date +%d-%m-%Y_%H%M%S).txt -
Run
straceonns-slapdpid:# strace -Tttfxvoy /tmp/dirsrv.strace -s 8192 -p $(pidof ns-slapd) -
From another console, run the
ldapsearchcommand withstrace.# strace -Tttfxvoy /tmp/ldapsearch.strace -s 8192 ldapsearch -x -h 127.0.0.1 -D "cn=Directory manager" -w <password> -b "ou=example,ou=com" -LLL uid=<example-username>During analysis we notice that
straceshows "accept()" always returning immediately when called. Also accept() not being called frequently enough for incoming connection workload.Secondly, packet captures show
ldap simple bindRequesttakes more than 50s in this test instance. -
Check to see if
turbo modeis enabled or not:# ldapsearch -LLL -D "cn=directory manager" -W -b cn=config "(objectClass=nsslapdConfig)" nsslapd-enable-turbo-mode
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments