Performance leak on Linux Guest

Discussions about using Linux guests in VirtualBox.
Post Reply
Renovare
Posts: 4
Joined: 19. Dec 2018, 17:59

Performance leak on Linux Guest

Post by Renovare »

I'm running a Linux guest (Peppermint 9 distro) on a Windows 7 host as a python computation terminal.

The virtual machine gets 6 CPU's of my 8 thread i7, 4Gb RAM and I set it chewing on calculations for days at a time.

The computations I'm running come in regularly sized chunks that take about the same time to process. What I've noticed over the last month is that the calculations have been getting slower and slower. Something that used to take 4 hours, started taking 9 hours and finally ended up taking 13 hours. As with most code developments the code is forever changing so I went back and took out old copies of the code and compared to earlier timed benchmarks and yup, they now run slow too.

I've been through various combinations and comparisons. I've tried different Ubuntu distros (Ubuntu, Xubuntu, Peppermint), different versions of Vbox (5.2.18, 5.2.20 and 6.0.0) and updated the Guest additions. I've checked the CPU using Intel tools and it's all running perfectly. I've checked the BIOS for Virtualization support (on), double checked any kind of performance related to power sources and wandered the forums for similar problems. I'm stumped.

The final nail in the coffin was when I installed VMware Workstation and recreated an identical VM. This runs as I would expect with that 4 hour calculation taking 4 hours.

Can't really put my finger on anything solid as to what is wrong..... but something is not right.....

Here is the most recent log file:
VBoxSVC.log
6.0.0 Log File
(13.88 KiB) Downloaded 10 times
Any pointers would be much appreciated :)
Renovare
It's time for something renewable..
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: Performance leak on Linux Guest

Post by socratis »

That's not the correct log I'm afraid. We need the VBox.log, ZIPPED.
  • Start the VM from cold-boot (not from a paused or saved state) / Observe problem / Shutdown the VM.
  • With the VM completely shut down, 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.
Renovare wrote:Can't really put my finger on anything solid as to what is wrong
Any 3rd party antivirus?
Renovare wrote:The virtual machine gets 6 CPU's of my 8 thread i7
That sounds wrong. You shouldn't allocate more than your cores to a VM, not threads, cores. A typical i7 has 4 cores/8 threads. Remember that simple rule:
  • Total CPUs for your guests + 1 Host CPUs.
  • Total RAM+vRAM+overhead for your guests Host available RAM + some.
 Edit: Fixed the math of the "simple rule", it was "simply wrong". 
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.
Renovare
Posts: 4
Joined: 19. Dec 2018, 17:59

Re: Performance leak on Linux Guest

Post by Renovare »

socratis wrote:That's not the correct log I'm afraid. We need the VBox.log, ZIPPED.
Okay. Let's try this one:
VBox.zip
Virtual Machine Log
(32.76 KiB) Downloaded 13 times
socratis wrote:
Renovare wrote:Can't really put my finger on anything solid as to what is wrong
Any 3rd party antivirus?
None on the VM. Antivirus is managed by the IT department. As far as I can tell it's System Center Endpoint Protection and Malwarebytes.
socratis wrote:
Renovare wrote:The virtual machine gets 6 CPU's of my 8 thread i7
That sounds wrong. You shouldn't allocate more than your cores to a VM, not threads, cores. A typical i7 has 4 cores/8 threads. Remember that simple rule:
  • Total CPUs for your guests + 1 Host CPUs.
  • Total RAM+vRAM+overhead for your guests Host available RAM + some.
Understood on the -shouldn't- allocate more CPUs than cores. I've seen the little warning flag pop up. I've tried 4 CPU VMs and 6 CPU VMs but when it came down to getting the job done, the 6 CPU config was providing the same run time time per calculation and I could run 2 extra threads and thereby cut my overall calculation time down.

RAM's not a problem. I have 16GB and I usually use between 2GB and 8GB on the host machine. It's a 4GB virtual machine leaving plenty of headroom.

Thanks for looking into this!
Renovare
It's time for something renewable..
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Performance leak on Linux Guest

Post by mpack »

00:00:08.476679 CPUM: Physical host cores: 4
You don't seem to have absorbed the message that your maximum vCPU allocation is 3. In reality you shouldn't allocate more than two, because VirtualBox is a host app, and it and the rest of the host OS runs best with multiple cores too.
Renovare
Posts: 4
Joined: 19. Dec 2018, 17:59

Re: Performance leak on Linux Guest

Post by Renovare »

While I appreciate that there is a recommended vCPU allocation, there is a clear incentive for me not to follow the recommendation.

Here's the table of performance based on the same virtual machine run under different scenarios. In this bench mark I run 12 identical calculations, on a variety of vCPU configurations and vary the number of instances (threads). My goal here is to get as many calculations done in a given time.
Virtual Box Performance Benchmark
Virtual Box Performance Benchmark
Virtualbox.PNG (7.18 KiB) Viewed 2138 times
From this you can see if I limit my self to 3 vCPUs my calculation set takes 346s. If I set it at 6 vCPUs I can do the same exercise in 221s.

It's kinda like juggling chainsaws while riding a unicycle. It's not recommended, yet people do it. Why? It's all about the performance :D

Which brings me back to the original point of the post. The performance used to be much better. I rebuilt the same virtual machine (with 6 vCPUs) in VMware player and the same benchmark calculation took 118s instead of 221s. Now, 2 months ago I used to get the 118s level of performance out of VirtualBox. I now don't. And I can't figure out what has changed.....

Anyone got any thoughts?
Renovare
It's time for something renewable..
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: Performance leak on Linux Guest

Post by socratis »

Renovare wrote:And I can't figure out what has changed.....
If you can't figure what's changed in your setup, how do you expect us to know what's going on under the hood?

My first question was about antivirus. There's got to be an update to that, otherwise they're not worth their subscription.

VirtualBox version? Can you downgrade? Other options in the host and/or the guest?

I'm throwing ideas here, nothing certain, just shooting in the dark...
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.
andyp73
Volunteer
Posts: 1631
Joined: 25. May 2010, 23:48
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Assorted Linux, Windows Server 2012, DOS, Windows 10, BIOS/UEFI emulation

Re: Performance leak on Linux Guest

Post by andyp73 »

I would probably throw Spectre and Meltdown mitigations into the pot to consider.

-Andy.
My crystal ball is currently broken. If you want assistance you are going to have to give me all of the necessary information.
Please don't ask me to do your homework for you, I have more than enough of my own things to do.
Renovare
Posts: 4
Joined: 19. Dec 2018, 17:59

Re: Performance leak on Linux Guest

Post by Renovare »

andyp73 wrote:I would probably throw Spectre and Meltdown mitigations into the pot to consider.
I hadn't heard of these and a quick skim indicates that they are appropriate (I'm running Intel hardware circa 2015). If it was an update on my host machine to patch this then I'd expect to see it in both VMware and Virtual Box. I'll keep reading on this on topic and see where it leads.

Thanks for the pointer!
Renovare
It's time for something renewable..
Post Reply