|$AnyEvent::SNMP::MAX_OUTSTANDING (default: 50, dynamic)|
Use this package variable to restrict the number of outstanding SNMP
requests at any point in time.
Net::SNMP is very fast at creating and sending SNMP requests, but much slower at parsing (big, bulk) responses. This makes it easy to request a lot of data that can take many seconds to parse.
In the best case, this can lead to unnecessary delays (and even time-outs, as the data has been received but not yet processed) and in the worst case, this can lead to packet loss, when the receive queue overflows and the kernel can no longer accept new packets.
To avoid this, you can (and should) limit the number of outstanding requests to a number low enough so that parsing time doesnt introduce noticable delays.
Unfortunately, this number depends not only on processing speed and load of the machine running Net::SNMP, but also on the network latency and the speed of your SNMP agents.
AnyEvent::SNMP tries to dynamically adjust this number upwards and downwards.
Increasing $MAX_OUTSTANDING will not automatically use the extra request slots. To increase $MAX_OUTSTANDING and make AnyEvent::SNMP make use of the extra paralellity, call AnyEvent::SNMP::set_max_outstanding with the new value, e.g.:
Although due to the dynamic adjustment, this might have little lasting effect.
Note that you can use Net::SNMP::XS to speed up parsing of responses considerably.
|$AnyEvent::SNMP::MIN_RECVQUEUE (default: 8)|
|$AnyEvent::SNMP::MAX_RECVQUEUE (default: 64)||
These values specify the minimum and maximum receive queue length (in
units of one response packet).
This has the result of adjusting the number of outstanding requests so that the recv queue is between the minimum and maximu, usually.
This algorithm works reasonably well as long as the responses, response latencies and processing times are the same size per packet on average.
This module may be used as a drop in replacement for the Net::SNMP::Dispatcher in existing programs. You can still call snmp_dispatcher to start the event-loop, but then you loose the benefit of mixing Net::SNMP events with other events.
Marc Lehmann <email@example.com> http://home.schmorp.de/
|perl v5.20.3||SNMP (3)||2012-04-15|