Windows 10 Performance w/ Ryzen CPU?

Discussions related to using VirtualBox on Windows hosts.
Post Reply
bambino
Posts: 3
Joined: 17. Jun 2017, 22:05

Windows 10 Performance w/ Ryzen CPU?

Post by bambino »

Hello all,

I have a machine with a Ryzen 1700X CPU and 32GB Ram with a 1TB SSD. I have created 6x VirtualBox guests with Windows 10 and assigned 2.5GB Ram and 2 cores to each.

The problem I have is with the CPU usage being very high with barely anything open. I can open just one instance of Firefox & one instance of Chrome and the CPU usage will shoot up to 99%. It will drop down to 30-50% afterwards but even that is very high considering it's just sitting idle, no?

If I open a video or anything it will be 99% CPU usage until the video is gone. Anything that even slightly uses the CPU seems to be using it at 10x the rate that it should be using. The machines are dual core, there is no reason that opening a browser should shoot it up to 99% and make it as slow as it does, and if I open like 4 instances of browsers and leave them open it'll just stay around 80-99% if each one is on a website with some graphic or gif on it.

At first I thought perhaps the issue may be with the fact that I have Ryzen, but I'm not sure (I guess there is no optimization yet right?). I have SMT enabled and VT-X/AMD-v and Nested Paging with the Paravirtualization set to "Default" (wasn't sure what to pick) and PAE/NX is not enabled.


I have assigned 256MB of video memory and 2D + 3D video acceleration.

However, even if sites I visit do not use any 2D/3D stuff it will still be quite laggy. Basically the whole problem is that the CPUs seem weak on the machine even though they have 2 cores.

I am not running all 6 VMs at once when testing this, just one at a time. That being said, I CAN run all 6 at the same time and they do work decently well, I have some automation and processing scripts running on them and even with 99% CPU on each one they do seem to be working fine and completing the tasks they should be, but its just very slow (like if I even try to type it will take 2 seconds per character to show up).

Is this a known problem with Ryzen CPUs right now or have I configured something wrong?

Here's a quick run-down of all the VM information incase i missed anything:

- Host Machine: 1700x 8-core 16 thread CPU OC'd to 3.6GHz, 32GB DDR4 Ram, 1TB SSD, MSI R9 390X 8GB
- VMs #1 - #6: 2 core assigned, 100% execution cap, PAE/NX disabled, Paravirtualization DEFAULT, VT-X/AMD-v enabled, Nested Paging enabled, 256MB Video Memory, 2D acceleration enabled, 3D accel. enabled, 60GB SSD w/ Host IO Cache enabled & SSD option ticked for the drive.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Windows 10 Performance w/ Ryzen CPU?

Post by socratis »

Follow a "start the VM from cold-boot" / "observe error" / "shutdown the VM" cycle. With the VM shut down completely (not paused or saved), right-click on the VM in the VirtualBox Manager and select "Show Log". Save only the first "VBox.log", ZIP it and attach it to your response (see the "Upload attachment" tab below the reply form).
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
bambino
Posts: 3
Joined: 17. Jun 2017, 22:05

Re: Windows 10 Performance w/ Ryzen CPU?

Post by bambino »

Attached. I was testing some things but nothing resulted in any changes. For this log I think I have PAE/NX enabled and 2D + 3D accel. disabled and changed it to 1 core. A single Chrome instance had me at 90% CPU on a blank tab completely idle. Some other Windows OS processes and other things were active too and just happen to be using a lot of CPU like explorer would be using 5-10%, svchost using 5-10%, it just seems like everything is using much more CPU than it should considering the hardware.

Also, if I have a Ryzen 8 Core 1700X and 3.6GhZ, what do you recommend for how I should distribute the CPU to the VMs? I need 6 VMs and each one ideally needs 2 cores but I know that's more cores than I have, each machine is running some basic scripts and stuff so it won't use 100% CPU (or atleast it SHOULDN'T) but yeah. What's the best way to distribute CPU power for 6 VM setup?
Attachments
VBOX.log
(100.47 KiB) Downloaded 33 times
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Windows 10 Performance w/ Ryzen CPU?

Post by socratis »

  1. You do not have 2D or 3D acceleration enabled. You should definitely enable them.
  2. You do not have the Guest Additions installed. You should definitely install them. See ch. 4. Guest Additions.
  3. In Chrome specifically, disable the 3D acceleration from within Chrome's preferences.
As for the CPUs and the RAM, the usual recommendation for allocating resources to a VM (or more) is as follows:
  • Sum(virtualCPUs) < physicalCPUs (note that it's "<", not "<=").
  • Sum(RAM+videoRAM) < availableHostRAM. You've got to calculate a couple (maybe 100 MB) for overhead.
People have been using more allocated resources, mainly because they can. But you might run into strange problems. My favorite quoted message:
Ramshankar in a [url=https://forums.virtualbox.org/viewtopic.php?f=1&t=79734#p373129]recent post[/url] wrote:
Why is it a bad idea to allocate as many VCPUs as there are physical CPUs?

You cannot have the best of both worlds. Most modern Intel CPUs have VT-x preemption timers, which VirtualBox has been using for years now. This lets us run chunks of guest code and still get interrupted to run host code depending on how we program the preemption timer. However, the question is not whether we can or cannot interrupt guest code, we normally can. The problem is that there are tasks that require to be run in reasonable frequency & amount of time both on the host *and* the guest. If you starve the host or guest of interrupts or introduce latency because there simply isn't enough compute power available, you will be creating bottlenecks.

Getting in and out of executing guest code via VT-x is still quite an expensive operation. We call it a world-switch or world round-trip, (i.e. VM-entry, execute guest, VM-exit). This is done in ring-0 (kernel) on the host, sometimes (especially on Windows hosts) we are forced to return all the way to ring-3 sometimes in order to satisfy DPC (Deferred Procedure Call) latency. Overall, you're going to have strange latencies introduced in unexpected places if you "overcommit". It is totally possible to run 4 VCPU VM on a 4 CPU host (I do it on my own my Linux dev box sometimes) but it is not something you should be doing if you care about reasonable performance; in extreme cases of overcommitment you may encounter program misbehavior (like when disk requests times out) which the programs are never designed to handle. In the not so severe case you may end up with some strange timeouts but not fatal errors.
PS. I still don't know why people don't see the "ZIP it" part for the VBox.log. I capitalized, underlined, made it bold. Nope...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
bambino
Posts: 3
Joined: 17. Jun 2017, 22:05

Re: Windows 10 Performance w/ Ryzen CPU?

Post by bambino »

Okay, thanks. Either Guest Additions or reducing the core count did the trick. I made them all 1 core and since I have 8 cores, running all 6 at once was going to ensure that its less than my physical core count. Set them all up and enabled 2D/3D again as I originally had it and booted them all up, all 6 are running fine now and feel not only more responsive visually with the mouse & typing (probably due to Guest Additions here) but also the CPU usage even on the machines doesn't instantly go to 99% now even if I run multiple things even though they all have 1 core now instead of 2.

Thanks :)
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Windows 10 Performance w/ Ryzen CPU?

Post by socratis »

bambino wrote:Either Guest Additions or reducing the core count did the trick.
I believe a little bit of both, but mostly the GAs, since you were mentioning issues with one VM only. The CPU-based software rendering can be a burden.

Glad you got it resolved... ;)
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply