Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

JTallis's avatar

`npm run watch-poll` causes high CPU

I'm not entirely sure if this is the right category.

I have Laravel Homestead installed with a project, on Windows. Running npm run watch-poll results in a CPU increase of 20%. I'm unsure if this is normal but when I was using gulp with Laravel 5.3, it would use probably around 6% which leads me to believe 20% is a tad too high.

Does anyone have any input on this?

As a matter of fact, the VBoxHeadless.exe process when running the above hovers around 28 to 30% CPU.

0 likes
6 replies
lmxdev's avatar

yeah i suffer from this aswell, my machine is crap :( upgrading is the best way...

JTallis's avatar

My laptop costed around £900 in 2014 although I suppose it's retail price would probably be around the £500 to 600 mark now. It still should be powerful enough to handle such a process.

I don't understand at all why the CPU would be so high for Laravel Mix (and whatever else goes on) when I can have the exact same result with Laravel Elixir as came with Laravel 5.3 with less CPU. I'm thinking about installing Gulp and compiling my assets as if I was running 5.3.

jekinney's avatar

Sounds like you're running npm inside homestead? That alone will cause issues. Along with composer commands etc. you'll definitely get slow performance and possible memory exhausted errors. A simple vm isn't efficient to run those efficiently.

Search here and you'll see a bunch of questions/issues with expectations of (specifically) performance, including but obviously not limited to, request time and slowness. A vitual machine for development really isn't designed or set up for performance persay. Usually you need to pay for better vm software and start messing with settings and using specific drivers but more importantly allocate more resources then 1 CPU and 1gb of memory etc to get better performance.

1 like
JTallis's avatar

That's it. I run npm locally now and I don't need to poll either. It runs much better, thank you.

juhasev's avatar

Same here MacOS. If you want to run this on HomeStead you would have use the watch-poll option which is horrible. Generally speaking DO NOT run the watch on npm on HomeStead VM it will not work very well and cause your whole local environment to slow down with it including your editor! Not fun to play with cool stuff like Vue in an environment like that. Running npm run watch on the local machine instead solves this issue and the build speed is all the sudden 10 x faster!!!

Please or to participate in this conversation.