VBoxHeadless using 100%+ CPU

Thanks for the screenshots!

That’s definitely interesting. I have a good idea of what’s going on based off of them.

Can you try switching that site to the “Custom” environment and see if the issue persists?

Here’s how you can do that:

  1. Right-click on the site in Local’s sidebar
  2. Go to “Export” and follow the flow
  3. Drag and drop the resulting zip from the previous step onto Local’s main window or Dock icon
  4. Follow the steps to import the site. Make sure you select the Custom environment.

Two more:

1 Like

Hi Clay,

I could try that but I used to have the site as a Custom environment, back when I first posted the issue. Since then, I switched to preferred so I could use Connect to Flywheel. I’d rather not switch if I don’t need to. I’ve got one more update to push to the live site and then I plan to use WP Stagecoach so I can merge live store data with updates from the dev/staging site.

Let me know.
Thanks,
Jeff

Hi Clay,

This is happening even with the Airplane Mode plugin working.

Jeff

Hey @jhdean,

Thanks again for the details.

Right now the culprit looks like inotifywait. We use it in the Preferred environment for automatically flushing the Varnish cache when anything in the themes or plugins folder changes.

Hi Clay,

Now that you’ve found the suspect, do you have a solution?

Thanks,
Jeff

Hey Jeff,

We’re still gathering information at this point.

Are there Git projects in this site’s plugins or themes directories?

Hi Clay,

I haven’t done anything with Git. How would I know or check if there were?

Jeff

Hey Clay,

For what it’s worth, I’m experiencing the same issue (CPU spike). Here’s how to replicate the issue:

I have multiple plugins under active development in my plugins directory. All are Git repos. One of the plugins uses NPM, and so there are a lot of node_modules in this specific plugin folder. None of these plugins are activated. The VBoxHeadless process hovers right around 100% constantly.

If I remove all the plugins, CPU usage goes back to around 4.9% (normal).

If I add all plugins back, except the one using NPM, CPU usage is normal (4.9%).

I restarted the site without the plugin with NPM in Local, and CPU usage is normal (4.9%).

So, the issue must be related to NPM or indexing lots of files/folders (node modules).

You can replicate by cloning this repo into your plugins folder, switching to the vue.js branch, then run NPM install:

I’m also looking for a solution, as I use local for local plugin development.

Please do let me know if you find a solution.
Thanks,
Thad

1 Like

Thad,

Thanks so much for the additional information!

When developing this plugin, do you use the Custom or Preferred environment in Local?

Preferred 1.1

I was experiencing this issue as well with git and node modules inside a theme but I found a solution, well what seems to be one anyway.

I increased the virtual machines CPUs to two and changed reduced the execution cap to 75%. Im assuming this allows the VM to complete whatever it is trying to do in a timely fashion and not get caught up in requests.

As a note, the CPU load hasn’t occurred for me with a clean install, not that I can recall anyway.

1 Like