Hi Team,

We are working on migration of nsldap C sdk to OpenLDAP C sdk for our
application client code.

We are using OpenLDAP 2.6.7.

As part of this migration, we are facing one issue related to performance
degradation under load on Windows platform.

In our application, we are using a single/shared connection handle to
perform LDAP operation on LDAP user store servers. As part of
Authentication, we are using ldap_search_ext_s call to get users and to get
any user attributes from LDAP servers. We are using synchronous calls.
With Mozilla NSLDAP, the same application is working well without any
issues. As we are migrating to OpenLDAP, we did required changes and also
we used ldap_dup() API to avoid "-4:Decoding error" issues under the load.

Now, we are facing performance degradation issues under the load with
OpenLDAP library
Whenever we are trying to get a user attribute from the LDAP user store
server where that user attribute is not available or value for user
attribute is empty, we observed performance degradation with OpenLDAP
library clearly around 25-30%. In case, search for user attributes with
value, no degradation observed. This degradation is happening only when the
user attribute is not available or the value is empty.

Here are the snippet of runs output where performance degrade is showing:

*With search of user attribute having value at LDAP server side:*

Total Elapsed:           0:10:01

Minimum Response Time:   0:00:00.000.056
Maximum Response Time:   0:00:00.783.140
Average Response Time:   0:00:00.016.124

Total Requests:          659316
Throughput (Req/Sec):    1094.447

*With search of user attribute, not having value/does not exist at LDAP
server side:*

Total Elapsed:           0:10:01

Minimum Response Time:   0:00:00.000.059
Maximum Response Time:   0:00:00.218.502
Average Response Time:   0:00:00.032.788

Total Requests:          355065
Throughput (Req/Sec):    590.258


Example search calls we are using:
1. ldap_search_ext_x() for user lookup
2. ldap_search_ext_s() for user attributes for that specific user. (filter:
uid=* and base: "cn=user,dc=comain,dc=com) - Where uid attribute has some
value for this user at LDAP server side
3. ldap_search_ext_s() for user attributes for that specific user. (filter:
Name=* and base: "cn=user,dc=comain,dc=com) - Where Name attribute is not
present for that user at LDAP server side (This is causing performance
degrade)

With the same above steps, we did not see any performance issues with
NSLDAP. If we remove step 3 from the above, no degradation is observed with
the OpenLDAP library.

Could you please look into this issue and provide a solution to overcome
this performance degradation issue? We are completely blocked here as part
of OpenLDAP migration.

Note: To investigate this performance degradation with OpenLDAP, I wrote
one LDAP sample code with the above 3 operations with multiple threads. I
executed the sample with NSLDAP and OpenLDAP using multiple threads. In the
sample runs, OpenLDAP is giving very poor performance when compared with
NSLDAP. Please have a look at the sample also and provide your thoughts.

Thank you in advance for your time and help

Attachment: LDAPBenchMark.cpp
Description: Binary data

Reply via email to