2017-04-19 44 views
0

我有一个简单的nodejs应用程序(应用程序A)在Windows中监听一个端口,一旦它收到请求后发送给另一台服务器(应用程序B)并在MongoDB中记录响应。如何推断node.js分析结果?

应用程序A(单线程,尚未实现集群)每秒处理35个请求(使用locust.io测量)。以下是应用程序A的分析信息。共享库占用了97.8%的时间,其中93.5%是由于ntdll.dll造成的。这是正常还是可以修复的潜在瓶颈?

[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 

回答

0

在典型应用中,我会说这个过程是能够分配给它的CPU插槽中运行,更好的多(约束和I/O密集型工作负载CPU的混合物) - 这样我们会查看用户空间中的更多CPU消耗量,而不是内核空间。

在Node.js中,由于I/O被延迟直到它可以被执行,并且它们准备好被执行时,我们可以在操作系统空间中看到增加的活动。如果大量使用ntdll.dll来执行I/O,我会说这不是一个问题,而是一个性能良好的系统。

你有很重的配置文件显示ntdll.dll中的分裂?如果他们指向的是便于I/O的win32 API/helper函数,那么我会说这是你系统的一个好兆头。