Laravel-mix: Watch poll High CPU

Created on 18 Jan 2018  路  4Comments  路  Source: JeffreyWay/laravel-mix

Im using Laravel and laravel-mix using Vagrant and all of a sudden npm run watch does not work. So I started using watch poll, however it keeps crashing my VM as it is maxing out my CPU

Most helpful comment

Polling will definitely push your CPU more. Try setting a longer poll interval. Within your package.json file, update your watch-poll script to use a five second interval, like this:

"watch-poll": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --watch-poll=5000 --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",

All 4 comments

Polling will definitely push your CPU more. Try setting a longer poll interval. Within your package.json file, update your watch-poll script to use a five second interval, like this:

"watch-poll": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --watch-poll=5000 --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",

@JeffreyWay What is the default poll interval?

For the project I'm working on currently the CPU load is 90% or over using watch-poll. Not sure why the CPU load is suddenly so high, been using watch-poll for other projects without hogging the CPU.

Anyway, with an interval of 200ms, CPU usage go's down to ~50%, which is acceptable.

+1 I am having this very same issue

I got tired of my MBPr 2012 having it's fans on all the time. I set the polling to 5000 and this fixed the issue for me. Using the latest laravel for what it's worth.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wendt88 picture wendt88  路  3Comments

terion-name picture terion-name  路  3Comments

rlewkowicz picture rlewkowicz  路  3Comments

jpriceonline picture jpriceonline  路  3Comments

Micaso picture Micaso  路  3Comments