LDAP search some time really slow, some time really fast

329 views
Skip to first unread message

kengsreng tang

unread,
Dec 2, 2014, 1:34:00 PM12/2/14
to ruby...@googlegroups.com
Hi All,
Is there any tips to improve the LDAP.search performance ?
here what I did: @ldap.search(base: treebase, filter: filter)
but the performance is inconsistent.

Jerry Cheung

unread,
Dec 3, 2014, 6:01:57 PM12/3/14
to ruby...@googlegroups.com
What version of net-ldap are you using? Instrumentation was added in 0.9.0, allowing you to subscribe to specific events and profile the runtime and other details. For a code example, check out this test: https://github.com/ruby-ldap/ruby-net-ldap/blob/master/test/test_search.rb#L29-L38

Matt Todd

unread,
Feb 3, 2015, 7:39:41 PM2/3/15
to ruby...@googlegroups.com
What filter are you using? What LDAP directory are you connecting to? When you're running your search, how close, physically, are you to the directory server and how fast is your connection? Have you checked latency/ping times?

There can be any number of reasons why you will experience slow connections to services over the network. Pinpointing where the slow down happens is critical. Check your network connection, try querying from another host (physically close to the LDAP directory, or on your same network), using ldapsearch or other query tools (like Apache Directory Studio even), and making sure that the attributes you are querying for are indexed in the directory for fast lookup.

And as Jerry mentioned, once you've narrowed it down to the client library, you can hook into the internal events to see what's happening and where it's going slow. Try setting up basic logging with the instrumentation hooks.
Reply all
Reply to author
Forward
0 new messages