AsyncPing
view release on metacpan or search on metacpan
lib/AsyncPing.pm view on Meta::CPAN
The timeout value start to work after this module sends out all the requests.
The retry will only work on the failed ones.
Please notice that ICMP is not TCP connection, there is no guarantee that if you send a request to a server, you'll get a response. So you may want to set the try to 2.
So if you have a million servers to ping(10% of them are down) and you set the timeout to 3 and retry to 2, I can estimate the time to be about (1M/25k+3)+(100k/25k+3)=50 seconds.
Please also notice that since ICMP can only be sent by root, if you want to use this library, you'll have to run your program as root.
If the ping requests are going through firewall, your ping requests could possibly be discarded by firewall, don't blame the library.
since every process share same network interface and usually there is only 1 network interface on a server, I think it doens't really help if you make it parallel
or multi-threaded to increase speed. Just like you don't get much benefit if you make more threads while you have only 1 CPU. But you can test on your own, good luck!
=cut
my $ICMP_PING = 'ccnnna*';
my $identifier = 1;
my $sequence = 2;
my $data = 'abcdefghijklmn';
sub new{
my ($class,%arg)=@_;
( run in 0.569 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )