|
Hi, I'm having somewhat of a problem in that my ability to query multiple hosts using snmp_dispatcher (i.e., non-blocking requests) seems to be negatively effected by the length of time I spend in my actual callback function. As a test, I setup a callback that does little other than sleep for one second, process the result, print a pass/fail message, and then return:
sub process_result {
my ($session, $process_hash, $locid, $host, $tempwanmaps, $wanmaps, $circuit_process) = @_;
sleep 1;
my $result = $session->var_bind_list();
if (!defined($result)) {
my $error = $session->error();
print "$error ($locid, $process_hash->{$locid}->{company} - $process_hash->{$locid}->{store
+number})\n";
return;
}
$process_hash->{$locid}->{processed} = 1;
print "Positive result for $process_hash->{$locid}->{company} - $process_hash->{$locid}->{store
+number}\n";
}
With retries set to 1 and timeout set to 2 in all the objects, I find I'm able to process about 100 queries successfully, and then the remaining ones all respond "No response from remote host." If I remove the sleep, all but one of the queries respond positively (and the one is an actual negative response).
Obviously this is a contrived example and I can create a subroutine that operates very quickly; but I'm concerned that at some point in the future--i.e., when my hosts grow to very large numbers--I could run into the problem naturally even with a minimalistic callback routine. Is there something about the snmp_dispatch process that I'm missing or mis-understanding that would help combat this possibility?
Thanks for any assistance.
Dan |