CentOS VM High CPU Usage
CentOS VM High CPU Usage
I'm not sure I get this but I'm running SL 10.6.1 and VB 3.0.6.
I just tried to create a new VM running CentOS 5.3 with the VM Additions installed and idling is using 75% of my CPU. I have another VM of Kubuntu 9.04 and it idles at 15-25 %. I don't get how a full Desktop Environment uses less resources than a VM just running a console with no services installed other than default ones.
Anyone else see this before?
I just tried to create a new VM running CentOS 5.3 with the VM Additions installed and idling is using 75% of my CPU. I have another VM of Kubuntu 9.04 and it idles at 15-25 %. I don't get how a full Desktop Environment uses less resources than a VM just running a console with no services installed other than default ones.
Anyone else see this before?
-
Perryg
- Site Moderator
- Posts: 34369
- Joined: 6. Sep 2008, 22:55
- Primary OS: Linux other
- VBox Version: OSE self-compiled
- Guest OSses: *NIX
Re: CentOS VM High CPU Usage
This will help http://forums.virtualbox.org/viewtopic. ... 903#p89730
By the way I found this by using kernel divider=10 site:forums.virtualbox.org You can use your keywords followed with site:forums.virtualbox.org to search the entire forum using your favorite search engine
By the way I found this by using kernel divider=10 site:forums.virtualbox.org You can use your keywords followed with site:forums.virtualbox.org to search the entire forum using your favorite search engine
-
cyguy
- Posts: 5
- Joined: 2. Mar 2010, 22:55
- Primary OS: Mac OS X other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: CentOS
Re: CentOS VM High CPU Usage
I'm also having the same issues using VBox 3.1.4 and CentOS 5.4 x86_64 on a MacBook Pro 2.53 w/4 GB of ram running OS 10.6.2. Can one of you experts give me a step by step on how to set the divider to 10 for the kernel? This seems to be the best approach based on this threat for a newbie to Linux like me.
Thanx in advance,
Cyrus
Thanx in advance,
Cyrus
-
Perryg
- Site Moderator
- Posts: 34369
- Joined: 6. Sep 2008, 22:55
- Primary OS: Linux other
- VBox Version: OSE self-compiled
- Guest OSses: *NIX
Re: CentOS VM High CPU Usage
I don't have a problem with Cent-5.4 64bit but if you want to test this without actually changing (messing up) your grub then when the VM boots and you see the boot screen (CentOS) press the down arrow and you should be presented with a screen that you can select different kernels. press the "a" key and it will bring up an argument screen. at the end of the kernel argument put in a space then divider=10 and press enter. If this does solve your problem the you can edit the /boot/grub/menu.lst and make it permanent. You add the argument the same way. After quiet you put in a space then add divider=10. BE CAREFUL editing the grub file. You can make your VM where it will not boot. Make a backup.
-
cyguy
- Posts: 5
- Joined: 2. Mar 2010, 22:55
- Primary OS: Mac OS X other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: CentOS
Re: CentOS VM High CPU Usage
Perryg,
Thanx for the info. I was able to set divider=10 and it did quiet down CPU usage but its still running high, in 20s range while idle. Also surprised to hear the you are not seeing this in Cent 5.4 64bit and I am. I wonder if I've done something wrong or what I could have done wrong since I haven't done any tweaking or anything since I'm too green in Linux platform.
Going back to CPU usage...I'm currently responding to you from openSuSe 11.2 and VB CPU usage is sub 20%. I'm all ears if you have any suggestions to see why CentOS is so CPU intensive.
Thanx again.
Thanx for the info. I was able to set divider=10 and it did quiet down CPU usage but its still running high, in 20s range while idle. Also surprised to hear the you are not seeing this in Cent 5.4 64bit and I am. I wonder if I've done something wrong or what I could have done wrong since I haven't done any tweaking or anything since I'm too green in Linux platform.
Going back to CPU usage...I'm currently responding to you from openSuSe 11.2 and VB CPU usage is sub 20%. I'm all ears if you have any suggestions to see why CentOS is so CPU intensive.
Thanx again.
-
Perryg
- Site Moderator
- Posts: 34369
- Joined: 6. Sep 2008, 22:55
- Primary OS: Linux other
- VBox Version: OSE self-compiled
- Guest OSses: *NIX
Re: CentOS VM High CPU Usage
What happens if you set the processor to (1) on the guest?
I have noticed that some Hosts do not play well with SMP guests. (sorry I forgot to mention that. It has been working so well I don't think about it)
While setting up and testing 64 bit guests in Ubuntu 9.10 x86_64 I noticed a lot of high processor usage and by setting the processor to (1) instead of (2) the processor settled down to more like native.
Checking into why I found that the default kernel for Ubuntu 9.10 had set the Kernel Timer Frequency to 100Hz from 250Hz and they had set the PREEMPT to no.
Well this just will not work so I recompiled to the settings I knew would work and sure enough it did. I then switched to using the 2.6.32 kernel and low and behold everything is perfect.
I have no way to know if you are able to do this in a MAC but you might look into it if by switching to (1) processor seems to work better. Otherwise the 20% is not too bad.
Another thing if you are not using the newer version 3.1.4 of VirtualBox you should. It has better timing for SMP kernels.
I have noticed that some Hosts do not play well with SMP guests. (sorry I forgot to mention that. It has been working so well I don't think about it)
While setting up and testing 64 bit guests in Ubuntu 9.10 x86_64 I noticed a lot of high processor usage and by setting the processor to (1) instead of (2) the processor settled down to more like native.
Checking into why I found that the default kernel for Ubuntu 9.10 had set the Kernel Timer Frequency to 100Hz from 250Hz and they had set the PREEMPT to no.
Well this just will not work so I recompiled to the settings I knew would work and sure enough it did. I then switched to using the 2.6.32 kernel and low and behold everything is perfect.
I have no way to know if you are able to do this in a MAC but you might look into it if by switching to (1) processor seems to work better. Otherwise the 20% is not too bad.
Another thing if you are not using the newer version 3.1.4 of VirtualBox you should. It has better timing for SMP kernels.
-
cyguy
- Posts: 5
- Joined: 2. Mar 2010, 22:55
- Primary OS: Mac OS X other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: CentOS
Re: CentOS VM High CPU Usage
Yes, I have the ability to set the number of processors on a Mac and currently its set to 1.
Not so concerned about CPU usage when idle but while I'm using the VM it hovers at 100% draining my battery and the MacBook Pro like a hot plate.
Should make a couple of notes which I'm not sure if it has a bearing on my issues.
1. In the VM setup there was no option for CentOS for Linux version so I chose RedHat 64 bit. Does this make a difference? If so, what should I set this too.
2. For processor setting "Enable PAE/NX" is checked. Is this the correct setting?
3. My main use for CentOS at this point is to run Cisco's Packet Tracer. Could this be the cause of high CPU usage even thought Packet Trace is not being used?
I also have openSuSe VM which runs like any other app on my Mac but I can't fire up Packet Tracer. Has anyone installed Packet Tracer in openSuSe successfully?
As for CentOS version, how can I find which 3.1.4 version I'm running. Not clear what you mean by "newer version of 3.1.4". I just ran 3.1.4 updater. The package I downloaded was called VirtualBox-3.1.4-57640-OSX and I applied this to existing version which was VirtualBox-3.1.2-56127-OSX.
Not so concerned about CPU usage when idle but while I'm using the VM it hovers at 100% draining my battery and the MacBook Pro like a hot plate.
Should make a couple of notes which I'm not sure if it has a bearing on my issues.
1. In the VM setup there was no option for CentOS for Linux version so I chose RedHat 64 bit. Does this make a difference? If so, what should I set this too.
2. For processor setting "Enable PAE/NX" is checked. Is this the correct setting?
3. My main use for CentOS at this point is to run Cisco's Packet Tracer. Could this be the cause of high CPU usage even thought Packet Trace is not being used?
I also have openSuSe VM which runs like any other app on my Mac but I can't fire up Packet Tracer. Has anyone installed Packet Tracer in openSuSe successfully?
As for CentOS version, how can I find which 3.1.4 version I'm running. Not clear what you mean by "newer version of 3.1.4". I just ran 3.1.4 updater. The package I downloaded was called VirtualBox-3.1.4-57640-OSX and I applied this to existing version which was VirtualBox-3.1.2-56127-OSX.
-
Perryg
- Site Moderator
- Posts: 34369
- Joined: 6. Sep 2008, 22:55
- Primary OS: Linux other
- VBox Version: OSE self-compiled
- Guest OSses: *NIX
Re: CentOS VM High CPU Usage
(1) I used Debian
(2) should not matter
(3) Should use considerable CPU when running, but not 100%
When I asked about the number of processors I was talking about the guest. Have you tried setting the guest to (1) to see if it settles down?
You want the host to have as many processors/cores as possible.
Here is a screen shot of my CentOS 5.4 running on Ubuntu 9.10 (special kernel).
As you can see it is still loading and settling down but the cores are at 3% and the Host is at 10% (usually below 5% but this was at boot) Here is how mine is setup some info. X ed out
(2) should not matter
(3) Should use considerable CPU when running, but not 100%
When I asked about the number of processors I was talking about the guest. Have you tried setting the guest to (1) to see if it settles down?
You want the host to have as many processors/cores as possible.
Here is a screen shot of my CentOS 5.4 running on Ubuntu 9.10 (special kernel).
As you can see it is still loading and settling down but the cores are at 3% and the Host is at 10% (usually below 5% but this was at boot) Here is how mine is setup some info. X ed out
Code: Select all
name="CentOS-5.4"
ostype="Debian_64"
UUID="ea43892f-xxxx-xxxx-xxxx-xxxx"
CfgFile="/home/perry/.VirtualBox/Machines/CentOS-5.4/CentOS-5.4.xml"
hardwareuuid="ea43892f-xxxx-xxxx-xxxx-xxxx"
memory=1000
vram=12
cpus=2
synthcpu="off"
bootmenu="messageandmenu"
boot1="floppy"
boot2="dvd"
boot3="disk"
boot4="none"
acpi="on"
ioapic="on"
pae="on"
biossystemtimeoffset=0
hwvirtex="on"
hwvirtexexcl="on"
nestedpaging="on"
vtxvpid="on"
VMState="poweroff"
VMStateChangeTime="2010-03-05T15:10:33.489000000"
monitorcount=1
accelerate3d="off"
accelerate2dvideo="off"
teleporterenabled="off"
teleporterport=0
teleporteraddress=""
teleporterpassword=""
storagecontrollername0="IDE Controller"
storagecontrollertype0="PIIX4"
storagecontrollerinstance0="0"
storagecontrollermaxportcount0="2"
storagecontrollerportcount0="2"
storagecontrollername1="Floppy Controller"
storagecontrollertype1="I82078"
storagecontrollerinstance1="0"
storagecontrollermaxportcount1="1"
storagecontrollerportcount1="1"
"IDE Controller-0-0"="/home/perry/.VirtualBox/HardDisks/CentOS-5.4.vdi"
"IDE Controller-ImageUUID-0-0"="59bedcc8-xxxx-xxxx-xxxx-xxxx"
"IDE Controller-0-1"="none"
"IDE Controller-1-0"="emptydrive"
"IDE Controller-1-1"="none"
"Floppy Controller-0-0"="emptydrive"
"Floppy Controller-0-1"="none"
bridgeadapter1="eth0"
macaddress1=".............."
cableconnected1="on"
nic1="bridged"
nic2="none"
nic3="none"
nic4="none"
nic5="none"
nic6="none"
nic7="none"
nic8="none"
uart1="off"
uart2="off"
audio="pulse"
clipboard="bidirectional"
vrdp="off"
usb="on"
GuestStatisticsUpdateInterval=0
perry@perry-laptop:~$-
wahmed
- Posts: 2
- Joined: 8. Mar 2010, 00:48
- Primary OS: Mac OS X other
- VBox Version: OSE other
- Guest OSses: CentOS 5.4
Re: CentOS VM High CPU Usage
I see this behavior on both 64-bit and 32-bit version of Cent OS 5.4. Although i am not sure this is really a CentOS + Vbox issue. Anway the divider=10 did a lot for me. On a load average of 0.0 on the guest OS, it brought VirtualBoxVM CPU utilization from 75% to 25%. In term of temperature it mean a drop from 75 C to 62 C 
But anyway i think the CPU usage under these idle conditions should be further lower. Tomorrow if i get the time i'll transfer the VM to my Solaris 10 VirtualBox and see if i notice the same pattern there.
But anyway i think the CPU usage under these idle conditions should be further lower. Tomorrow if i get the time i'll transfer the VM to my Solaris 10 VirtualBox and see if i notice the same pattern there.
cyguy wrote:Perryg,
Thanx for the info. I was able to set divider=10 and it did quiet down CPU usage but its still running high, in 20s range while idle. Also surprised to hear the you are not seeing this in Cent 5.4 64bit and I am. I wonder if I've done something wrong or what I could have done wrong since I haven't done any tweaking or anything since I'm too green in Linux platform.
Going back to CPU usage...I'm currently responding to you from openSuSe 11.2 and VB CPU usage is sub 20%. I'm all ears if you have any suggestions to see why CentOS is so CPU intensive.
Thanx again.
-
cyguy
- Posts: 5
- Joined: 2. Mar 2010, 22:55
- Primary OS: Mac OS X other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: CentOS
Re: CentOS VM High CPU Usage
Thank you for all the great info. My main use for CentOS or any VM at this point is to run Cisco's Packet Tracer app which doesn't run on a Mac. I decided to use a Linux flavor vs Windows but haven't been successful to run Packet Tracer in conjunction with my assignments so I've resorted to run Windows as I'm losing precious studying time. Time permitting I will try and revisit this to see if I can solve it.
A note, of all the various VMs (CentOS 5.4, Fedora 12, OpenSuSe 11.2, Ubuntu 9.1, and Windows 7) CentOS is still a CPU hog in comparison to other VMs after making sure only 1 processor is being used on the host and setting divider=10.
A note, of all the various VMs (CentOS 5.4, Fedora 12, OpenSuSe 11.2, Ubuntu 9.1, and Windows 7) CentOS is still a CPU hog in comparison to other VMs after making sure only 1 processor is being used on the host and setting divider=10.