From owner-freebsd-net@FreeBSD.ORG Sun Sep 16 14:47:20 2012 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 170551065672 for ; Sun, 16 Sep 2012 14:47:20 +0000 (UTC) (envelope-from ivsan@ngs.ru) Received: from smtpout.ngs.ru (fallback6.ngs.ru [195.19.71.26]) by mx1.freebsd.org (Postfix) with ESMTP id A8A928FC08 for ; Sun, 16 Sep 2012 14:47:18 +0000 (UTC) Received: from smtpout.ngs.ru (mc-spool1 [172.16.103.66]) by mc-spool1.in.ngs.ru (fallback) with ESMTP id 692AD181DF6 for ; Sun, 16 Sep 2012 21:41:28 +0700 (NOVT) Received: from mx14.intranet.ru (mx14.intranet.ru [172.16.7.2]) by mail.ngs.ru (smtp) with ESMTP id 8DAEF180CD1 for ; Sun, 16 Sep 2012 21:41:19 +0700 (NOVT) Received: from mx16.intranet.ru (mx16.intranet.ru [172.16.7.4]) by mx14.intranet.ru (mx14.intranet.ru) with ESMTP id 8B5A7FB66 for ; Sun, 16 Sep 2012 21:41:19 +0700 (NOVT) Received: from [176.51.91.130] (account ivsan@ngs.ru) by mx16.intranet.ru (CommuniGate Pro WebUser 4.3.11) with HTTP id 25219141 for freebsd-net@freebsd.org; Sun, 16 Sep 2012 21:41:19 +0700 From: "Ivan Alexandrovich" To: freebsd-net@freebsd.org Date: Sun, 16 Sep 2012 21:41:19 +0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="KOI8-R"; format="flowed" Content-Transfer-Encoding: 8bit X-SpamTest-Envelope-From: ivsan@ngs.ru X-SpamTest-Group-ID: 00000000 X-SpamTest-Header: NOTSPAM X-SpamTest-Info: Profiles 36690 [Sep 16 2012] X-SpamTest-Method: none X-SpamTest-Rate: 0 X-SpamTest-Status-Extended: not_detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0284], KAS30/Release Subject: getting counters for a plenty of vlan ifaces X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 14:47:20 -0000 Hi We are running freebsd9.0 on a router with more than 1000 of subscriber's vlan interfaces. Outgoing packet rate is approximately 40 kpps. There's a need to collect bytes and packets counters for all those vlan interfaces every minute (or even twice a minute) and store them in a plain text file: ... Also I'd like to copy the whole arp table into a file (not so frequently). Our observations show that using common tools like a snmp daemon can create a significant CPU load. If I'm not mistaken this is due to high rate of context switches that are need to access kernel data from the userspace. So it is desirable to run this tasks - saving counters and arp table into files on a dedicated cpu core. So that copying data from kernel will not affect router performance - packet delays, for example. I would like to ask for an advice about possible solutions. Currently there are two scenarios I can think of: 1) Our custom daemon using userspace APIs (rtmsg, if_* functions, don't know for sure). 2) Our kld module that will store the data needed directly from the kernel into the files. Thanks, Ivan