getting counters for a plenty of vlan ifaces

Gleb Smirnoff glebius at FreeBSD.org
Wed Sep 19 15:18:09 UTC 2012


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> <em1.757> <bytes_in> <bytes_out> <pkts_in> <pkts_out>
I> <em1.761> <bytes_in> <bytes_out> <pkts_in> <pkts_out>
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.


More information about the freebsd-net mailing list