question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

forever -w causing CPU spike

See original GitHub issue

I 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:open
  • Created 9 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
diogogmtcommented, Aug 25, 2015

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?

0reactions
DanielSmedegaardBuuscommented, Feb 1, 2018

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 ignore node_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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found