[Date Prev][Date Next] [Chronological] [Thread] [Top]

Problems with multi-threaded client



Hi, 
Ive written an ldap client application that runs on Solaris 8 (SPARC),
against OpenLDAP 2.0.15 (with BerkeleyDB-3.3 backend). My client
application receives about 300 requests per second, requiring
approximately 100 queries to a well indexed portion of my LDAP tree (~3000
entries). 
I initially developed the application with ldap_enable_cache running just
after connecting, however when i moved to 2.0.15 (from an older 2.x
stable release), i noticed that ldap_enable_cache fails (returning -1),
but ldap_perror reports "Success".
When my application runs only 1 thread connected to LDAP, the performance
is pretty poor, but i get no bizzare errors. However, when i start running 
more than 1 (4->16) threads, each with their own LDAP *ld, my program
repeatedly dumps core, in various parts of libldap. About 50% of the time
its from assert()'s failing, usually when LDAP_VALID(ld) != 0x2, or the
BER is invalid. The other 50% of the time i get random Bus Errors inside
functions like ldap_first_entry.
Im really at a loss. I even placed mutex'es around each ldap block to
ensure that nothing wacky was going on.. This didnt help. 

Has anyone seen problems like this before ?
Are my load expectations from OpenLDAP too high ?
What is the significance of ldap_enable_cache() failing in 2.0.15 ?
How can i check that my LDAP *ld is valid, without causing an assertion
failure ?
Any hints ?

Appreciation in advance,

Joshua Reich.