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

Network traffic (Time optimization problem)



Hi all,

My question is basically related to find efficient way of communication 
between a client and a server running on diffrent system.

I am using Open LDAP server to maintain user profile, address and FSM state 
object class of these user.  Now i am developing a LDAP client to maintain 
these database. It is working quite fine. 

I am using ldap_search_s API to search these data. Now to get complete 
information about user (all 3 objects - profile, address, FSM state) I am 
thinking about two solutions -

1. search using filter ( & (user-id =some_value) (objectclass=*) )and get all 
object in one ldap_search_s API. Then use ldap_first_entry & ldap_next_entry 
to get all entries and parse the result.

2. Search each object differently (means 3 times ldap_search_s API) and then 
use ldap_first_entry then ldap_next_entry APIs to parse the result.

Obviously second method looks better both in complexity and in processing 
speed(due to parsing). But the problem is that my server resides quite far 
from client.  So giving 3 ldap_search_s API calls may create lot of socket 
operations and total time taken is far more than using only one search API.

So which method takes less execution time (network time + process time) and 
why ?

I have couple of more questions -
* Is ldap_search_s always open a new socket connection for data transfer ? or 
connection open only in ldap_bind_s API.

* Is ldap_search_s takes all entries in one go and calling ldap_first_entry 
and ldap_next_entry only parse that data (and no socket operation is required)

Regards,
Vishal Mathur