Date: Fri, 26 Dec 2008 15:28:22 +0500 From: Andrew Alcheyev <buddy@telenet.ru> To: freebsd-net@freebsd.org Cc: Eugene Grosbein <eugen@kuzbass.ru> Subject: Re: bsnmpd & BGP full view Message-ID: <46629699.20081226152822@telenet.ru> In-Reply-To: <20081225193818.GA9210@svzserv.kemerovo.su> References: <20081225193818.GA9210@svzserv.kemerovo.su>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
Hello.
On Friday, December 26, 2008, 12:38:18 AM you wrote:
EG> Is there a way to reduce bsnmpd's CPU & memory usage
EG> for BGP router using full view?
EG> I do not need to deal with routing table via SNMP.
EG> SNMP is needed to monitor interface byte counters only via mrtg.
EG> bsnmpd grows upto 18Mb for FreeBSD 6.4 and worse,
EG> it hogs CPU while bgpd obtains full view.
You can try the attached patch - it cuts off any routing
table processing within bsnmpd.
It will be really useful if someone implements some variable in
/etc/snmpd.config to control such behaviour.
With best regards, Andrew.
[-- Attachment #2 --]
--- /usr/src/contrib/bsnmp/snmp_mibII/mibII.c.orig 2006-03-31 18:43:38.000000000 +0600
+++ /usr/src/contrib/bsnmp/snmp_mibII/mibII.c 2008-12-26 14:46:24.000000000 +0500
@@ -41,8 +41,13 @@
static struct lmodule *module;
/* routing socket */
+#if 0
static int route;
static void *route_fd;
+#else
+static int route = -1;
+static void *route_fd = NULL;
+#endif
/* if-index allocator */
static uint32_t next_if_index = 1;
@@ -1330,6 +1335,7 @@
}
+#if 0
/*
* Intput on the routing socket.
*/
@@ -1352,6 +1358,7 @@
handle_rtmsg(rtm);
}
+#endif
/*
* execute and SIOCAIFADDR
@@ -1644,10 +1651,12 @@
static void
mibII_start(void)
{
+#if 0
if ((route_fd = fd_select(route, route_input, NULL, module)) == NULL) {
syslog(LOG_ERR, "fd_select(route): %m");
return;
}
+#endif
mib_refresh_iflist();
update_ifa_info();
mib_arp_update();
@@ -1694,10 +1703,12 @@
return (-1);
}
+#if 0
if ((route = socket(PF_ROUTE, SOCK_RAW, AF_UNSPEC)) == -1) {
syslog(LOG_ERR, "PF_ROUTE: %m");
return (-1);
}
+#endif
if ((mib_netsock = socket(PF_INET, SOCK_DGRAM, 0)) == -1) {
syslog(LOG_ERR, "PF_INET: %m");
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?46629699.20081226152822>
