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

node-express-v05-prepared

Express 5.3.0 · pg 8.23.1 · pool: pg.Pool defaults (max 10) · Node v24.21.0 · Postgres 16.15 · load from do-blr1-loadgen-4vcpu-8gb · app f7166fe

Capacity1,400 VUs 645.1 req/s steady
First failing level1,500 VUs
Highest throughput seen687.6 req/s
Pass rulep50 < 500 · p95 < 800 · p99 < 1000 ms
errors < 1 %
Steady throughput645.1req/s · 38,707 req/min
Client p95 / p99676 / 801ms, steady phase
Server time p50298.0ms inside the app
Spent getting a connection94 %of server p50 (281.6 ms)
CPU (1 vCPU)99 %Node 48 · Postgres 44
Memory used493 MBof 961 MB · Node 127 · PG 114

Summary

Capacity: 1400 VUs at 645 req/s (38,707 req/min), steady p50 320 ms / p95 676 ms / p99 802 ms, 0 % errors. The first failing level is 1500 VUs: 688 req/s, p99 1168 ms (limit 1000), still 0 % errors. All levels from 1000 to 1400 VUs passed. Likely a small gain over v04, not proven: Postgres's CPU share dropped consistently, but the throughput difference is within the host-speed noise.

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 %
1,000Pass534.0131051870.007 / 740 / 5689 (44 / 37)47761
1,300Pass633.12004458130.00177 / 422161 / 40599 (48 / 44)48365
1,400Pass645.13206768010.00298 / 653282 / 63599 (48 / 44)49363
1,500Failp99 1168>=1000ms687.63187311,1680.00297 / 711283 / 693100 (49 / 44)49750

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-express-v04-cte-writes. One change: every query is a prepared statement (a pg named query, { name, text, values }). The app derives a stable name per SQL text (q1, q2, ...), so each pooled connection parses and plans each statement once and then only binds and executes it. Verified on the droplet: a named query run twice on one connection shows one entry in pg_prepared_statements with 2 executions. All endpoints return the same responses and status codes as v04.

Full configuration

Observations

Next idea

node-express-v06-no-memoize (parent v05): enable_memoize = off for the app's database role, the only change. It removes the per-execution Memoize setup in the feed queries (≈ 10 % of Postgres CPU in the profile). Compare at 1000 VUs (CPU per request, now with the host-speed probe) plus edge levels.