How to monitor RAM utilization of Guest VM running on Xen?
Linux - Virtualization and CloudThis forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
You set the amount of ram that a client can use. It will remain the same for as long as you have that setting.
To monitor a client you'd have to log on to them and then find out one at a time.
Do you suspect a memory leak in one of the clients?
We have set of 300 machines running under vm environment .We have written bash script which runs on Xen Server(takes data from XM top output).It help us to find out high and low CPU utilized machine.
As a result of this analysis we can then decide which machines are in use and which are not so that the resources(in term of VCPU)can be equally distributed.
However we are trying to attempt the same in case of RAM but the output of xm top for ram utilization is not up to the mark.So we are finding new ways to achieve this.
Manually logging into each vm guest is not possible.
They would have some protocol in common or at least one or two.
By this time you could have logged into them all.
If you want you can create some template on your admin system and either cut and paste or run them with small changes or such.
I have already written a script to monitor cpu load .
This script is already running on xen server and giving me an accurate result for each and every guest machine regardless of their operating systems.
I just want to figure out how would i incorporate ram load into it.
If you were able to run some script that could determine each client's cpu load from within the clients OS, then it would be a trival matter to construct one for ram usage either instantaneous or some measured or averaged metric.
If you were able to run some script that could determine each client's cpu load from within the clients OS, then it would be a trival matter to construct one for ram usage either instantaneous or some measured or averaged metric.
I guess you didn't understand the problem correctly.
There is a utility called xm top which run on server and displays the cpu and ram statistic of vm guests running under it.
The problem is the cpu statistic are very much correct but the ram statistic hardly reflect actual scenario.
You still do not know how a client in a VM uses ram.
The HOST assigns ram bases on how the config file is written. That amount is set and will not change as long as the machine is powered up.
Within each client it could vary as to how much ram is being used. The total amount would only be what the host config file has. The client could use way less or start using swap if built in client.
You can get a sort of clue as to the CPU usage by using top on the host. It would not be a true cpu use as it includes the client and it's associated vm support in the total.
That is why you seem to get some changes in the cpu and not in the ram. RAM is assigned in one shot at boot of client.
Like I said at the very start, you have to log in to each client to get any true memory results. There is no other way unless you create a VM that automagically assigns ram based on load and frees it when not needed. That will never happen.
You still do not know how a client in a VM uses ram.
The HOST assigns ram bases on how the config file is written. That amount is set and will not change as long as the machine is powered up.
Within each client it could vary as to how much ram is being used. The total amount would only be what the host config file has. The client could use way less or start using swap if built in client.
You can get a sort of clue as to the CPU usage by using top on the host. It would not be a true cpu use as it includes the client and it's associated vm support in the total.
That is why you seem to get some changes in the cpu and not in the ram. RAM is assigned in one shot at boot of client.
Like I said at the very start, you have to log in to each client to get any true memory results. There is no other way unless you create a VM that automagically assigns ram based on load and frees it when not needed. That will never happen.
If that is the case then How CPU information of Guest is Damn correct and RAM info is not.
I m talking about xm top output and not just top.
if you analyse xm top output you can see guest cpu is updating but guest ram is not.
If ram is allocated at boot time and host doesn't display the changing behavior of it.
then why would it be included in xm top ?
I can get the ram size using xm list only.
In VMware i get exact ram utilization just by sitting on host server.
Just compare the result of top and xm top you will see what i m talking about.
Still not convince over giving ram utilization in xm top.
Its of no use if they are giving it under xm top output as the command suppose to give online resource utilization of guest machines.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.