-
-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
High CPU usage while running on OS X #293
Comments
I wonder if we should just do something like this: https://github.com/researchgate/webpack-watchman-plugin |
Does webpack always use |
That's a good question. As far as I can tell
I'm not sure if this is a good idea, since I noticed that As another data point, my wife also has a Mac and hers doesn't exhibit the high CPU usage while running npm. Different version of OS X (10.9 instead of 10.10) but I'm not sure what else is different. Update: I'm also sad to report that |
Hmm we definitely don't want to watch node_modules (even though we allow importing CSS from them). If we do, it's an issue and we need to fix it. |
I'll accept a PR adding |
This was fixed by #294. |
This should be fixed in the new version. Can you please verify? |
Just tried it: node CPU usage now hovers between 0.1 and 0.2% 👍 |
Seems to be a problem again with Node 7.0.0 and 7.1.0. macOS Sierra reporting CPU usage of 110% during "npm start" operation. |
Can confirm here. I updated from node 6.8.1 to node 7.1.0 yesterday and now the I didn't find anything relative to CPU usage and node 7 in Webpack issues. I'm on El Capitan + latest version of CRA. @gaearon @dceddia Should we reopen the issue or create a new one? Edit: For those who have the same problem, you can downgrade with |
Let's reopen. Have you reported this to webpack? Can you confirm you have |
@gaearon I can confirm that I have fsevents in node_modules. |
I'm seeing this too -- with node v7.1.0 on macOS Sierra, but not with node 6.9.1. I tried putting back the
It's almost as if the "ignored" line isn't working anymore. If I comment out that option, the CPU usage is not affected. |
Worth filing a https://github.com/webpack/watchpack issue? |
So, in a weird turn of events, I can no longer reproduce this. Using nvm w/ Node 7.1.0 and NPM 3.10.9, I installed create-react-app 0.6.0 and then did a However, about an hour ago, I was noticing that a fresh Can anyone else confirm? Create a new project from scratch and see if the issue persists? |
I'm running into this issue and I don't see fsevents in my node_modules. create-react-app 0.6.0 CPU goes up to 140%, don't even know how that is possible! |
Can you paste the full npm log after creating a fresh project? |
mmmm creating a fresh project and copying over the src files seems to have fixed the issue... I wonder why! |
I do see fsevents now as well... on the package.json, the only difference I see between old and new is react went from 15.4.0 to 15.4.1, in case it helps |
It seems that I have fixed the problem locally: I removed my I’m on node 0.7.2 with |
Have you readded |
@gaearon Yes, I have re-added the |
Closing then.
|
We had a deprecated version of
|
I am sorry guys. Because of this issue, I am seriously thinking of setting up my own workspace. This is not helping development speed in any way. |
@ravilution which version of Node do you use? |
@wiesson 10.5.0. By the way, I have setup React + Parcel with all the features from CRA. It is blazing fast. I love it. |
https://til.codes/fix-for-100-cpu-usage-by-nodejs/ Worked for me |
I'm having the same issue in the last few days, I've already tried:
Any ideas how to resolve this issue? |
@nedislavd If you recently upgraded to Node 10, you may need to |
Can confirm @savants link also fixed this for me on Mojave. |
After running
npm start
, thenode
process consumes ~40% CPU on my machine:I found that setting a polling interval in the the WebpackDevServer helped:
Here were the settings I tried, and the resulting CPU usage:
There's a tradeoff between CPU usage and how snappy the dev experience feels. To me, 1000ms felt sluggish, but 500ms felt pretty good. I couldn't discern much difference between 500ms and 250ms.
It seems like adding some kind of polling interval would be a good idea to reduce the CPU usage.
The text was updated successfully, but these errors were encountered: