- Install Docker
- Install Node v20+ and run
npm install
- Install K6 (or use any other load testing tool)
- Spin up
httpbin
:docker run --rm -p "58080:8080" mccutchen/go-httpbin
- Run a simple http server in debug mode:
npm run debug:native
(ornpm run debug:undici
) - Warm up the server:
k6 run k6.js --vus 5 --duration 10s
- Run first set of requests:
k6 run k6.js --vus 5 --duration 360s
and make the heap snapshot - Run second set of requests:
k6 run k6.js --vus 5 --duration 360s
and make the heap snapshot
Requests made | v20.2 + fetch | v20.2 + undici v5.22.1 | v18.16 + fetch | v18.16 + undici v5.22.1 |
---|---|---|---|---|
~300k | 16MB | 19MB | 9MB | 11MB |
~600k | 23MB | 26MB | 9MB | 11MB |
Requests made | Memory | Step number | Heap snapshot |
---|---|---|---|
295k | 16MB | 7 | node-20.2-5vus360s (1).heapsnapshot |
575k | 23MB | 8 | node-20.2-5vus360s (2).heapsnapshot |
Requests made | Memory | Step number | Heap snapshot |
---|---|---|---|
356k | 19MB | 7 | node-20.2-5vus360s_undici (1).heapsnapshot |
650k | 26MB | 8 | node-20.2-5vus360s_undici (2).heapsnapshot |
Requests made | Memory | Step number | Heap snapshot |
---|---|---|---|
360k | 9MB | 7 | node-18.16-5vus360s (1).heapsnapshot |
680k | 9MB | 8 | node-18.16-5vus360s (2).heapsnapshot |
Requests made | Memory | Step number | Heap snapshot |
---|---|---|---|
366k | 11MB | 7 | node-18.16-5vus360s_undici (1).heapsnapshot |
678k | 11MB | 8 | node-18.16-5vus360s_undici (2).heapsnapshot |