LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization
User Name
Password
Linux - Virtualization This forum is for the discussion of all topics relating to Linux Virtualization. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices

Reply
 
LinkBack Search this Thread
Old 11-25-2010, 12:21 AM   #1
beowulfnode
Member
 
Registered: Jun 2007
Posts: 30

Rep: Reputation: 2
Question how much ram to allocate to a guest vm


I have a VMware ESXi 3.5 hypervisor host with a bunch of guest VMs on it. I am looking to add more VMs but would like to reclaim some RAM from some linux guests, without having to install vmtools to obtain the balloon driver, (which steals memory from running VMs when the host needs it, possibly for higher priority VMs).

Anyway on CentOS 5.5 x86 how can I tell how much ram a running machine actually needs?

I've spotted one particular machine I'll use as an example. This one has 1GB of RAM allocated to it, however it is doing very little, it does not have a gui, web server, database, bind, or dhcpd. It's only running sshd and openvpn to route about 1mbps of traffic.

So I run the free -t -m command with the below results
Quote:
# free -t -m
total used free shared buffers cached
Mem: 1010 731 279 0 168 513
-/+ buffers/cache: 49 961
Swap: 2055 0 2055
Total: 3065 731 2334
Do you think the 49 listed as used on the buffers/cache line is indicative of how much memory is actually needed?

Looking at the ESXi monitoring charts the "Memory Usage (Average)" fluctuates from about 40~60MB

On the surface this sounds like I can safely cut the ram allocated to the VM down to 64MB. However, I'm wondering how much of the buffers and cache can be dropped before performance is impacted? On other workstation systems and higher load servers I normally find that having about 50% ram used for cache provides good performance. However that's assuming that the server does frequent file io, this server does not have much file io either. Over the last hour it has not done any disk reads, every 5mins it does about 20KB/s disk writes.

Also, importantly, how low can I go and have CentOS 5.5 still boot?

Last edited by beowulfnode; 11-25-2010 at 12:25 AM. Reason: correction
 
Old 11-25-2010, 06:22 AM   #2
TobiSGD
Guru
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Slackware
Posts: 7,569
Blog Entries: 2

Rep: Reputation: 1671Reputation: 1671Reputation: 1671Reputation: 1671Reputation: 1671Reputation: 1671Reputation: 1671Reputation: 1671Reputation: 1671Reputation: 1671Reputation: 1671
CentOS manual notes 256MB RAM as miniumum system requirements, I wouldn't go much below that.
 
Old 11-25-2010, 04:36 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 10,458

Rep: Reputation: 623Reputation: 623Reputation: 623Reputation: 623Reputation: 623Reputation: 623
In the mainframe world (where they've been doing virtualization for over 30 years) this is handled by reducing the guest until it (just) starts to swap. Then add a small bit of leeway.
If your guest boots and doesn't page swap at 64 Meg, leave it at that. KISS.

Linux page cache as a performance metric is (almost) useless as there's no way to tell the "age" of cache pages (from userspace). Keep an eye on I/O wait and swap.

Last edited by syg00; 11-25-2010 at 05:03 PM.
 
Old 11-26-2010, 02:35 AM   #4
beowulfnode
Member
 
Registered: Jun 2007
Posts: 30

Original Poster
Rep: Reputation: 2
well I cut it back to 256mb rebooted, it looked fine, so I cut it back to 128mb and it looked fine, so I left it like that during a days work and it performed fine, all the while memory stats were much like

# free -t -m
total used free shared buffers cached
Mem: 122 103 19 0 17 65
-/+ buffers/cache: 20 102
Swap: 2055 0 2055
Total: 2177 103 2074

except if I ran yum list updates while running screen and top in an ssh session then memory usage -buffers/cache would surge up to about 75MB so I think I'll leave it at 128MB and leave it at that. Interestingly though, the quiescent used - buffers/cache memory has better than halved going from 49 to 20MB. Do you think the smaller kernel memory management tables are responsible for most of that? I wonder if cutting the swap space down would make a similar reduction. Perhaps I should try it on a testing server and see how low can you go.

After this initial round of changes on 2 out of the 6 VMs I've regained nearly 2GB of ram allocation, so I'm quite happy with that, enough for another few servers.
 
Old 11-26-2010, 04:35 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 10,458

Rep: Reputation: 623Reputation: 623Reputation: 623Reputation: 623Reputation: 623Reputation: 623
Quote:
Originally Posted by beowulfnode View Post
Do you think the smaller kernel memory management tables are responsible for most of that?
Nope - that will be (almost) inconsequential.
Quote:
I wonder if cutting the swap space down would make a similar reduction. Perhaps I should try it on a testing server and see how low can you go.
Do not reduce swap space - especially if reducing RAM. Better to increase it to cover unforeseen spikes.
Screwing around on test boxes is good - but only if you can reasonable reproduce production environment(s).
 
  


Reply

Tags
allocation, guest, ram, vm


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem installing guest additions on virtualbox Centos 5.5 64bit guest eljay313 Linux - Virtualization 1 09-03-2010 08:22 AM
not able to allocate more then one cpu to my guest os in xen-3.0.3 vipinazad Linux - Virtualization 0 07-21-2010 09:45 AM
How do I install/enable compiz fusion in slack 12.2vm 64mb vid. ram vbox guest add. dustin2128 Linux - Desktop 1 07-01-2009 05:42 AM
Is it because of RAM ? pls help:::Guest Install Error anant Linux - Newbie 6 12-12-2006 09:00 AM
"Failed to allocate mem resource" with Broadcom BCM5704 and 8GB of RAM Xaox Linux - Hardware 5 02-15-2006 03:52 PM


All times are GMT -5. The time now is 02:06 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration