Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Higher CPU load than webpack-dev-server? #40

Closed
naganowl opened this issue Oct 1, 2015 · 11 comments
Closed

Higher CPU load than webpack-dev-server? #40

naganowl opened this issue Oct 1, 2015 · 11 comments

Comments

@naganowl
Copy link

naganowl commented Oct 1, 2015

I was playing around with making my own asset server (to replace webpack-dev-server) and noticed that it causes a huge spike in CPU load (~100% with fans spinning) compared to the dev server (~3%) when both are just idling.

These are just measured using Activity Monitor on a 10.9.5 Macbook Pro (quad core i7, 16GB RAM). Don't think the specs of the machine are super relevant, but there's definitely a noticeable difference when switching between the two and wanted to see if anyone had input.

@avioli
Copy link

avioli commented Nov 4, 2015

Same here, although CPU usage at about 40%, not as high as 100%, but still not < 5%.

"express": "^4.13.3",
"webpack": "^1.12.2",
"webpack-dev-middleware": "^1.2.0",
Mac OS X 10.11.1, 2.5 GHz Intel Core i7, 16 GB 1600 MHz DDR3

webpack.config.js

@avioli
Copy link

avioli commented Nov 4, 2015

... It's all because of the webpack watcher.

@eriknyk
Copy link

eriknyk commented Nov 12, 2015

same problem, with a similar configuration of @avioli
cpu ~70%
any thoughts?

@mbektimirov
Copy link

I have about 100% on my CPU, memory is growing too. I tried to profile it with node-inspector but it was not that easy.

@sokra
Copy link
Member

sokra commented Mar 24, 2016

propably the native module for the watcher is not installed, so the watcher switch to polling mode, which is cpu intensive. Try to install the fsevents module for OS X, or increase the polling frequency.

@michaek
Copy link

michaek commented Jun 16, 2016

This is a counterintuitive solution, as chokidar does list fsevents in optionalDependencies, and it was installed successfully in my project. Nonetheless, npm i --save-dev fsevents dropped my CPU use from 40% of a core to 0%.

@SpaceK33z
Copy link
Member

Closing this issue because it's not related to this middleware. watchpack is related.

@sekoyo
Copy link

sekoyo commented Feb 8, 2017

Thanks @michaek !!! Work proxy was freezing the install of fsevents and I was cancelling it, thinking nothing bad was happening

@arobbins
Copy link

@michaek Worked for me as-well, thanks.

@index-swf
Copy link

I've had the same problem since I updated node, npm rebuild fsevents is also worked. Some packages need to be rebuilt after system upgrade. I wonder if webpack-dev-server should output a warn when it detects that fsevents is unavailable on Mac.
I apologize for my bad English.

@nchase
Copy link

nchase commented Aug 23, 2020

amazing. thank you, @michaek!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests