/proc/user_beancounters and vzlist giving different outputs
well I created a script for checking my ram usage. Using the output of /proc/user_beacncounters, the total bytes of ram being used are: 20931303 with vzlist -o with the same fields that I use with the beancounters, the sum is 20847588. I've checked for differences, and at least kmemsize show different values in user_beancounters and in vzlist -o kmemsize...is this normal? Which one is the correct one? Thank you
Re: /proc/user_beancounters and vzlist giving different outputs
Are you doing the checks at exactly the same time? Memory usage varies. You should try using vzmemcheck instead. [root@server ~]# vzmemcheck -Av Output values in Mbytes veid LowMem LowMem RAM MemSwap MemSwap Alloc Alloc Alloc util commit util util commit util commit limit 109 1.55 88.35 18.78 18.78 387.97 48.08 387.97 1424.51 103 0.91 88.35 8.30 8.30 387.97 13.17 387.97 1424.51 102 0.98 88.35 10.01 10.01 387.97 17.28 387.97 1424.51
yes I have both calculations made in the same script. They show a little difference in bytes, but the one based on user_beancounters is always +-100kb bigger than the vzlist -o mode... can't figure out why.. vzmemcheck shows a value that is closer to the vzlist mode, but lower...
Does anyone have a clue on why this happens? vzmemcheck shows 16,95Mb of usage, vzlist and /proc/user_beancouters show 17,1Mb (but not the same in bytes: 17969188 for beancounters, 17955105 for vzlist). Which is the output I should trust of being more accurate? thank you
I can't speak for the others, but I think that you're making a big deal out of a minimal difference between two outputs.
I just wanted to know because this time the difference is small, but I don't know if it may be a bigger one... that is why I wanted to know which one i should trust...
You can check vzlist sources to find out how it calculates those numbers, and compare it with your own way.