50% CPU usage when moving cursor

Discussions about using Windows guests in VirtualBox.
Post Reply
alkizmo
Posts: 8
Joined: 21. Sep 2015, 16:22

50% CPU usage when moving cursor

Post by alkizmo »

I'll start with the setup information:

I have a second desk, with a second monitor, keyboard and mouse.
The mouse and keyboard are in the USB filter list.
Someone sitting at the 2nd desk can work on the guest OS at the same time that someone else is using the host OS's desk.

Host hardware:
i5 2500K @ 4.5ghz
16GB DDR3
250GB SSD (Guest OS is in a virtual file within that drive)
R9 290X

Guest OS: W10 x64 (Guest Additions installed)
Host OS: W10 x64

ICH9 chipset emulation
OHCI USB 1.1
I/O API ENABLED
Intel VT-X ENABLED (In host BIOS as well)
EFI bios ENABLED
2D/3D acceleration ENABLED
PAE/NX ENABLED
nested paging ENABLED


Here's the issue

Simply moving the cursor around in the guest OS causes the host CPU load to jump to 40%-50%
Ironically enough, playing a 1080p youtube video in the guest OS uses also around 50%
If nothing moves on the guest OS, the CPU load drops back down to 0% - 1%

Another issue with the cursor is whenever the Guest OS has a load (loading up a webpage, program, etc), the cursor will freeze/stutter.

Is this the performance to expect out of this guest OS? Or should I be getting better results?
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: just about all that run

Re: 50% CPU usage when moving cursor

Post by loukingjr »

Since Windows 10 is not yet supported as a host or guest, any reply is subject to change.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
alkizmo
Posts: 8
Joined: 21. Sep 2015, 16:22

Re: 50% CPU usage when moving cursor

Post by alkizmo »

loukingjr wrote:Since Windows 10 is not yet supported as a host or guest, any reply is subject to change.
Strange, I see it in the drop-down list to pick Windows 10 64 bit when I create a new appliance.

That being said, would I expect the same sort of performance with the latest supported version of Windows?
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: just about all that run

Re: 50% CPU usage when moving cursor

Post by loukingjr »

Windows 10 is in the drop down menu so those who want to try can before it's officially supported. As far as performance, I haven't installed Windows 10 as a guest on my Windows 10 host so I can't say if I have the same results.

You can attach the VBox.log for the guest (zipped) here and it will be looked at.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
alkizmo
Posts: 8
Joined: 21. Sep 2015, 16:22

Re: 50% CPU usage when moving cursor

Post by alkizmo »

Here is the log.

I found an interest line that repeats often

Code: Select all

OHCI#0: Lagging too far behind, not trying to catch up anymore. Expect glitches with USB devices
So, would this sort of "performance issue" be normal with support Windows OS?
Attachments
VBox.zip
(25.21 KiB) Downloaded 3 times
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: just about all that run

Re: 50% CPU usage when moving cursor

Post by loukingjr »

Your CPU, an Intel i5-2500K, has 4 cores and no hyperthreading. You have all 4 cores assigned to the guest. Reduce the number of cores to the guest to two. See how that works for you.

I couldn't tell if the guest additions were correctly installed or if there were errors because you posted an incomplete log. Start the guest then shut it down, then attach the VBox.log.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
alkizmo
Posts: 8
Joined: 21. Sep 2015, 16:22

Re: 50% CPU usage when moving cursor

Post by alkizmo »

Here's a new fresh log. You won't notice the USB lagging message from last time since the second desk station was disconnected (Plugged to a laptop for now).

I noticed at the same time that if I use the host mouse instead of the dedicated mouse (USB filtered device), there is no mouse lag, however, the CPU usage is still the same, such as just moving the cursor uses 50% CPU.
Attachments
VBox.zip
(30.47 KiB) Downloaded 3 times
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: just about all that run

Re: 50% CPU usage when moving cursor

Post by loukingjr »

What I first noticed is you didn't try my suggestion…
00:00:03.532467 NumCPUs <integer> = 0x0000000000000004 (4)
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
alkizmo
Posts: 8
Joined: 21. Sep 2015, 16:22

Re: 50% CPU usage when moving cursor

Post by alkizmo »

loukingjr wrote:What I first noticed is you didn't try my suggestion…
00:00:03.532467 NumCPUs <integer> = 0x0000000000000004 (4)

Sorry, I was focused on getting a full log before going to work. I will run a test tonight when I go back home.
alkizmo
Posts: 8
Joined: 21. Sep 2015, 16:22

Re: 50% CPU usage when moving cursor

Post by alkizmo »

Your advice was right. I tested with 4, 2 and 1 cores by doing the exact same tasks, each test ran for the span of about 2 minutes.

The biggest difference was when I played Gangnam Style in 1080p on youtube.
4core - Very laggy
2core - Almost acceptable
1core - Smooth

I added the logs for 4,2 and 1 core along with a CPU core load graph for each test (Bonus graph for host OS playing the same video).
What surprises me with the CPU core graphs is that even at 2 or 1 core, all 4 cores somewhat get dragged up in the boot up and window dragging. The difference in cores is only very apparent when playing the youtube video.

I have yet to test using the dedicated desk station to see if the mouse stutters.


I know this is the result of your recommendation, but I have to ask.... is this supposed to be the most efficient setup? The Virtualbox configuration guide does not warn against using all cores.

Bonus question: Is it possible that something else is causing a bottleneck? As you can see in the 4-core graph, youtube is not using all the processing power of the CPU, yet the video was lagging a lot. Why didn't it try to access more processing power?
Attachments
Logs.zip
(480.27 KiB) Downloaded 4 times
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: just about all that run

Re: 50% CPU usage when moving cursor

Post by loukingjr »

You have to keep in mind the host also needs access to the CPU in order to run VirtualBox along with the guest. Basically with all cores assigned to the guest the host and guest have to fight for control. It's even worse with no hyperthreading. Two cores should have been optimal but I noticed you have the wrong guest additions installed…

Code: Select all

00:00:07.472124 VMMDev: Guest Additions information report: Version 5.0.0 r101436 '5.0.0_RC3'
You need to update them from the VB Devices menu> "Insert Guest Additions CD Image…"

You may want to reduce the guest's RAM from 6GB to 4GB. Unless you have some compelling reason not to.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
alkizmo
Posts: 8
Joined: 21. Sep 2015, 16:22

Re: 50% CPU usage when moving cursor

Post by alkizmo »

loukingjr wrote:You have to keep in mind the host also needs access to the CPU in order to run VirtualBox along with the guest. Basically with all cores assigned to the guest the host and guest have to fight for control. It's even worse with no hyperthreading.
That's a shame. I was hoping for the smoothest load balance possible so that the host OS can have 4 threads with equal available cycles.
Anyhow, the host and guest are seldom used at the same time, so it shouldn't be a big deal.

Long story short: 75% of the purpose for the guest OS is for location. The guest OS desk station is on a different floor than the host's desk station. 25% of the raison-d'être is that my wife and I don't occasionally clash with the controls if we're both using the desks at the same time.
loukingjr wrote:Two cores should have been optimal but I noticed you have the wrong guest additions installed…

Code: Select all

00:00:07.472124 VMMDev: Guest Additions information report: Version 5.0.0 r101436 '5.0.0_RC3'
You need to update them from the VB Devices menu> "Insert Guest Additions CD Image…"
Hmmm that might be part of the issue I guess. When I was fiddling with the initial installation of the OS, I tried to uninstall the GA because I wanted to permanently disable mouse integration*.

The uninstall failed (VM froze) and I had to reboot. Once rebooted, I realized that without GA, I can't use 2D acceleration, so I tried to reinstall, but the installation failed (Error about a file having been modified). By googling for answers, someone posted to try to use a high version of GA. The installation was a success, but I guess it isn't optimal.

*The USB filtered mouse (Dedicated)'s cursor is invisible. It can click, drag, etc, but you can't see the cursor. I need to disable mouse integration to be able to see the cursor move with the dedicated mouse. This needs to be done every time I boot the VM. Do you know of a way to permanently disable it?
loukingjr wrote:You may want to reduce the guest's RAM from 6GB to 4GB. Unless you have some compelling reason not to.
I have 16GB of ram and my host has trouble using even half of it :oops:
If it's more optimal to use 4GB, I will reduce it.

Since I can't seem to install/uninstall GA properly, I will rebuild the VM from scratch. Anyway I didn't really do anything to the OS other than install Chrome.

Thanks for the help! It's already a lot better than initially. I will report back on the result with a fresh installation and a proper GA.
alkizmo
Posts: 8
Joined: 21. Sep 2015, 16:22

Re: 50% CPU usage when moving cursor

Post by alkizmo »

OK, so after rebuilding a new machine from scratch, the performance is the same.

I guess I will stick to single core for now.

Thanks again for the help!
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: just about all that run

Re: 50% CPU usage when moving cursor

Post by loukingjr »

You're Welcome. To be honest I haven't used a non-hyperthreaaded CPU since 2007 and before I ever heard of VirtualBox so I don't know how that might affect performance.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
Post Reply