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

node-express-v02-pool

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 091253b

Capacity1,350 VUs 619.1 req/s steady
First failing level1,400 VUs
Highest throughput seen651.1 req/s
Pass rulep50 < 500 · p95 < 800 · p99 < 1000 ms
errors < 1 %
Steady throughput619.1req/s · 37,149 req/min
Client p95 / p99690 / 776ms, steady phase
Server time p50309.6ms inside the app
Spent getting a connection95 %of server p50 (292.8 ms)
CPU (1 vCPU)100 %Node 43 · Postgres 51
Memory used484 MBof 961 MB · Node 124 · PG 108

Summary

Capacity: 1350 VUs at 619 req/s (37,149 req/min), steady p50 325 ms / p95 690 ms / p99 776 ms, 0 % errors. The first failing level is 1400 VUs: 518 req/s, p50 895 ms (limit 500), p95 1320 ms, p99 1389 ms, still 0 % errors. Peak throughput was 651 req/s at 1300 VUs. Compared with v01 (100 VUs, 46.7 req/s) that is 13.5× the users and about 13× the throughput, from one change: a connection pool.

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 %
500Pass271.4418430.002 / 120 / 056 (26 / 24)45830
1,000Pass538.07631410.005 / 450 / 2484 (36 / 41)47162
1,200Pass608.5824287170.0066 / 41050 / 38799 (42 / 50)47768
1,250Pass575.63096348400.00292 / 616275 / 597100 (43 / 50)50153
1,300Pass651.11084666520.0094 / 45078 / 42999 (42 / 51)47844
1,350Pass619.13256907760.00310 / 670293 / 651100 (43 / 51)48465
1,400Failp50 895>=500ms, p95 1320>=800ms, p99 1389>=1000ms517.78951,3201,3890.00879 / 1,299861 / 1,276100 (45 / 48)50964
1,500Failp50 832>=500ms, p95 1377>=800ms, p99 1442>=1000ms546.88321,3771,4420.00814 / 1,348796 / 1,330100 (46 / 48)50672

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

One change from node-express-v01-baseline: a pg.Pool with default settings (max 10 connections, idle timeout 10 s) instead of a new pg.Client per request. Each request borrows one connection for all its queries and returns it before the response is sent. A connection whose ROLLBACK failed is destroyed instead of being reused. Server-Timing conn now measures the wait for a pooled connection (or the connect while the pool fills).

Full configuration

Observations

Next idea

node-express-v03-pool-20 (or -pool-5): change only the pool size, to confirm the pool queue is a symptom of CPU saturation and not a cause. Bigger gains should come from cutting CPU per request (prepared statements, single-statement CTE writes, Postgres tuning).