Subject: Traffic accounting
From: Cedric Veilleux <cveilleux@neopeak.com>
Date: Fri, 09 Jan 2009 13:34:51 -0500

Hi,

I am using the vserver collectd plugin which gives me several nice
graphs for each vservers.

One of these is the inet traffic, which is built from the data obtained
via the /proc/virtual/xid/cacct file (I didn't check collectd sources
but I guess that's where the data come from).

The problem is that the data for the traffic accounting seems to be
wrong. It does make some kind of sense but seems to be always much much
lower than the actual traffic transferred, maybe only 10% gets reported.

I am basing my estimate on the fact that I also use pmacct, which does
the accounting using libpcap on a per-IP basis, and pmacct's stats seems
to be more accurate..

The problem is that I prefer collectd since it gives the stats on a per
vserver basis which is much more useful than on a per-IP basis..

Are there known problems with the vserver traffic accounting via proc?

Below is the output of vserver-info:




Versions:
                   Kernel: 2.6.22-3-vserver-amd64
                   VS-API: 0x00020200
             util-vserver: 0.30.216-pre2772; Nov  8 2008, 21:49:08

Features:
		       CC: gcc, gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
                      CXX: g++, g++ (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
                 CPPFLAGS: ''
                   CFLAGS: '-Wall -g  -O2 -std=c99 -Wall -pedantic -W -funit-at-a-time'
                 CXXFLAGS: '-g -O2 -ansi -Wall -pedantic -W -fmessage-length=0 -funit-at-a-time'
               build/host: x86_64-pc-linux-gnu/x86_64-pc-linux-gnu
             Use dietlibc: yes
       Build C++ programs: yes
       Build C99 programs: yes
           Available APIs: v13,net,v21,v22,v23,netv2
            ext2fs Source: e2fsprogs
    syscall(2) invocation: alternative
      vserver(2) syscall#: 236/glibc
               crypto api: beecrypt

Paths:
                   prefix: /usr
        sysconf-Directory: /etc
            cfg-Directory: /etc/vservers
         initrd-Directory: $(sysconfdir)/init.d
       pkgstate-Directory: /var/run/vservers
          vserver-Rootdir: /var/lib/vservers




-- 
Cedric Veilleux <cveilleux@neopeak.com>
Neopeak Internet Solutions inc.