Think about Loose Coupling | |
PerlMonks |
Net::Ping with threadsby Spesh00 (Initiate) |
on Mar 15, 2005 at 19:22 UTC ( [id://439726]=perlquestion: print w/replies, xml ) | Need Help?? |
Spesh00 has asked for the wisdom of the Perl Monks concerning the following question:
I need to ping 723 hosts with a single packet every minute with a 3 second time out. Using the example in NET::Ping:
I can iterate through the list serially in a little over 100 seconds, what I would like to do is thread or fork this in order to speed things up. I've found a reference to a threaded "version" of the ping at: http://www.perlmonks.org/index.pl?node_id=231514 when I altered that method to use NET::PING, the script really didn't speed up all that much. I tried altering where I created my ping object - inside the thread, outside the thread.. Print the ping as it goes, capture to an array and join back up at the end... Nothing really seems to help. What I'm looking for is a way to heavily parallelize (sp?) my $p->ping() call in order to be able to get through the list quicker. The box it'll be running on can take it and so can the network. Any help would be greatly appreciated.
Back to
Seekers of Perl Wisdom
|
|