Fedora 27 Slowdown

Discussions about using Linux guests in VirtualBox.
Post Reply
jujumbura
Posts: 5
Joined: 27. Dec 2017, 20:02

Fedora 27 Slowdown

Post by jujumbura »

Hello all,

I have just recently installed a fresh image of Fedora 27 onto my Windows 10 VirtualBox host ( Version 5.1.30 r118389 (Qt5.6.2) ) . The installation seemed to go fine ( including the usual song and dance to get guest additions working ), but now when I run the Fedora 27 guest, the system will run for a few minutes before grinding to a halt. User interfaces ( like terminals, windows, etc. ) become slower and slower, until eventually they stop responding at all.

I have not had this problem on Fedora 26 or 25. Anybody experienced something similar, or have suggestions as to what I should check for errors, etc?

Thanks for your advice!
socratis
Site Moderator
Posts: 27330
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: Fedora 27 Slowdown

Post by socratis »

We're going to need to see a VM log from a complete VM run:
  • Start the VM from cold-boot (not from a paused or saved state) / Observe error / Shutdown the VM.
  • With the VM completely shut down (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.
jujumbura
Posts: 5
Joined: 27. Dec 2017, 20:02

Re: Fedora 27 Slowdown

Post by jujumbura »

Hello socratis,

I followed your instructions: ran my Vbox for about 8 minutes, observed some pretty awful UI slowdown, and saved the log. It is attached to this post.

Let me know if you need any more information!
Attachments
MikeFedora27-2017-12-28-17-30-12.zip
(39.77 KiB) Downloaded 17 times
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Fedora 27 Slowdown

Post by mpack »

I suggest not allocating 100% of available cores to the VM. The host needs CPU as well.
jujumbura
Posts: 5
Joined: 27. Dec 2017, 20:02

Re: Fedora 27 Slowdown

Post by jujumbura »

@mpack

I am not allocating all the cores on my machine, if that is what you mean. It's a 16 core machine ( Xeon, 2 processors ), and I am allocating 8 of them to the VM.
socratis
Site Moderator
Posts: 27330
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: Fedora 27 Slowdown

Post by socratis »

jujumbura wrote:I am not allocating all the cores on my machine
Yes, you are. According to VirtualBox you have the following:
00:00:05.419886 CPUM: Logical host processors: 16 present, 16 max, 16 online, online mask: 000000000000ffff
00:00:05.419888 CPUM: Physical host cores: 8
00:00:05.420226 Full Name: "Intel Xeon E5620 @2.40GHz"
and your processor according to Intel has 4 cores, times two = 8 for the grand total of cores, not 16. You have 16 "logical" cores. VirtualBox cares only for the physical ones. See the linked Intel page and click on the "?" sign for more information...
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.
jujumbura
Posts: 5
Joined: 27. Dec 2017, 20:02

Re: Fedora 27 Slowdown

Post by jujumbura »

Alright, then I'm confused.

If I bring up Settings/Processor for the Fedora27 VM, I see a slider that goes from 1 to 16 "CPUs". I currently have it set at 8, which is at the far right edge of the green region. If you are saying that VirtualBox only cares about physical cores and I have all 8 allocated, then what exactly is this dialog trying to convey? And what would setting it to 16 even mean?
Attachments
proc_settings.zip
(17.63 KiB) Downloaded 10 times
socratis
Site Moderator
Posts: 27330
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: Fedora 27 Slowdown

Post by socratis »

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.
Also:
frank in a [url=https://www.virtualbox.org/ticket/14944#comment:9]recent post[/url] wrote: Implementing 2 hyperthreads on a physical core makes perfectly sense for normal applications, in particular for code working directly on the CPU registers. The picture is completely different for VMs because a VM is a heavy-weight process: Before guest code can be executed there is a world switch necessary. Getting the timing right is always a problem with virtual machines and allowing the users to run 8 threads on a CPU with 4 physical cores with 2 hyperthreads per core would make this even more complicated.

If you insist on running such a setup then just feel free to do so and use 'VBoxManage modifyvm' to tune your settings but then please don't report bugs about messed-up guest timing.
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.
jujumbura
Posts: 5
Joined: 27. Dec 2017, 20:02

Re: Fedora 27 Slowdown

Post by jujumbura »

I see what you are saying about my machine having 8 physical cores, and 16 logical cores. And I can certainly see why I would not want all 8 of my physical cores allocated to the VM. But it is pretty confusing to me that the slider in the VirtualBox UI is set to 8 and goes to 16 ( implying logical cores ), and yet you are saying that internally it is actually using 8 physical cores. That seems like a mismatch between the UI and the internal settings if it is true. ( Out of curiosity, how were you seeing the number of cores consumed by VirtualBox in the log I sent? I can see where it lists my host machine specs, but not what the VM was using )

However, as a test, I started up my VM again with the CPU slider set to 4 instead of 8. I did a quick "grep -c ^processor /proc/cpuinfo" which spit out "4", so I believe it was really using that number. However, the same slowdown occurred as before, so I doubt that the CPU count is the cause of my issue. I have attached that log to this post as well.

If you have any other ideas on other possibilities, I'd be happy to try them. Thank you for your advice!
Attachments
MikeFedora27-2018-01-05-08-58-46.zip
(35.53 KiB) Downloaded 9 times
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Fedora 27 Slowdown

Post by mpack »

I do wish people would stop referring to "logical cores" or "virtual cores". A core is a piece of silicon, it is always physical. A CPU is always one chip, regardless of how many cores. The VirtualBox UI isn't entirely blameless either, referring to them as "virtual CPUs", I assume maintaining the fiction that the virtual motherboard has n separate chips, each with 1 core.

I would prefer "logical processors" myself.

And note that that a hyperthread is none of the above.
socratis
Site Moderator
Posts: 27330
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: Fedora 27 Slowdown

Post by socratis »

jujumbura wrote:Out of curiosity, how were you seeing the number of cores consumed by VirtualBox in the log I sent?
From the log of course, near the beginning:
00:00:04.500134   NumCPUs           <integer> = 0x0000000000000008 (8)
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