From owner-freebsd-net@FreeBSD.ORG Wed Sep 19 15:18:09 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 F08F51065674 for ; Wed, 19 Sep 2012 15:18:08 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id 6A3FB8FC16 for ; Wed, 19 Sep 2012 15:18:08 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q8JFI6b7040574; Wed, 19 Sep 2012 19:18:06 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q8JFI6dF040573; Wed, 19 Sep 2012 19:18:06 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 19 Sep 2012 19:18:06 +0400 From: Gleb Smirnoff To: Ivan Alexandrovich Message-ID: <20120919151806.GK85604@FreeBSD.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-net@FreeBSD.org Subject: Re: 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: Wed, 19 Sep 2012 15:18:09 -0000 On Sun, Sep 16, 2012 at 09:41:19PM +0700, Ivan Alexandrovich wrote: I> Hi I> I> We are running freebsd9.0 on a router with I> more than 1000 of subscriber's vlan interfaces. I> Outgoing packet rate is approximately 40 kpps. I> I> There's a need to collect bytes and packets I> counters for all those vlan interfaces every I> minute (or even twice a minute) and store them I> in a plain text file: I> I> I> ... I> Also I'd like to copy the whole arp table I> into a file (not so frequently). I> I> Our observations show that using common tools I> like a snmp daemon can create a significant I> CPU load. If I'm not mistaken this is due to I> high rate of context switches that are need I> to access kernel data from the userspace. That's strange. Per-minute read shouldn't induce large CPU load. What snmp daemon do you use? I remember that several years ago net-snmp daemon from ports used a single linked list for all ARP entries, and thus it consumed a lot of CPU when receiving a single ARP change from routing socket. Don't know whether this is still valid. And I hope in base bsnmpd doesn't have such problem. -- Totus tuus, Glebius.