getting counters for a plenty of vlan ifaces

Ivan Alexandrovich ivsan at ngs.ru
Sun Sep 16 14:47:20 UTC 2012


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


More information about the freebsd-net mailing list