From 3f6e5c4df53d4a7718a0f41931a9ff7fdc66e9ca Mon Sep 17 00:00:00 2001 From: syrinx Date: Thu, 3 Dec 2009 16:08:00 +0000 Subject: Fix a problem with high CPU consumption (up to 30%) by bsnmpd on a loaded system. Instead of constantly calling the mibII_idle function when the server is not busy call the function only once every 10 seconds to avoid bsnmpd constantly doing gettimeofday syscalls. Make the idle polling interval confugurable via begemotIfDataPoll. Reported and tested by: misho (at) aitbg (dot) com Oked by: harti MFC after: 1 week --- contrib/bsnmp/snmp_mibII/mibII.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'contrib/bsnmp/snmp_mibII/mibII.h') diff --git a/contrib/bsnmp/snmp_mibII/mibII.h b/contrib/bsnmp/snmp_mibII/mibII.h index a21e023..0ebde9a 100644 --- a/contrib/bsnmp/snmp_mibII/mibII.h +++ b/contrib/bsnmp/snmp_mibII/mibII.h @@ -211,6 +211,14 @@ extern u_int mibif_hc_update_interval; /* re-compute update interval */ void mibif_reset_hc_timer(void); +/* interfaces' data poll interval */ +extern u_int mibII_poll_ticks; + +/* restart the data poll timer */ +void mibif_restart_mibII_poll_timer(void); + +#define MIBII_POLL_TICKS 100 + /* get interfaces and interface addresses. */ void mib_fetch_interfaces(void); -- cgit v1.1