… | |
… | |
6 | |
6 | |
7 | use Net::FPing; |
7 | use Net::FPing; |
8 | |
8 | |
9 | =head1 DESCRIPTION |
9 | =head1 DESCRIPTION |
10 | |
10 | |
11 | This module was written for a signle purpose only: sendinf ICMP EHCO |
11 | This module was written for a single purpose only: sendinf ICMP EHCO |
12 | REQUEST packets as quickly as possible to a large number of hosts |
12 | REQUEST packets as quickly as possible to a large number of hosts |
13 | (thousands to millions). |
13 | (thousands to millions). |
14 | |
14 | |
15 | It employs a sending thread and is fully event-driven (using AnyEvent), so |
15 | It employs a sending thread and is fully event-driven (using AnyEvent), so |
16 | you have to run an event model supported by AnyEvent to use this module. |
16 | you have to run an event model supported by AnyEvent to use this module. |
… | |
… | |
103 | called. |
103 | called. |
104 | |
104 | |
105 | Algorithm: Each range has an associated "next time to send packet" |
105 | Algorithm: Each range has an associated "next time to send packet" |
106 | time. The algorithm loops as long as there are ranges with hosts to be |
106 | time. The algorithm loops as long as there are ranges with hosts to be |
107 | pinged and always serves the range with the most urgent packet send |
107 | pinged and always serves the range with the most urgent packet send |
108 | time. It will at most send one packet every C<$send_interval> seconds. The |
108 | time. It will at most send one packet every C<$send_interval> seconds. |
|
|
109 | |
|
|
110 | This will ensure that pings to the same range are nicely interleaved with |
|
|
111 | other ranges - this can help reduce per-subnet bandwidth while maintaining |
|
|
112 | an overall high packet rate. |
|
|
113 | |
109 | algorithm to send each packet is O(log n) on the number of ranges, so even |
114 | The algorithm to send each packet is O(log n) on the number of ranges, so |
110 | a large number of ranges (many thousands) is managable. No storage is |
115 | even a large number of ranges (many thousands) is managable. |
|
|
116 | |
111 | allocated per address. |
117 | No storage is allocated per address. |
112 | |
118 | |
113 | Performance: On my 2 GHz Opteron system with a pretty average nvidia |
119 | Performance: On my 2 GHz Opteron system with a pretty average nvidia |
114 | gigabit network card I can ping around 60k to 200k adresses per second, |
120 | gigabit network card I can ping around 60k to 200k adresses per second, |
115 | depending on routing decisions. |
121 | depending on routing decisions. |
116 | |
122 | |