1 GB server test · protocol v2 · Ubuntu 24.04.5 LTS on a $6 droplet (1 vCPU / 1 GB)
No measurable gain over v02. By the capacity rule (highest passing level) v04 scores 1400 VUs at 660 req/s, but that pass is marginal (p95 788 ms, 1.5 % under 800; p99 991 ms, 1 % under 1000), and the lower levels 1300 and 1350 VUs both failed. Read the capacity as "about 1300–1400 VUs, 540–660 req/s", the same band as the parent tag (v02, pool 10: 1350 VUs / 619 req/s). 1500 VUs fails (614 req/s, p95 1316 ms). 0 % errors everywhere.
db p95 dropped a little (30–38 ms vs. 37–48 ms in v02 at the same levels).app_log_tail.txt has no errors.db time slightly.pg named queries) to skip parse/plan in Postgres, which uses half the CPU. To see small gains, also compare at a level below saturation (e.g. 1000 VUs, where v02 used 84 % CPU for 538 req/s): the CPU cost per request is measurable there, unlike at the ceiling.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.
| VUs | Result | req/s | p50 | p95 | p99 | Errors % | Server | Conn | CPU % (Node / PG) | Used MB | Load gen CPU % |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1,300 | Failp50 532>=500ms, p95 1243>=800ms, p99 1515>=1000ms | 542.2 | 532 | 1,243 | 1,515 | 0.00 | 506 / 1,206 | 488 / 1,184 | 100 (42 / 50) | 491 | 65 |
| 1,350 | Failp50 511>=500ms, p95 847>=800ms | 569.0 | 511 | 847 | 953 | 0.00 | 489 / 820 | 472 / 802 | 100 (43 / 51) | 506 | 65 |
| 1,400 | Pass | 660.5 | 193 | 788 | 990 | 0.00 | 173 / 764 | 159 / 742 | 100 (41 / 52) | 486 | 50 |
| 1,500 | Failp95 1316>=800ms, p99 1439>=1000ms | 613.6 | 496 | 1,316 | 1,439 | 0.00 | 474 / 1,274 | 458 / 1,252 | 100 (43 / 50) | 516 | 65 |
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.
Parent: node-express-v02-pool (pool 10). v03 (pool 20) was worse and is not carried forward. One change: the writes that touch two tables are now one SQL statement with data-modifying CTEs instead of BEGIN / 2 queries / COMMIT:
INSERT INTO likes ... SELECT FROM posts WHERE id = $1 ON CONFLICT DO NOTHING, then UPDATE posts SET like_count = like_count + 1 only for the inserted row; the count comes from the UPDATE or, for an existing like, from posts.DELETE FROM likes ... RETURNING, then decrement only for the deleted row.INSERT INTO comments ... RETURNING, then UPDATE posts SET comment_count = comment_count + 1.A single statement is one transaction, so the writes stay atomic. Responses and status codes are unchanged (verified: new/repeat like and unlike, unknown post 404, unknown user 401, empty text 400). A concurrency check of 30 parallel likes by one user, 40 by different users and 20 parallel unlikes left like_count = rows in likes (31).
apps/node-express — Express 5.3.0, pg 8.23.1, plain SQL, no ORM (app code from commit 4af516b)NODE_ENV=production, default heap, no flagsbench-app, no cluster/pm2)pg.Pool defaults, max 10Server-Timing: conn, db, app, total on every responseshared_buffers=128MB, max_connections=100), localhost TCP, SCRAM authdo-blr1-loadgen-4vcpu-8gb), k6 v2.3.0, traffic to the target's private IP 10.122.0.2 (≈ 2 ms RTT)conn is 92–97 % of server time at every level. Queries themselves stay fast (db p50 12–15 ms).server_db overall and per phase, not per endpoint, so the write-path saving cannot be isolated from these runs. A run below saturation would show it in total CPU per request.node-express-v05-prepared (parent v04): named queries in pg ({ name, text, values }), so each pooled connection parses and plans every statement once and reuses the plan. Postgres uses half the CPU; parse/plan is a real part of it for these short indexed queries. Run one unsaturated level (1000 VUs) plus the edge levels.