[Lxc-users] LXC Statistics Collection

Francois-Xavier Bourlet francois-xavier.bourlet at dotcloud.com
Sat Mar 12 18:08:18 UTC 2011


Hello,

I am trying to collects statistics from LXC container externally. By
externally, I mean without executing anything inside the container,
but just grabbing all the informations from the outside.

Basically I am processing like that:

Browse /var/lib/lxc to find containers name.
For each containers name, check if the task group exist in
/cgroups/ContainerName, if it exist, read all the cpu and memory stats
etc.

I see some issues with this approach like the fact that's just assume
that LXC store informations in /var/lib/lxc or that I am just assuming
how LXC name the task group.

Also, how to get network statistics?
First at all, many different network stack can be used (vetch, macvlan
etc), then network namespace are not linked to cgroups, mean only LXC
know the real association between interfaces and containers.

I looked at the liblxc library, and no API seem to be there for
helping at my task. Maybe I didn't got something, and I'am trying the
wrong way while a trivial solution exist.

Do you have any idea how I could reach my goal, I mean get the maximum
statistics as possible with the best integration with LXC?

I'am ready to patch LXC if necessary, I would like to have your concern before.

regards,
-- 
François-Xavier Bourlet




More information about the lxc-users mailing list