50-100% Cpu time with centos guest

Discussions related to using VirtualBox on Linux hosts.
Post Reply
devent
Posts: 9
Joined: 3. May 2008, 03:17

50-100% Cpu time with centos guest

Post by devent »

Hi, I just wonder if it's normal that I get 50 to 100% CPU load while running CentOS 5 32bit in Vbox.

I use the 1.6 Beta and 2.6.25-4.slh.8-sidux-686 #1 SMP PREEMPT Wed Jun 4 15:12:53 UTC 2008 i686 GNU/Linux host system. And the CentOS kernel is 1.6.18-53.1.21.el5.

The guest system is 99% idle. But the host get from 50 to 100% CPU load. I also have a network bridge for the guest.

I just tested it with Ubuntu 6.06, kernel 2.6.15-51-server. There I have 4 to 5% Cpu load on the host system.

Maybe it's because of the enabled PEA?

Tested on Ubuntu Server 8, it's normal. 5% Cpu load on host. (the guest is 2.6.24-18-server)
devent
Posts: 9
Joined: 3. May 2008, 03:17

Post by devent »

Well I just installed Vbox 1.6.2 and tested it with CentOs. It's the same, 50% to 100% CPU load while the guest CentOS is in idle.

Ubuntu Server is normal, so it's not the enabled PEA.
Have anyone CentOS as guest like me?
landtuna
Posts: 10
Joined: 5. Aug 2008, 20:24

Post by landtuna »

It's a little late, but, yes, I have this problem, too. :)
landtuna
Posts: 10
Joined: 5. Aug 2008, 20:24

Post by landtuna »

Try adding divider=10 to your kernel parameters.
h1d
Volunteer
Posts: 170
Joined: 3. Jul 2008, 02:10

Post by h1d »

I put the divider line to grub.conf and it's now at 35% when it was over 50% CPU usage when idle, but this still needs a better treatment, anyone got any clue?
kwanlowe
Posts: 6
Joined: 30. Sep 2008, 20:06

Seeing same issue with CentOS 5.2 guest

Post by kwanlowe »

Just wanted to add that I'm seeing the same issue with a CentOS 5.2 host and CentOS 5.2 guest, both 32-bit. One processor assigned to the VM (on the Dual Core host) gets pegged completely (so 50% overall).

It doesn't happen immediately when I start the VM, however.
stephanecharette
Volunteer
Posts: 300
Joined: 10. Nov 2007, 22:03
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu-64bit, Windows
Location: Kelowna, British Columbia, Canada
Contact:

Re: Seeing same issue with CentOS 5.2 guest

Post by stephanecharette »

kwanlowe wrote:Just wanted to add that I'm seeing the same issue with a CentOS 5.2 host and CentOS 5.2 guest, both 32-bit. One processor assigned to the VM (on the Dual Core host) gets pegged completely (so 50% overall).
All modern OSes know to yield, right? That wouldn't be the problem? (Asking SUN/VB, not the people experiencing the problem.)

CentOS must have "top" and perhaps something graphical like System Monitor. If you run "/usr/bin/top" or "/usr/bin/gnome-system-monitor" within the guest, what process is hogging the cpu?

Stéphane
kwanlowe
Posts: 6
Joined: 30. Sep 2008, 20:06

VM is idle

Post by kwanlowe »

All modern OSes know to yield, right? That wouldn't be the problem? (Asking SUN/VB, not the people experiencing the problem.)

CentOS must have "top" and perhaps something graphical like System Monitor. If you run "/usr/bin/top" or "/usr/bin/gnome-system-monitor" within the guest, what process is hogging the cpu?
That's part of the issue. The vm is completely dormant. The idle process witin the VM is at 99% but the host shows the CPU pegged from the VirtualBox instance. It's actually over the 50% whenever anything is occurring in the VM.

A strace on the host VirtualBox process doesn't reveal a whole bunch. A few poll() and clock_gettime() but nothing to indicate why it's spinning so hard.

Part of the problem does appear to be that the cpufreq daemon does not load under VirtualBox. On the host we can see:

[root@ice9 ~]# lsmod|grep ^cpu
cpufreq_powersave 6209 0
cpufreq_ondemand 12493 0

Under the VM however, the the acpi_cpufreq module does not load (No such device). This may not be possible under the VM, but not sure at this point.

I also checked some of the default kernel configs for that particular CentOS kernel, particularly the CONFIG_APM_CPU_IDLE flag (which is set).

This said, I have an equivalent machine running under Xen and VMWare that don't have this problem so it appears to be specific to VB versus some virtual machine configuration. The issue is not confined to the Core2Duo chipset either. VirtualBox running on an AMD XP2000+ (single core) shows 75% CPU utilization on the host when the VM is completely idle.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post by Sasquatch »

The VM is running idle, does it generate any network traffic like an IM client? What happens if you start a second VM set to NAT networking and let that run idle.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
kwanlowe
Posts: 6
Joined: 30. Sep 2008, 20:06

Post by kwanlowe »

The VM is running idle, does it generate any network traffic like an IM client? What happens if you start a second VM set to NAT networking and let that run idle.
No, absolutely nothing is happening in the VM, network or otherwise. In fact, I also noticed that when I shutdown the VM, after it was stopped at the "System Halted." message, it was still chewing CPU. In other words, there was no guest OS interaction at all.
sej7278
Volunteer
Posts: 1003
Joined: 5. Sep 2008, 14:40
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Solaris, Linux, Windows, OS/2, MacOSX, FreeBSD
Contact:

Post by sej7278 »

i've found the 100% cpu issue on centos 4.7 and xp64, however not on centos 5.2 or win2003 guests (fedora9 core2quad 64-bit and centos 5.2 athlonxp 32-bit hosts).

its obviously quite an issue judging by the number of threads on here about it, but there seems to be no response/fix from sun - only a few hacks that help [a little] from end users - like tickless or acpi kernels in the guests; hell if i wanted to have to hack at the guest kernel i would have gone with xen!
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post by Sasquatch »

There is another problem to this issue. I didn't have this problem before. Now, I seem to get it every now and then, where I have my VM running idle and my CPU is 50% (one core loaded). This makes it very hard to track it down.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
sej7278
Volunteer
Posts: 1003
Joined: 5. Sep 2008, 14:40
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Solaris, Linux, Windows, OS/2, MacOSX, FreeBSD
Contact:

Post by sej7278 »

setting the "divider=10" kernel parameter on my [centos 4.7] guest's grub.conf seems to have fixed it for me - disabling acpid and cpuspeed did nothing.
fixedwheel
Volunteer
Posts: 1699
Joined: 13. Sep 2008, 02:18

Post by fixedwheel »

sej7278 wrote:disabling acpid and cpuspeed did nothing.
did you try acpi=off as kernel parameter in /boot/grub/menu.lst (or grub.conf whatever...)?
ScottD
Posts: 1
Joined: 1. Sep 2009, 18:57
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: FreeBSD, Ubuntu

Re: 50-100% Cpu time with centos guest

Post by ScottD »

I see a single CPU saturated when I run a single guest,
even when that guest is doing no more than waiting at
the install prompt. I'm running a quad-core AMD, and
ubuntu 9.04. The system monitor shows one CPU pegged
(with occasional swaps to a different CPU). In trying to
track down the problem, I've discovered that adding
a second instance doing nothing brings all the core activity
down to near-nothing.

There is definitely something troublesome going on, but I
have an adequate work-around (always open two guests).
Post Reply