How to monitor OpenVZ swap memory usage under proxmox?

Jan 26, 2011
82
2
6
As I've come to find out, you can't monitor swap memory usage using the usual "free" command in OpenVZ as it always reports zero. This is because swap is handled by the HN.

However, I found this great utility, vzfree, that is supposed to solve the issue. You can read about it here:

http://www.webhostingtalk.com/showthread.php?t=996681

Unfortunately it doesn't seem to work under proxmox. At least not in a CentOS 4 container where I'm trying it. Here's what I get on a freshly created CentOS 4 container that I allocated 1995M of RAM and 3990M of SWAP to:

Code:
# ./vzfree
             Total     Used     Free
Kernel:   8796093022208.00M    1.91M 8796093022206.09M
Allocate: 5985.00M   20.21M 5964.79M (5985M Guaranteed)
Commit:   5985.00M   11.59M 5973.41M (47.9% of Allocated)
Swap:                 0.00M          (0.0% of Committed)
I don't know what "Kernel" ram refers to, but I'm pretty sure that "Total" vzfree is showing here is not correct. :p

It doesn't seem to be the fault of the vzfree utility... the raw user_beancounters data looks wrong:

Code:
# cat /proc/user_beancounters | grep -E '(uid|physpages|oomguarpages)'
       uid  resource                     held              maxheld              barrier                limit              failcnt
            physpages                    2524                20735                    0  9223372036854775807                    0
            oomguarpages                 2525                20735              1532160  9223372036854775807                    0
Does memory management work differently under proxmox than a usual OpenVZ setup?

The physical machine has 2GB of RAM... so I basically want to monitor when the HN is swapping, but from inside the container.

Sorry if this is a dumb question... I'm new to both proxmox and OpenVZ.

Thanks,

Curtis
 
Last edited:
Never mind... I was simply comparing the values from vzfree and user_beancounters from my VM to that which other OpenVZ users had posted (non-proxmox users) and thought that the 9223372036854775807 values I was seeing in my output looked broken. Apparently, these are the normal default values for Proxmox.

That being said, it seems vzfree can be a useful utility for monitoring swap usage from within the container.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!