【发布时间】: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_wait 和 epoll_pwait 是什么意思,因为它们几乎占用了程序占用的 CPU 时间的 100%?
【问题讨论】:
标签: node.js performance profiling v8 epoll