forever -w causing CPU spike
See original GitHub issueI have a weird case. I have 2 Docker containers running very similar and simple node web apps using forever -w
I noticed my CPU usage was maxing out when running the containers. I’ve isolated it to one container. I’ve found that if i remove the -w
option the CPU falls to normal. I tried disabling features of the web app until it was literally running nothing but a setInterval
loop. I thought this might be-caused by running gulp watch
on the same file system but i’ve disabled that and it didn’t help
What are some further steps I can do to debug this? You can checkout the project at : https://github.com/plebland/web
Issue Analytics
- State:
- Created 9 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
My CPU usage spikes VERY HIGH whenever I do anything
Whenever I play games and it gets a little heavy or basically any task, the CPU utilization spikes and when I'm playing a...
Read more >run project(with forever block) causes high CPU usage in ...
When running a project which contains a forever block and few other blocks, the CPU usage is always around 80%. At the same...
Read more >My CPU is spiking randomly at idle as of late, any ideas as to ...
If CPU spikes happen in user mode but Perfmon doesn't show them, it means there are caused by a newly started process. In...
Read more >CPU Spikes Randomly. System Process Looks to Blame.
If the issue is caused by system processes, there are two possible reasons: third party programs conflict, or the related system services are ......
Read more >Redis CPU spikes and how to avoid it - LinkedIn
The graph above shows the constant CPU spiking over the course of a week. This issue was causing latency across our entire app....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m experiencing the same issue with the CPU spikes inside the docker container when running forever with the watch flag turned on.
I already updated to forever version 0.15.1
UPDATE After I modified the .foreverignore file to ignore the .git and node_modules directory the CPU spike went down. I added more details here
@indexzero do you know if there is a place documenting the proper syntax for the .foreverignore file? Now that forever uses chokidar would the syntax change?
Are you guys experiencing this consistently? I’m experiencing it intermittently, and for the life of me, I cannot figure out what’s causing it.
I’m not using it in Docker or in a virtual machine of any sorts. I’m using forever with
--watch
for development on my MacBook Air, and most of the time it “behaves” well. Then, some times, seemingly at random, after a restart of whatever service is being foreverized, it starts eating CPU like crazy — ~150% if I don’t ignorenode_modules
, ~100% if I do.Then, again seemingly randomly, at some point it’ll start to behave perfectly fine again, and my fans return to their usual quiet selves.
I have no clue how to debug this. I have one single possible correlation; I remember opening Dropbox to sync my folders (and my project folder used here is also in the Dropbox folder), but I cannot remember if it was before or after this behaviour started. But I do assume that both Dropbox and forever are using inotfy or whatever the equivalent is on a Mac?
I don’t know, but if there are any pointers as how I can debug this, I’d love to do so 😃
Cheers!