【问题标题】:Profiling for Node.js ApplicationNode.js 应用程序的分析
【发布时间】:2020-02-04 14:11:56
【问题描述】:

我点击此链接 https://nodejs.org/uk/docs/guides/simple-profiling/,在我的应用 (Expressjs) 中分析特定端点。

端点将从s3 下载pdf,使用线程池(4 个worker_threads 的池)用数据填充pdf(我使用HummusJS 填充pdf),然后将填充的文件上传到s3 和以signedUrl 回复已填充的文件。

测试由apache benchmark完成:

ab -p req.json -T application/json -c 20 -n 2000 http://{endpoint}

profiling 的输出是这样的:

 [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 1.0% are not shown.

   ticks parent  name
  287597   89.2%  epoll_pwait
 [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 1.0% are not shown.

   ticks parent  name
  1515166   98.5%  epoll_wait

所以,我的问题是,epoll_waitepoll_pwait 是什么意思,因为它们几乎占用了程序占用的 CPU 时间的 100%?

【问题讨论】:

    标签: node.js performance profiling v8 epoll


    【解决方案1】:

    google.com/search?q=epoll_wait

    简而言之,线程正在等待某些东西(可能是网络?可能是另一个线程?)。

    【讨论】:

      猜你喜欢
      • 2020-04-15
      • 1970-01-01
      • 1970-01-01
      • 2012-12-06
      • 1970-01-01
      • 2011-01-14
      • 2012-03-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多