Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Optimize my code with Hashes

by Bloodnok (Vicar)
on Aug 27, 2008 at 10:03 UTC ( [id://707119]=note: print w/replies, xml ) Need Help??


in reply to Optimize my code with Hashes

I wish to be associated with the remarks of the last speaker :-))
LDAP is not always the speediest of protocols - esp. when there's firewall(s) in the way.

You could try printing timestamps immediately before and after the LDAP access - this would help to confirm the location of the (suspected) bottleneck...

A user level that continues to overstate my experience :-))

Replies are listed 'Best First'.
Re^2: Optimize my code with Hashes
by sukhicool (Initiate) on Aug 27, 2008 at 10:16 UTC
    I have already printed timestamps in the log files. We may see from here:
    [09:20:29.260258 ]: 144248 (BATALLONES,Jayson) looks like a creation [09:20:29.260564 ]: Creating entry 144248 (BATALLONES,Jayson) in ED... [09:20:35.192125 ]: createEDentry: Successfully created ED entry 'st-e +duid=ed953127,ou=people,dc=xyz,dc=com' 144248 (BATALLON ES,Jayson) for location 000194
    The above log shows that LDAP Server is not taking too much time in creating a entry. I have also used Benchmark for it and the result is as below:
    the code took: 1 wallclock secs ( 0.01 usr 0.00 sys + 0.00 cusr 0.0 +0 csys = 0.01 CPU) in Creating entry 144248(BATALLONES,Jayson) in ED +...
      Mmmm, if I read correctly, a single lookup takes, on average, 6 secs - if it takes 6 secs/entry, it should take about 330,000 secs i.e. a lot longer than 18 hrs, for 55,000 entries, so I think you're getting off lightly!

      It strikes me that the best answer to your problem is, as jbert suggests, to find a bulk LDAP download tool and use that - which will inevitably require knowledge of LDIF file processing.

      A user level that continues to overstate my experience :-))
      6s is quite slow. One question: Do you setup a new LDAP connection for each transaction? If yes, try to reuse an already opened LDAP connection (better: a pool of connections) since it is not necessary to bind and authenticate 50k times.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://707119]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-24 05:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found