Virtual Machine is extremely slow

249 users found this article helpful

Symptoms

Resolution

  1. Download trace_intr from attach to the Desktop.
  2. Start your Virtual Machine
  3. Open Terminal.app and execute:

    cd ~/Desktop
    
    sudo chmod +x trace_intr 
    

    (enter your Mac OS X administrator password)

    sudo su
    

    (enter your Mac OS X administrator password if prompted)

  4. Drag&drop trace_intr from Desktop to Terminal window and then add "1", so it appears as

    /Users/<username>/Desktop/trace_intr 1 
    

    (hit Enter to run utility)

  5. At the output check if any driver takes improper amount (>100000) of interruptions per second. For instance:

    VECTOR  CPU#0   CPU#1   TOTAL   DEVNAME                 DRVNAME 
    41      0       0       0       HPET                    com.apple.driver.AppleHPET
    42      1768    0       1768    HPET                    com.apple.driver.AppleHPET
    43      0       0       0       HPET                    com.apple.driver.AppleHPET
    46      0       0       0       SMC                     com.apple.driver.AppleSMC
    48      0       0       0       HPET                    com.apple.driver.AppleHPET
    49      0       0       0       MacBookPro5,2           com.apple.driver.AppleACPIPlatform
    4d      0       0       0       MATH                            
    50      0       0       0       RP01@C                  com.apple.iokit.IOPCIFamily
                                    GFX0@0                  com.apple.GeForce
                                    IGPU@0                  com.apple.GeForce
                                    Z003                            
                                    LGPU                            
    51      0       0       0       OHC1@4                  com.apple.driver.AppleUSBOHCI
                                    GIGE@A                  com.apple.nvenet
                                    LUS0                            
                                    LMAC                            
    52      422     0       422     OHC2@6                  com.apple.driver.AppleUSBOHCI
                                    SATA@B                  com.apple.driver.AppleAHCIPort
                                    Z000                            
                                    LSI0                            
    53      0       0       0       RP05@16                 com.apple.iokit.IOPCIFamily
                                    FRWR@0                  com.apple.driver.AppleFWOHCI
                                    Z00J                            
    54      0       0       0       HDEF@8                  com.apple.driver.AppleHDAController
                                    LAZA                            
    55      0       0       0       RP04@15                 com.apple.iokit.IOPCIFamily
                                    ARPT@0                  com.apple.driver.AirPort.Brcm4331
                                    Z00F                            
    56      0       0       0       SBUS@3,2                com.apple.driver.AppleSMBusPCI
                                    EHC1@4,1                com.apple.driver.AppleUSBEHCI
                                    LSMB                            
                                    LUS2                            
    57      0       0       0       NVPM@3,5                com.apple.driver.NVSMU
                                    EHC2@6,1                com.apple.driver.AppleUSBEHCI
                                    LPMU                            
                                    Z001                            
    90      0       0       0       RP06@17                 com.apple.iokit.IOPCIFamily
    91      0       0       0       GIGE@A                  com.apple.nvenet
    92      0       0       0       SATA@B                  com.apple.driver.AppleAHCIPort
    93      78      0       78      IGPU@0                  com.apple.GeForce
    94      354996  0       354996  FRWR@0                  com.apple.driver.AppleFWOHCI
    95      0       0       0       GFX0@0                  com.apple.GeForce
    96      214     0       214     ARPT@0                  com.apple.driver.AirPort.Brcm4331
    d2      0       0       0       LAPIC_NMI                       
    d7      0       0       0       LAPIC_PM                        
    d8      0       0       0       LAPIC_PMC_SW                    
    d9      0       0       0       LAPIC_CMCI                      
    da      0       0       0       LAPIC_SPURIOUS                  
    db      0       0       0       LAPIC_ERROR                     
    dc      0       0       0       LAPIC_THERMAL                   
    dd      53932   60495   114427  LAPIC_TIMER                     
    de      1534    1280    2814    LAPIC_IPI                       
    df      0       0       0       LAPIC_PERFCNT 
    

    Here the problem is driver:

    94      354996  0       354996  FRWR@0            com.apple.driver.AppleFWOHCI
    

    NOTE: this is just an example. Do not unload this partilucar kext driver

  6. Press Control+C to quit the process.

  7. Use the solution from KB 122767

Cause

An interrupt storm on Mac OS X causes bad performance for guest OS.

When virtual machine is running each interrupt request costs a lot more CPU time. This is the overhead of virtualization. Normally, there are several thousands of interrupt requests per second so you don't notice them. But when there are hundreds of thousands of these requests the CPU spends all the time dealing with them.

#- INTERNAL (content below this line is not visible in published article) -

On host OSX versions below 10.8 we could rebin virtual CPUs to mitigate the interrupt storm.

Bind flag syntax:

vm.vcpu<vcpu #>bind=<pcpu #>

e.g.

    vm.vcpu0bind=1

pcpu is the number of physical CPU (whereas vcpu is a number of virtual cpu) and can be anything but 0 (CPU#0 handles external interrupts).

Due to kernel ASLR technique appeared in 10.8 VCPU binding doesn't work anymore and is disabled for these hosts. So we have no methods to mitigate interrupt storms on 10.8/10.9 except for filing bugs to Apple and hoping that they'll fix the issue.

Deleted steps 7 and 8:

  1. In order to unload the driver from Mac OS X, please type in Terminal:

    sudo kextunload -b
    

    then append the name of the driver that is causing the issue, for example com.apple.driver.AppleFWOHCI (as in step 3)

    the resulting string will look similar to this:

    sudo kextunload -b com.apple.driver.AppleFWOHCI 
    
  2. Restart/launch the virtual machine and see if there is any changes in performance.

NOTE: this is just an example. Do not unload this partilucar kext driver NOTE: Not every driver may be unloaded from Mac OS X system. Please perform the unload at your own risk, or contact Apple support for further assistance if you suspect an interrupt storm on your Mac.

Was this article helpful?

Tell us how we can improve it.