javascript - Nodejs High CPU usage - Stack Overflow

I am trying to determine why my nodejs server has extremely high CPU usage. When running top, I can see

I am trying to determine why my nodejs server has extremely high CPU usage. When running top, I can see that the CPU usage for node can hit up to 60% with a single user. I used node-tick to profile my application, but I cannot seem to understand the results well enough to find the source of the problem.

I am using:

socket.io
mongodb
jade-templating
express

Here are the results:

 [Shared libraries]:
   ticks  total  nonlib   name 
  31273   88.5%    0.0%  b77b7000-b77b8000
   2144    6.1%    0.0%  /usr/local/bin/node
    269    0.8%    0.0%  /lib/i386-linux-gnu/libc-2.15.so
     45    0.1%    0.0%  /lib/i386-linux-gnu/libpthread-2.15.so
     13    0.0%    0.0%  2cd46000-2cd47000
     11    0.0%    0.0%  /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
      2    0.0%    0.0%  /lib/i386-linux-gnu/librt-2.15.so

I cannot seem to find this "b77b7000-b77b8000" and google is not yielding many results.

Can anyone determine what is causing my node.js to use so much CPU time?

I am trying to determine why my nodejs server has extremely high CPU usage. When running top, I can see that the CPU usage for node can hit up to 60% with a single user. I used node-tick to profile my application, but I cannot seem to understand the results well enough to find the source of the problem.

I am using:

socket.io
mongodb
jade-templating
express

Here are the results:

 [Shared libraries]:
   ticks  total  nonlib   name 
  31273   88.5%    0.0%  b77b7000-b77b8000
   2144    6.1%    0.0%  /usr/local/bin/node
    269    0.8%    0.0%  /lib/i386-linux-gnu/libc-2.15.so
     45    0.1%    0.0%  /lib/i386-linux-gnu/libpthread-2.15.so
     13    0.0%    0.0%  2cd46000-2cd47000
     11    0.0%    0.0%  /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
      2    0.0%    0.0%  /lib/i386-linux-gnu/librt-2.15.so

I cannot seem to find this "b77b7000-b77b8000" and google is not yielding many results.

Can anyone determine what is causing my node.js to use so much CPU time?

Share Improve this question edited Jan 17, 2018 at 16:39 Franz Payer asked May 27, 2014 at 15:09 Franz PayerFranz Payer 4,13716 gold badges55 silver badges78 bronze badges 7
  • b77b7000-b77b8000 looks like a memory-block to me...? – Diamondo25 Commented May 27, 2014 at 15:12
  • 2 @Andy JavaScript != Java; also that URL points to a chinese blog/forum? – Diamondo25 Commented May 27, 2014 at 15:14
  • @Diamondo25 it could be. Though, I am not sure what to do with that information. – Franz Payer Commented May 27, 2014 at 15:14
  • Have you tried using a tool like node-webkit-agent and doing CPU profiling? – mscdex Commented May 27, 2014 at 15:17
  • I know, Diamondo25, but it was the only googleable result for b77b7000 I thought it might have some relevance. – Andy Commented May 27, 2014 at 15:17
 |  Show 2 more ments

2 Answers 2

Reset to default 2

Yo can use a profiler to inspect performance of stack function by function.In my option Chrome's is the best one. Here is a tutorial about how to use it with nodejs

Once you connected debug console to your Chrome debugger you can use performance tab to record a profile for inspection

What about the physical memory usage??? Is it normal??

I had the same problem. In my case, CPU and physical memory usage were high. I was trying to bulk insert huge amount of data into the mongo db.

I removed for loops from my code. Then I found a drastic change in the CPU and memory usage. They got reduced to normal rate. For loops increases RAM and CPU usage. It keeps on growing. Like this, Is there anything in your code that uses large amount of memory and cpu??

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744962066a4603448.html

相关推荐

  • javascript - Nodejs High CPU usage - Stack Overflow

    I am trying to determine why my nodejs server has extremely high CPU usage. When running top, I can see

    1天前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信