in reply to Re^18: Async DNS with LWP
in thread Async DNS with LWP

jc:

To amplify BrowserUk's point: Too many people want to create an "optimal" solution right out of the gate. But computer and network behaviour is so complicated that without information, you can't determine *what* to optimize, nor which behaviour you may need to fix.

Remember:

So first just try coding the simplest thing you can that works. After you've made it work correctly, is it fast/good enough? If so you're done--and with far less work!

Only if it's not fast/good enough do you need to make any improvements. So, to improve it, first figure out what needs improvement: If you just guess, you're likely to be wrong, and you'll waste your time. Look at your measurement results to see where you can get the most improvement, make the improvement, and check whether you're done. If not, take more measurements, choose the next chunk of code, etc.

How do you know when you're done? If at all possible, choose a performance goal. Once you meet it, you're done. Sometimes you'll find that you must accept worse performance than you planned (if you can't improve the performance enough), or you'll have to investigate better algorithms, faster hard drives, more memory, etc.

...roboticus

Replies are listed 'Best First'.
Re^20: Async DNS with LWP
by jc (Acolyte) on Oct 10, 2010 at 20:14 UTC
    Hi. This is in fact what I have done. First I made a simple serial version based on LWP. This averaged a domain per second (2.8 years for 90,000,000 domains). Then I used Parallel::ForkManager to throw more processes at the job hoping to get an improvement. By tweaking various factors like the number of processes and the length of the timeout I was only able to process up to an average of 10 domains per second. Then I tried with AnyEvent::HTTP, I was able to average about 100 per second. I'm trying to improve on this.