1 GB server test · protocol v2 · Ubuntu 24.04.5 LTS on a $6 droplet (1 vCPU / 1 GB)
Only one level tested: 4500 VUs FAIL — 1955 req/s, steady p50 417 ms / p95 1088 ms / p99 1547 ms (limits 800 / 1000), 0 % errors. Capacity by the rule is therefore "< 4500" (not measured below); the parent v02 (pg on Bun) passed 4200 VUs and also failed 4500. No measurable gain from Bun's native Postgres client. Kept as the base for Bun.serve (v04) by the user's decision.
db p95 17 vs. 15 ms): the native client does not make Postgres faster, only the client side slightly cheaper.conn p95 999 ms). Memory 500 MB used, Bun PSS 109 MB, Postgres 132 MB, no swap. Load generator 48 % average, peaks 100 %; time outside the app p95 28 ms.Bun.serve instead of node:http on top of this (user's plan).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 % |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 4,500 | Failp95 1088>=800ms, p99 1547>=1000ms | 1,954.7 | 417 | 1,088 | 1,547 | 0.00 | 398 / 1,060 | 95 / 999 | 100 (50 / 41) | 500 | 100 |
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-http-v02-bun. One change: the Postgres client, node-postgres (pg 8.23.1) → Bun.sql (Bun 1.4.2's built-in client, new SQL({ url, max: 10 })). Every request still reserves one connection (sql.reserve()) for all its queries, timed as conn; queries are tagged templates (prepared and cached per connection by Bun.sql), timed as db. Adjustments needed for identical responses: every parameter has an explicit cast (::bigint, ::int, ::text, ::boolean) so numbers never travel as float8; Bun.sql returns int8 columns as strings, so id, user_id and post_id are converted with Number() in the query wrapper (node-postgres did the same with a type parser); the SQLSTATE of a server error is in err.errno (err.code is Bun's own code). The pg dependency is removed. The parity check (39 requests on a fresh DB) gave responses identical to v01/v02. App code from commit ed0c70a.
apps/node-http — plain node:http API on Bun's Node compatibility layer, Bun.sql, plain SQL, no ORM (app code from commit ed0c70a)NODE_ENV=production, no flagsbench-app)GET /posts only, all pages, key limit + before, TTL 1 s, single-flight, no invalidation (labelled trade-off: global feed up to 1 s stale)Server-Timing: conn, db, app, total on every response (cache hit: conn 0, db 0)shared_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.2app_log_tail.txt has no errors.node-http-v04-bun-serve (parent v03): Bun.serve (Bun's native HTTP server, fetch(Request) → Response) instead of node:http on Bun's compatibility layer, the only change. Test at 4500 VUs.