1 GB server test · protocol v2 · Ubuntu 24.04.5 LTS on a $6 droplet (1 vCPU / 1 GB)

node-http-v04-bun-serve

Bun.serve (no framework) · Bun.sql (Bun 1.4.2 native client) · pool: Bun.sql pool max 10 · Node v24.21.0 · Postgres 16.15 · load from do-blr1-loadgen-4vcpu-8gb · app d4b36f2

Capacity4,500 VUs 2,324.2 req/s steady
First failing level4,700 VUs
Highest throughput seen2,324.2 req/s
Pass rulep50 < 500 · p95 < 800 · p99 < 1000 ms
errors < 1 %
Steady throughput2,324.2req/s · 139,452 req/min
Client p95 / p99319 / 912ms, steady phase
Server time p501.5ms inside the app
Spent getting a connection0 %of server p50 (0.0 ms)
CPU (1 vCPU)94 %Node 41 · Postgres 45
Memory used464 MBof 961 MB · Node 59 · PG 133

Summary

Capacity: 4500 VUs at 2324 req/s (139,452 req/min), steady p50 15 ms / p95 319 ms / p99 912 ms, 0 % errors. First fail: 4700 VUs (added after the first release), in two runs, both on a slow host: 2212 req/s (p95 934 / p99 1093 ms, probe 104 ms) and, rerun, 2144 req/s (p95 1188 / p99 1547 ms, probe 148 ms); the 4500 pass ran at probe 82 ms. The CPU was at 100 % and the latency was pool wait in both, so the 4700 failures are server-side, but on a normal-speed host 4700 might pass. Best result of the project so far: +7 % VUs over v02 (4200) and +12 % req/s over v02's best (2078–2097 req/s at 4200–4500 VUs); v02 and v03 both failed 4500 VUs.

Levels tested

Latency is the client-observed steady phase (60 s hold). Red values miss the pass rule. Server and conn come from the app's Server-Timing header, p50 / p95 in ms.

VUsResultreq/sp50p95p99Errors %ServerConnCPU % (Node / PG)Used MBLoad gen CPU %
4,500Pass2,324.2153199120.002 / 2710 / 19494 (41 / 45)464100
4,700Failp95 1188>=800ms, p99 1547>=1000ms2,143.51631,1881,5470.00129 / 1,1580 / 1,09699 (44 / 46)461100

Across levels

Client latency vs. users steady phase, ms; dashed = limits
Where server time goes p50 per request, ms

During the run

From k6's 2-second snapshots and the 1-second server samples, aligned on the k6 start. The shaded band is the 60 s ramp; the hold phase follows.

Load active users, req/s, failed req/s
Latency over time 2 s windows, ms
Target droplet CPU % of 1 vCPU, memory used MB
p95 by endpoint client vs. server, ms, whole run

What changed vs. the previous tag

Parent: node-http-v03-bun-sql. One change: the HTTP server, node:http (Bun's Node compatibility layer) → Bun.serve (Bun's native server: fetch(Request) → Response). Same handlers, router, Bun.sql data access, 1 s feed cache and Server-Timing (now computed when the Response is created; Bun adds Content-Length). Request helpers adapted to the Fetch API: req.headers.get(), body via req.text() (JSON only, 100 kB limit), the path parsed from the absolute req.url. Bun.serve's keep-alive idle timeout is its default (10 s; node:http used 5 s); k6 VUs send a request every 1–3 s, so connections never idle out in either. The parity check (39 requests on a fresh DB) gave responses identical to v01–v03. App code from commit d4b36f2.

Full configuration

Observations

Next idea

Node/Bun is saved here (user's decision). Next phase: Python frameworks (Phase 3: FastAPI + uvicorn + asyncpg first), then Go, Rust and C++. Before any stack is pushed beyond ≈ 4500 VUs, recreate the load generator with 8 vCPU (new LOADGEN_LABEL) and rerun this configuration at its edge for comparability.