LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This 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


Reply
  Search this Thread
Old 07-12-2011, 04:41 AM   #1
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Rep: Reputation: 37
How to monitor RAM utilization of Guest VM running on Xen?


Is there any way i can monitor RAM utilization of VM guests running on xen server?

I tried running xm top.But it was not updating the ram utilization.

used below article to generate ram load in guest vm.
http://learnlinuxwithrohan.blogspot....M%20monitoring

Even though i was able to see significant ram utilization in guest vm,it was not getting reflected in xm top output under RAM(%) column.

Please guide.
 
Old 07-12-2011, 07:54 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,980

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
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?
 
Old 07-13-2011, 12:25 AM   #3
pinga123
Member
 
Registered: Sep 2009
Posts: 684

Original Poster
Blog Entries: 2

Rep: Reputation: 37
Quote:
Originally Posted by jefro View Post
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.
 
Old 07-13-2011, 05:23 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,980

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
Then push a script to them to report back to some database.
 
Old 07-13-2011, 11:20 PM   #5
pinga123
Member
 
Registered: Sep 2009
Posts: 684

Original Poster
Blog Entries: 2

Rep: Reputation: 37
Quote:
Originally Posted by jefro View Post
Then push a script to them to report back to some database.
Guest machines are mixture of different operating systems. How would i write a generalized script?

It would have been great if xen has some feature to determine this.
 
Old 07-14-2011, 03:01 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,980

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
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.
 
Old 07-14-2011, 11:09 PM   #7
pinga123
Member
 
Registered: Sep 2009
Posts: 684

Original Poster
Blog Entries: 2

Rep: Reputation: 37
Quote:
Originally Posted by jefro View Post
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.
 
Old 07-15-2011, 03:26 PM   #8
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,980

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
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.
 
Old 07-20-2011, 06:40 AM   #9
pinga123
Member
 
Registered: Sep 2009
Posts: 684

Original Poster
Blog Entries: 2

Rep: Reputation: 37
Quote:
Originally Posted by jefro View Post
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.
 
Old 07-20-2011, 05:32 PM   #10
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,980

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
Ram is then the ram used by the host not the load in the actual clients.
 
Old 07-20-2011, 11:44 PM   #11
pinga123
Member
 
Registered: Sep 2009
Posts: 684

Original Poster
Blog Entries: 2

Rep: Reputation: 37
Quote:
Originally Posted by jefro View Post
Ram is then the ram used by the host not the load in the actual clients.
I was talking about xm top output.
any one who has worked on xen server might have some idea what i m talking about?
 
Old 07-21-2011, 02:42 PM   #12
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,980

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
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.

Last edited by jefro; 07-21-2011 at 02:43 PM.
 
Old 07-21-2011, 11:55 PM   #13
pinga123
Member
 
Registered: Sep 2009
Posts: 684

Original Poster
Blog Entries: 2

Rep: Reputation: 37
Quote:
Originally Posted by jefro View Post
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.

Last edited by pinga123; 07-21-2011 at 11:59 PM.
 
Old 07-22-2011, 05:42 PM   #14
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,980

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
Ram is allocated as a block.

CPU is never allocated, it is shared.
 
1 members found this post helpful.
Old 07-24-2011, 10:21 PM   #15
pinga123
Member
 
Registered: Sep 2009
Posts: 684

Original Poster
Blog Entries: 2

Rep: Reputation: 37
Quote:
Originally Posted by jefro View Post
Ram is allocated as a block.

CPU is never allocated, it is shared.
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.

Jefro: Did you check xm top output?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Guest System with Xen harshaabba Linux - Software 3 06-22-2011 02:17 PM
RAM Utilization in ORACAL Database server. LINUXQueAns Linux - Software 4 03-09-2011 02:44 PM
LXer: Xen: How to Convert An Image-Based Guest To An LVM-Based Guest LXer Syndicated Linux News 0 04-19-2009 04:00 PM
Sending alert if CPU or RAM or Disk reaches 90% utilization dhanju Linux - Server 2 08-18-2008 10:07 AM
How to run RHEL 4 as guest in Xen(SLES 10 XEN) darshanbv Linux - Software 1 06-26-2006 11:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 09:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration