in reply to Re: Optimize my code with Hashes
in thread Optimize my code with Hashes

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 +...

Replies are listed 'Best First'.
Re^3: Optimize my code with Hashes
by Bloodnok (Vicar) on Aug 27, 2008 at 11:26 UTC
    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 :-))
Re^3: Optimize my code with Hashes
by Perlbotics (Archbishop) on Aug 27, 2008 at 18:09 UTC
    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.