Wednesday, 19 April 2017

How to infer node.js profiling results?

I have a simple nodejs application (app A) in Windows that listens to a port and as soon as it receives request it posts to another server (app B) and records the response in MongoDB.

App A (single thread, no cluster implemeneted yet) processes around 35 requests per second (measured using locust.io). The below is the profiling information of app A. 97.8% of time is taken by the shared libraries out of which 93.5% is due to ntdll.dll. Is it normal or a potential bottleneck that can be fixed?

 [Summary]:
       ticks  total  nonlib   name
       6023    2.0%   87.8%  JavaScript
          0    0.0%    0.0%  C++
        502    0.2%    7.3%  GC
      300434   97.8%          Shared libraries
        834    0.3%          Unaccounted

 [Shared libraries]:
   ticks  total  nonlib   name
  287209   93.5%          C:\windows\SYSTEM32\ntdll.dll
  12907    4.2%          C:\Program Files\nodejs\node.exe
    144    0.0%          C:\windows\system32\KERNELBASE.dll
    133    0.0%          C:\windows\system32\KERNEL32.DLL
     25    0.0%          C:\windows\system32\WS2_32.dll
     15    0.0%          C:\windows\system32\mswsock.dll
      1    0.0%          C:\windows\SYSTEM32\WINMM.dll
[Bottom up (heavy) profile]:
  Note: percentage shows a share of a particular caller in the total
  amount of its parent calls.
  Callers occupying less than 2.0% are not shown.

[Bottom up (heavy) profile]:
  Note: percentage shows a share of a particular caller in the total
  amount of its parent calls.
  Callers occupying less than 2.0% are not shown.

   ticks parent  name
  287209   93.5%  C:\windows\SYSTEM32\ntdll.dll
   6705    2.3%    C:\Program Files\nodejs\node.exe
    831   12.4%      LazyCompile: <anonymous> C:\opt\acuity\proxy\nodejs\node_modules\mongoose\node_modules\mongodb-core\lib\topologies\server.js:786:54
    826   99.4%        LazyCompile: *Callbacks.emit 



via Sathish

No comments:

Post a Comment