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.
technical spec: node version 0.8.14 ubuntu 11.10 Intel(R) Xeon(R) CPU E5645 @ 2.40GHz
Sounds like garbage collection. Do you create large objects or buffers
temporarily?
-Chad
From: nodejs@googlegroups.com [mailto:nodejs@googlegroups.com] On Behalf
Of Dor Tzur
Sent: Wednesday, November 14, 2012 4:08 AM
To: nodejs@googlegroups.com
Subject: [nodejs] nodejs 100% cpu randomly
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.
technical spec: node version 0.8.14 ubuntu 11.10 Intel(R) Xeon(R) CPU E5645 @ 2.40GHz
Are you using a service like forever? Had an API server running using
forever. Running without forever showed a CPU usage of about 5%. Running
with forever, the CPU usage would go to 100% on the first few calls. Using
another tool solved the issue.
On Wed, Nov 14, 2012 at 9:19 PM, Chad Engler <Chad.Eng...@patlive.com>wrote:
> Sounds like garbage collection. Do you create large objects or buffers
> temporarily?****
> ** **
> -Chad****
> ** **
> *From:* nodejs@googlegroups.com [mailto:nodejs@googlegroups.com] *On
> Behalf Of *Dor Tzur
> *Sent:* Wednesday, November 14, 2012 4:08 AM
> *To:* nodejs@googlegroups.com
> *Subject:* [nodejs] nodejs 100% cpu randomly****
> ** **
> 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.
> technical spec:
> node version 0.8.14
> ubuntu 11.10
> Intel(R) Xeon(R) CPU E5645 @ 2.40GHz
On the note of forever running at 100%, that likes to happen when your
process fails to start and forever attempts to restart it as fast as it can
die.
On Wed, Nov 14, 2012 at 8:01 AM, Anand George <mranandgeo...@gmail.com>wrote:
> Are you using a service like forever? Had an API server running using
> forever. Running without forever showed a CPU usage of about 5%. Running
> with forever, the CPU usage would go to 100% on the first few calls. Using
> another tool solved the issue.
> On Wed, Nov 14, 2012 at 9:19 PM, Chad Engler <Chad.Eng...@patlive.com>wrote:
>> Hehe, gems…****
>> ** **
>> Sounds like garbage collection. Do you create large objects or buffers
>> temporarily?****
>> ** **
>> -Chad****
>> ** **
>> *From:* nodejs@googlegroups.com [mailto:nodejs@googlegroups.com] *On
>> Behalf Of *Dor Tzur
>> *Sent:* Wednesday, November 14, 2012 4:08 AM
>> *To:* nodejs@googlegroups.com
>> *Subject:* [nodejs] nodejs 100% cpu randomly****
>> ** **
>> 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.
>> technical spec:
>> node version 0.8.14
>> ubuntu 11.10
>> Intel(R) Xeon(R) CPU E5645 @ 2.40GHz
On Wed, Nov 14, 2012 at 8:40 AM, Adam Crabtree <atcrabt...@gmail.com> wrote:
> On the note of forever running at 100%, that likes to happen when your
> process fails to start and forever attempts to restart it as fast as it can
> die.
> On Wed, Nov 14, 2012 at 8:01 AM, Anand George <mranandgeo...@gmail.com>
> wrote:
>> Are you using a service like forever? Had an API server running using
>> forever. Running without forever showed a CPU usage of about 5%. Running
>> with forever, the CPU usage would go to 100% on the first few calls. Using
>> another tool solved the issue.
>> On Wed, Nov 14, 2012 at 9:19 PM, Chad Engler <Chad.Eng...@patlive.com>
>> wrote:
>>> Hehe, gems…
>>> Sounds like garbage collection. Do you create large objects or buffers
>>> temporarily?
>>> -Chad
>>> From: nodejs@googlegroups.com [mailto:nodejs@googlegroups.com] On Behalf
>>> Of Dor Tzur
>>> Sent: Wednesday, November 14, 2012 4:08 AM
>>> To: nodejs@googlegroups.com
>>> Subject: [nodejs] nodejs 100% cpu randomly
>>> 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.
>>> technical spec:
>>> node version 0.8.14
>>> ubuntu 11.10
>>> Intel(R) Xeon(R) CPU E5645 @ 2.40GHz
The app has no issues running without forever... so not sure why forever
wants to restart the process. The app has been running for about 6 weeks
now using nohup with supervisor on AWS, have had at least six code changes
and have never faced this issue.
On Wed, Nov 14, 2012 at 10:10 PM, Adam Crabtree <atcrabt...@gmail.com>wrote:
> On the note of forever running at 100%, that likes to happen when your
> process fails to start and forever attempts to restart it as fast as it can
> die.
> On Wed, Nov 14, 2012 at 8:01 AM, Anand George <mranandgeo...@gmail.com>wrote:
>> Are you using a service like forever? Had an API server running using
>> forever. Running without forever showed a CPU usage of about 5%. Running
>> with forever, the CPU usage would go to 100% on the first few calls. Using
>> another tool solved the issue.
>> On Wed, Nov 14, 2012 at 9:19 PM, Chad Engler <Chad.Eng...@patlive.com>wrote:
>>> Hehe, gems…****
>>> ** **
>>> Sounds like garbage collection. Do you create large objects or buffers
>>> temporarily?****
>>> ** **
>>> -Chad****
>>> ** **
>>> *From:* nodejs@googlegroups.com [mailto:nodejs@googlegroups.com] *On
>>> Behalf Of *Dor Tzur
>>> *Sent:* Wednesday, November 14, 2012 4:08 AM
>>> *To:* nodejs@googlegroups.com
>>> *Subject:* [nodejs] nodejs 100% cpu randomly****
>>> ** **
>>> 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.
>>> technical spec:
>>> node version 0.8.14
>>> ubuntu 11.10
>>> Intel(R) Xeon(R) CPU E5645 @ 2.40GHz
If it spikes to 100%, and then goes back down, I'd agree that sounds like garbage collection.
Either way, the best way to know what is going on is to profile it! I think on current versions of node, node-webkit-agent[1] is currently the best (only?) way to get a JavaScript CPU profile. If it reports all of the time in "(program)", then you may need a lower-level CPU profile to know what's going on.
On Wednesday, November 14, 2012 1:08:04 AM UTC-8, Dor Tzur wrote:
> 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.
> technical spec: > node version 0.8.14 > ubuntu 11.10 > Intel(R) Xeon(R) CPU E5645 @ 2.40GHz
On Wednesday, November 14, 2012 11:08:04 AM UTC+2, Dor Tzur wrote:
> 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.
> technical spec: > node version 0.8.14 > ubuntu 11.10 > Intel(R) Xeon(R) CPU E5645 @ 2.40GHz
On Wednesday, November 14, 2012 9:08:04 AM UTC, Dor Tzur wrote:
> 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.
> technical spec: > node version 0.8.14 > ubuntu 11.10 > Intel(R) Xeon(R) CPU E5645 @ 2.40GHz
<anton.whal...@nearform.com> wrote:
> Can you put it on an illumOS based system temporarily and get DTracing?
> At the very least this would tell you if its infrastructure or application.
> Spin up a Joyent SmartOS or do a local install of OpenIndiana.
> Then install your app
> This d script will show you when garbage collection is starting and how long
> it takes.
In that vein, if you're on a semi-recent RHEL-based system (CentOS,
Fedora), you can use this systemtap script. It prints aggregated GC
statistics every 5 seconds and at program exit. Run with `sudo stap
gc.stp -c 'node script.js'`.
Note that systemtap support currently only exists in master.
Debian/Ubuntu probably won't work, the systemtap in the official
repositories is too old.
#!/usr/bin/env stap
global samples
global all_samples
global timestamp
node-webkit-agent is a good tool. if you just want to know whether it's caused by gc, the easiest way is run your program by "node --trace_gc myapp.js", and you can see GC time like this:
On Wednesday, November 14, 2012 5:08:04 PM UTC+8, Dor Tzur wrote:
> 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.
> technical spec: > node version 0.8.14 > ubuntu 11.10 > Intel(R) Xeon(R) CPU E5645 @ 2.40GHz
For your server, how many RAM u have? it may be related to memory.
try either increase your physical memory, or run node with extra memory
allocated. (default is 1GB)
On Thu, Nov 15, 2012 at 6:33 PM, darcy <freeda...@gmail.com> wrote:
> node-webkit-agent is a good tool.
> if you just want to know whether it's caused by gc, the easiest way is run
> your program by "node --trace_gc myapp.js", and you can see GC time like
> this:
> where '14ms' means busy doing GC with CPU usage of nearly 100%.
> On Wednesday, November 14, 2012 5:08:04 PM UTC+8, Dor Tzur wrote:
>> 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.
>> technical spec:
>> node version 0.8.14
>> ubuntu 11.10
>> Intel(R) Xeon(R) CPU E5645 @ 2.40GHz