ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-SNMP/SNMP.pm
(Generate patch)

Comparing AnyEvent-SNMP/SNMP.pm (file contents):
Revision 1.12 by root, Sun Apr 15 11:02:07 2012 UTC vs.
Revision 1.13 by root, Mon Nov 24 18:16:54 2014 UTC

32 32
33Also, the Net::SNMP scheduler is very inefficient with respect to both CPU 33Also, the Net::SNMP scheduler is very inefficient with respect to both CPU
34and memory usage. Most AnyEvent backends (including the pure-perl backend) 34and memory usage. Most AnyEvent backends (including the pure-perl backend)
35fare much better than the Net::SNMP dispatcher. 35fare much better than the Net::SNMP dispatcher.
36 36
37Another major added fetaure of this module over Net::SNMP is automatic 37Another major added feature of this module over Net::SNMP is automatic
38rate-adjustments: Net::SNMP is so slow that firing a few thousand 38rate-adjustments: Net::SNMP is so slow that firing a few thousand
39requests can cause many timeouts simply because Net::SNMP cannot process 39requests can cause many timeouts simply because Net::SNMP cannot process
40the replies in time. This module automatically adapts the send rate to 40the replies in time. This module automatically adapts the send rate to
41avoid false timeouts caused by slow reply processing. 41avoid false timeouts caused by slow reply processing.
42 42
43A potential disadvantage of this module is that replacing the dispatcher 43A potential disadvantage of this module is that replacing the dispatcher
44is not at all a documented thing to do, so future changes in Net::SNP 44is not at all a documented thing to do, so future changes in Net::SNMP
45might break this module (or the many similar ones). 45might break this module (or the many similar ones).
46 46
47This module does not export anything and does not require you to do 47This module does not export anything and does not require you to do
48anything special apart from loading it I<before doing any non-blocking 48anything special apart from loading it I<before doing any non-blocking
49requests with Net::SNMP>. It is recommended but not required to load this 49requests with Net::SNMP>. It is recommended but not required to load this
69case, this can lead to packet loss, when the receive queue overflows and 69case, this can lead to packet loss, when the receive queue overflows and
70the kernel can no longer accept new packets. 70the kernel can no longer accept new packets.
71 71
72To avoid this, you can (and should) limit the number of outstanding 72To avoid this, you can (and should) limit the number of outstanding
73requests to a number low enough so that parsing time doesn't introduce 73requests to a number low enough so that parsing time doesn't introduce
74noticable delays. 74noticeable delays.
75 75
76Unfortunately, this number depends not only on processing speed and load 76Unfortunately, this number depends not only on processing speed and load
77of the machine running Net::SNMP, but also on the network latency and the 77of the machine running Net::SNMP, but also on the network latency and the
78speed of your SNMP agents. 78speed of your SNMP agents.
79 79
80AnyEvent::SNMP tries to dynamically adjust this number upwards and 80AnyEvent::SNMP tries to dynamically adjust this number upwards and
81downwards. 81downwards.
82 82
83Increasing C<$MAX_OUTSTANDING> will not automatically use the 83Increasing C<$MAX_OUTSTANDING> will not automatically use the
84extra request slots. To increase C<$MAX_OUTSTANDING> and make 84extra request slots. To increase C<$MAX_OUTSTANDING> and make
85C<AnyEvent::SNMP> make use of the extra paralellity, call 85C<AnyEvent::SNMP> make use of the extra parallelity, call
86C<AnyEvent::SNMP::set_max_outstanding> with the new value, e.g.: 86C<AnyEvent::SNMP::set_max_outstanding> with the new value, e.g.:
87 87
88 AnyEvent::SNMP::set_max_outstanding 500; 88 AnyEvent::SNMP::set_max_outstanding 500;
89 89
90Although due to the dynamic adjustment, this might have little lasting 90Although due to the dynamic adjustment, this might have little lasting
103When AnyEvent::SNMP handles $MAX_RECVQUEUE or more packets per iteration 103When AnyEvent::SNMP handles $MAX_RECVQUEUE or more packets per iteration
104it will reduce $MAX_OUTSTANDING. If it handles less than $MIN_RECVQUEUE, 104it will reduce $MAX_OUTSTANDING. If it handles less than $MIN_RECVQUEUE,
105it increases $MAX_OUTSTANDING. 105it increases $MAX_OUTSTANDING.
106 106
107This has the result of adjusting the number of outstanding requests so that 107This has the result of adjusting the number of outstanding requests so that
108the recv queue is between the minimum and maximu, usually. 108the recv queue is between the minimum and maximum, usually.
109 109
110This algorithm works reasonably well as long as the responses, response 110This algorithm works reasonably well as long as the responses, response
111latencies and processing times are the same size per packet on average. 111latencies and processing times are the same per packet on average.
112 112
113=back 113=back
114 114
115=head1 COMPATIBILITY 115=head1 COMPATIBILITY
116 116

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines