Open lucshi opened 4 months ago
Isn't io_uring currently used only for file operations?
Yes, io_uring support was only added for FS operations.
FWIW as of the 14 Feb security releases (Node.js 21.6.2, 20.11.1), io_uring support is turned off by default.
The benchmark in question does not do any I/O: https://github.com/nodejs/node/blob/main/benchmark/url/legacy-url-get-prop.js
By looking at the graphs, my interpretation is that for every child process, a new SQPOLL-enabled ring is created which may cause a measurable perf hit. See discussion in https://github.com/libuv/libuv/issues/4308 and mitigation measures in https://github.com/libuv/libuv/pull/4315. (This last fix hasn't made to a libuv release yet)
Version
v21.5.0
Platform
Linux wpe-icx 6.2.0-26-generic #26~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Jul 13 16:27:29 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
libuv, benchmark
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Always after libuv introduced IO_uring
What is the expected behavior? Why is that the expected behavior?
Expected not downgrade performance.
What do you see instead?
url/legacy-url-get-prop.js e=1 type='auth' -31.12 % ±5.13% ±6.82% ±8.88% url/legacy-url-get-prop.js e=1 type='dot' -24.22 % ±5.18% ±6.90% ±8.98% url/legacy-url-get-prop.js e=1 type='file' 10.24 % ±5.04% ±6.74% ±8.84% url/legacy-url-get-prop.js e=1 type='idn' -22.35 % ±3.64% ±4.87% ±6.38% url/legacy-url-get-prop.js e=1 type='javascript' * -3.92 % ±3.71% ±4.95% ±6.47% url/legacy-url-get-prop.js e=1 type='long' -24.71 % ±2.76% ±3.68% ±4.80% url/legacy-url-get-prop.js e=1 type='percent' 3.46 % ±3.64% ±4.84% ±6.30% url/legacy-url-get-prop.js e=1 type='short' -21.85 % ±2.40% ±3.19% ±4.15% url/legacy-url-get-prop.js e=1 type='wpt' 14.60 % ±6.32% ±8.43% ±11.00% url/legacy-url-get-prop.js e=1 type='ws' -30.91 % ±6.89% ±9.18% ±11.97%
Additional information
Performance counter stats for './node_21x node/benchmark/url/legacy-url-get-prop.js':
Performance counter stats for './node_16x node/benchmark/url/legacy-url-get-prop.js':
Basic uARC data shows node21 introduced 3X instructions compared with node16
Flamegraph of node 16 (normal)![image](https://github.com/nodejs/node/assets/50089527/2668efa4-b348-4b8f-a36d-e29d103f2d71)
Flamegraph of node 21(downgrade)![image](https://github.com/nodejs/node/assets/50089527/21e85fdd-20b5-410c-aae0-69601a20f7c0)
There are many network operations introduced in Node 21 which is time costy, please see below attachment raw files.