I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2010-05-14 08:00:30.578286-07 by dragle
slow callbacks and timeouts
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
Direct Responses: Write a response