You can use /proc/vz/vestat file:
[root@tst ~]# cat /proc/vz/vestat
Version: 2.2
VEID user nice system uptime idle strv uptime used maxlat totlat numsched
100 0 0 5063 40598698 70123626936598 0 35069066535737 8612439976 2314 737714316 53144
in this file for each VPS you have:
1. "user nice system uptime" in jiffies. i.e. divide by jiffies_per_second to get seconds (see below).
2. "idle strv uptime used" in cycles. much more accurate. seconds = used / cycles_per_jiffy / jiffies_per_seconds.
3. values of cycles_per_jiffy and jiffies_per_seconds can be read from /proc/vz/stats
BTW, while looking into this I found a small misprint in /proc/vz/vestat output code, so thank you very much ![Smile](images/smiley_icons/icon_smile.gif)
--- ./kernel/vecalls.c.usertm 2006-04-07 19:04:46.000000000 +0400
+++ ./kernel/vecalls.c 2006-04-20 10:05:24.000000000 +0400
@@ -2875,7 +2875,7 @@ static int vestat_seq_show(struct seq_fi
idle_time = strv_time = used = 0;
for (cpu = 0; cpu < NR_CPUS; cpu++) {
- user_ve += VE_CPU_STATS(ve, cpu)->nice;
+ user_ve += VE_CPU_STATS(ve, cpu)->user;
nice_ve += VE_CPU_STATS(ve, cpu)->nice;
system_ve += VE_CPU_STATS(ve, cpu)->system;
used += VE_CPU_STATS(ve, cpu)->used_time;