We're having a problem where every once in a while one of our environments our node app runs on 100% CPU. The server isn't very active and usually runs on 0%-2% CPU. I was wondering what are the common issues that might cause this problem and what would be the best way to find out what causing this issue.
Server specs:
node version 0.8.14
ubuntu 11.10
Intel(R) Xeon(R) CPU E5645 @ 2.40GHz
Node packages used:
"express" : 2.5.x, "log" : "1.2.x", "redis" : "0.8.x", "socket.io" : "0.9.x", "mongodb": ">= 0.9.6-7", "passport" : "0.x.x", "passport-local" : "0.x.x",
If the CPU usage is around 100%, this means that your computer is trying to do more work than it has the capacity for. This is usually OK, but it means that programs may slow down a little. Computers tend to use close to 100% of the CPU when they are doing computationally-intensive things like running games.
js is single-threaded, CPU-intensive tasks will block all requests from completing, until the task is completed. Therefore Node. js isn't a good solution for CPU-intense tasks".
This percentage is affected by the number of instances running across cores on the server. Multiple instances of a service running on one server or in a multi-core environment can produce CPU usage percentages well above 100%.
In simple terms, a Node. js memory leak is an orphan block of memory on the Heap that is no longer used by your app because it has not been released by the garbage collector. It's a useless block of memory. These blocks can grow over time and lead to your app crashing because it runs out of memory.
You can profile your app with node-tick.
node-tick
by npm -g install tick
node --prof ./app.js
node-tick-processor
and explain resultsIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With