Compiz CPU Spikes + terrible performance

Discussions about using Linux guests in VirtualBox.
Post Reply
shaunvig
Posts: 6
Joined: 3. Oct 2018, 16:57

Compiz CPU Spikes + terrible performance

Post by shaunvig »

For the past year, I've been doing all of my development work inside of an VM running Ubuntu 16.04 LTS on a Windows 10 host. I have given my VM 24GB of RAM, 4 CPU cores and 128mb of Video memory.

I have never had an issue with performance until yesterday. When I booted up the VM, I immediately noticed that everything was running super slowly... even just using Alt+Tab to switch windows was super laggy.

Running top, I saw that compiz was consistently using 100%+ CPU. I spent ALL of yesterday trying various things: rebooting, tweaking with the compiz-settings manager, even creating a brand-new VM-- only to observe the same lagginess (with compiz spiking)!

I checked the syslog and did find the following:
`compiz[2996]: segfault at 7f041577b800 ip 00007f0420bc6168 sp 00007ffe78334fd8 error 4 in libc-2.23.so[7f0420a78000+1c0000]`
I'm really at a loss here... I'm wondering if some updates applied on the Windows side could somehow be affecting the performance of my VM?

I am running Version 5.2.18 r124319 of VirtualBox. Let me know if I can provide any details that might help solve the problem.

I'm really at a loss here, and would love to get the bottom of this.
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: Compiz CPU Spikes + terrible performance

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 (force close it if you have to).
  • 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.
And second, just because an OS/program that runs in the context of VirtualBox has a problem, it doesn't make it a VirtualBox problem necessarily. You're having an issue that has most probably nothing to do with VirtualBox, so my suggestion would be to treat it as such, as a native problem with the OS or the application of the guest. We can only check that your VirtualBox setup is appropriate, not what's happening inside your guest.
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.
shaunvig
Posts: 6
Joined: 3. Oct 2018, 16:57

Re: Compiz CPU Spikes + terrible performance

Post by shaunvig »

I appreciate your response-- sorry for the delay getting back to you, I got married the week before last and was on my honeymoon.

The issue still persists, I've attached the log file as instructed. Again, any insight you might be able to provide is greatly appreciated!
Attachments
shaunvig_VBox.zip
VBox Log
(20.02 KiB) Downloaded 32 times
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Compiz CPU Spikes + terrible performance

Post by mpack »

VBox.log wrote: 00:00:02.488705 NumCPUs <integer> = 0x0000000000000004 (4)
...
00:00:03.622214 CPUM: Physical host cores: 4
All cores assigned to VM == Host starved of CPU, so poor performance shouldn't be a surprise, given that VirtualBox is a host app.

I also don't like that 94% of available host RAM has been allocated to a VM.

No 3D graphics acceleration either, meaning that Compiz is using software rendering.
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: Compiz CPU Spikes + terrible performance

Post by socratis »

mpack wrote:All cores assigned to VM == Host starved of CPU
And to top it off, there's no hyperthreading on a Intel Xeon E5-1603 CPU.
00:00:02.417611 File system of 'C:\Program Files\Oracle\VirtualBox\VBoxGuestAdditions.iso' (DVD) is ntfs
Get in to the habit of ejecting your CDs/DVDs from the guest once you're done using them. Especially the GAs CD. And especially before updating VirtualBox.
00:00:02.488850 [/Devices/ahci/0/LUN#0/Config/
                    Parent/
                      Parent/
                        Parent/
                          Parent/
                            Parent/
                              Parent/
                                Parent/
                                  Parent/
                                    Parent/
                                      Parent/
                                        Parent/
                                          Parent/
                                            Parent/
                                              Parent/
                                                Parent/]
                                                  (level 20)
00:00:02.488853   Format <string>  = "VDI" (cb=4)
00:00:02.488853   Path   <string>  = "C:\Users\shaun.viguerie\VirtualBox VMs\athanor-ubuntu\athanor-ubuntu.vdi" (cb=73)
Don't you think you have way too many snapshots? Please read the draft "Snapshot basics" and you'll understand that what you have is a really fragile situation here. Start consolidating them, after you've taken a complete backup.
00:00:02.489043 VRamSize <integer> = 0x0000000010000000 (268 435 456, 256 MB)
How did you end up with 256 MB of VRAM, when you're only allowed 128 MB max? Did you "manually" change that? Did you use VBoxManage? Why?
00:00:23.654728 GUI: UIFrameBufferPrivate::handleNotifyChange: Size=3440x1329
That's a lot of pixels that you have to talk to via the CPU. Remember, there's no real GPU, plus you have 3D acceleration disabled. Plus you're using a really odd-size screen, computers tend to like round numbers, hexadecimal round numbers.


PS. For future reference, you should completely shut down the VM before grabbing the VBox.log, it's incomplete otherwise...
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.
shaunvig
Posts: 6
Joined: 3. Oct 2018, 16:57

Re: Compiz CPU Spikes + terrible performance

Post by shaunvig »

Thanks. So, some background-- I spend 99% of my time inside the guest. The only application that runs on the host (aside from VirtualBox) is Outlook.

I get your points behind the RAM and CPU allocations-- but this setup worked with no issues at all for over a year. I will note that none of my current settings violate the "green sections" defined by the Virtualbox Manager.

Enabling 3D acceleration DOES improve performance, and compiz does not spike CPUs. However, it also causes a number of other annoyances. Namely, the redraws seem completely messed up. For example, window contents disapear when I resize a window, and I often have to resize the window again so that it refreshes once more and displays the content. Adding video memory did not alleviate this.

I do wonder why I would see these symptoms so suddenly. I will give more resources back to the host to see if that improves my performance.
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: Compiz CPU Spikes + terrible performance

Post by socratis »

shaunvig wrote:I do wonder why I would see these symptoms so suddenly.
Host updates? Guest updates? VirtualBox updates? Most probably the first two, usually VirtualBox has to self-patch to deal with host/guest updates...
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.
shaunvig
Posts: 6
Joined: 3. Oct 2018, 16:57

Re: Compiz CPU Spikes + terrible performance

Post by shaunvig »

How did you end up with 256 MB of VRAM, when you're only allowed 128 MB max? Did you "manually" change that? Did you use VBoxManage? Why?
I did this as an attempt to improve performance (someone recommended it on a thread I found while desperately searching for a solution). It did not work. I will undo it.
Don't you think you have way too many snapshots? Please read the draft "Snapshot basics" and you'll understand that what you have is a really fragile situation here. Start consolidating them, after you've taken a complete backup.
I appreciate your pointing this out. When I first started out, I would snapshot my VM weekly. About 2 months back, I read that this was actually bad practice, so I have since stopped taking snapshots. You mention taking a complete backup and consolidating them-- how do I do this? Thank you for your patience-- I am admittedly quite uninformed on this stuff.
That's a lot of pixels that you have to talk to via the CPU. Remember, there's no real GPU, plus you have 3D acceleration disabled. Plus you're using a really odd-size screen, computers tend to like round numbers, hexadecimal round numbers.
I do have a wide screen. As mentioned before, I'd like to enable 3D acceleration if I can find a way to fix the redraw issues.
shaunvig
Posts: 6
Joined: 3. Oct 2018, 16:57

Re: Compiz CPU Spikes + terrible performance

Post by shaunvig »

I am in the process of rolling back some host updates to see if they caused the observed performance decline.

That said, based on your feedback it sounds like I need to need to proactively take a few more steps to improve my environment (otherwise I'll face similar issues in the future)
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Compiz CPU Spikes + terrible performance

Post by mpack »

Software rendered graphics and a UHD/4K display size. Missed that killer combo.
shaunvig
Posts: 6
Joined: 3. Oct 2018, 16:57

Re: Compiz CPU Spikes + terrible performance

Post by shaunvig »

I found the cause of the symptoms I was seeing to be this windows update (Microcode update for Spectre variant 2):

https://support.microsoft.com/en-us/hel ... de-updates


Now that I've identified the cause of the "sudden onset", I will be making changes to my configuration to try and get the same performance as before. Thanks for all of the feedback!

EDIT: Searching the forums, I see that there have already been discussions around the intel microcode updates.
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: Compiz CPU Spikes + terrible performance

Post by socratis »

VMs are the hardest hit "applications" (in the broader sense) that were hit by the Spectre/Meltdown constant updates. VirtualBox has been introducing means to mitigate the microcode fixes, but there's so much that it can do.

For example, my OSX 10.9 "building-VirtualBox" VM went from 25' for a cold build, to 65'! :shock:
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