Ticket #18678 (new defect)
macOS app nap: effecting performance of VirtualBox VM
Reported by: | PikeSandwich | Owned by: | |
---|---|---|---|
Component: | host support | Version: | VirtualBox 6.0.8 |
Keywords: | Cc: | ||
Guest type: | Linux | Host type: | Mac OS X |
Description
host macOS 10.14.5 (Mojave) iMac 19,1 (Intel i5, 6 core, 40GB RAM), guests linux (ubuntu 19.04, Windows10 1809) the VirtualBox VM process will get AppNap'd by macOS resulting in:
- approximately 20-25% performance compared to when AppNap=no for cpu-bound guest process
- while degraded, host still reports full CPU core consumption. to be clear, if running 1 cpu-bound guest process, when AppNap=no host reports 100% CPU utilitizatiion (expected), when AppNap=yes host still reports 100% CPU utilization (not expected).
- this does NOT happen when VM is run headless (presumably because AppNap targets .app with GUI contexts)
Steps taken to produce problem:
- rm VBox.log
- launch linux guest with head
- ssh into linux guest
- launch spin.rb script to loop/bump counter, and every 1.0 second emit count/reset-count, output is @4,400,000/s
- minimize (yellow button on macOS host) guest head
- watch Activity Monitor.app CPU tab with added field App Nap and filter on virtualbox, and notice VirtualBox VM nap=no
- watch Intel Power Gadget.app Frequency monitor, core pegged at turbo rate of 4.0GHz
- wait for something around 30-60 seconds passes
- notice (3) changed output from @4,400,000/s → @1,200,000/s
- notice (5) changed nap from no → yes
- notice (6) changed from 4.0GHz → 2.0GHz and stabilized at 1.5GHz
- wait an arbitrary 45 seconds or so
- un-minimize previously minimized guest head (from step (4))
- notice (3),(5),(6) change back to output @4,400,000/s, nap=no, core=4.0GHz
- shutdown linux guest
- save VBox.log
related forum thread: https://forums.virtualbox.org/viewtopic.php?f=8&t=93183
Attachments
Change History
Changed 3 years ago by PikeSandwich
-
attachment
spin.rb.gz
added
ruby script to spin cpu report iterations per second
Changed 3 years ago by PikeSandwich
-
attachment
spin.log.gz
added
log showing drop in spin.rb running in linux ubuntu 19.04 guest
Changed 3 years ago by PikeSandwich
-
attachment
activity.png
added
activity monitor filtered to virtualbox, and sorted by appnap column
Changed 3 years ago by PikeSandwich
-
attachment
frequency.png
added
Intel Power Gadget core frequency monitor drop coninciding with appnap=yes
comment:1 Changed 3 years ago by socratis
Related discussion in the forums: https://forums.virtualbox.org/viewtopic.php?f=8&t=93183
It's worth mentioning that this issue was discovered independently from a user in the Apple forums: https://discussions.apple.com/thread/250276999