v18.1.0
PlatformLinux 5.17.4-arch1-1 #1 SMP PREEMPT Wed, 20 Apr 2022 18:29:28 +0000 x86_64 GNU/Linux
Subsystemcrypto
What steps will reproduce the bug?I have observed this problem in few http clients: axios, got. But looks like a problem is in node.js itself.
const http = require("http"); const https = require("https"); const port = 3000; const handler = (req, res) => { https.get("https://server.local", (response) => { let body = ""; response.on('data', chunk => { body += chunk; }); response.on("end", () => { res.statusCode = response.statusCode; res.setHeader('Content-Type', 'text/plain'); res.end(body); }); }); }; const server = http.createServer(handler); server.listen(port);
hey
hey -z 1m -c 10 -disable-keepalive "http://client.local:3000"
SecureContext.init()
. It starts from ~50% and going up to 80%. Amount of requests processed by server, which sends outbound https requests is constantly decreasing.Always reproduces if present outbound ssl requests and node version 18.1.0
What is the expected behavior?Constant CPU usage, amount of processed requests is at the same level during time. In node.js v16.15.0 same code in CPU profiler have SecureContext.init()
with usage of 5-8%. And during load there is no performance degradation.
CPU usage is keeping increasing during time, SecureContext.init()
starts from ~50% cpu time in profiler and keep growing during time to 80-85%. Amount of requests processed by server is constantly decreasing.
v18.1.0
Benchmark result - 186 req/s
node --perf output - https://pastebin.com/wyHPXfMH
cpu profile screenshot
v16.15.0
Benchmark result - 1184 req/s
node --perf output - https://pastebin.com/0L0Z01iq
cpu profile screenshot
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.3