Skip to content

Benchmarks ​

What the SDK gateway did in our own measurements: how many jobs per second a worker process drained, how long a job took from enqueue to completion, and how fast producers could enqueue. Capacity says what to size; this page is the data behind its numbers.

Read these as orders of magnitude

Everything ran on one shared machine: a container with 4 cores and 16 GB of memory ran the server instances, Redis, PostgreSQL, the producers and the workers at the same time, and other jobs shared it during the runs. The processor model and the instance type were not recorded. The handlers did nothing. So the numbers show how throughput moves with workers and instances, and what the gateway adds to a job. They are not what a production deployment does, and they are not a promise.

How it was measured ​

ServerRelease build, Crystal 1.22.2, CRYSTAL_WORKERS=4, with licensing bypassed as in the SDK conformance run
Data storesRedis 7 and PostgreSQL 16, on the same machine, both empty and thrown away after the run
MachineOne shared container, 4 cores (nproc 4), 16 GB. Processor model and instance type: not recorded
Load3,000 jobs per run for the drain and enqueue rates; 100 jobs per second for 10 seconds for the latency
JobsNo-op handlers. Each worker process runs 8 tasks at once
Repeats3 runs per configuration. Cells show the median; the drain rate also shows the range in brackets
  • Drain jobs/s: 3,000 jobs enqueued first, then the workers start. Completions per second from the first to the last job.completed event. With drain rates of several thousand jobs per second a 3,000-job backlog lasts under a second, so those cells move by 10 to 20 % between repeats.
  • Enqueue/s: how fast 8 producer threads stored those 3,000 jobs, one job per call (POST /api/v1/sdk/jobs, round robin over the instances, every call audited).
  • p50 and p99: with the workers running, from just before each enqueue call to its job.completed event.
  • Direct Redis (Crystal): the same load through JoobQ's own Crystal worker, which talks to Redis with no gateway. It is the reference, not an SDK.

The harness is not published, so these results cannot be reproduced from this page. They were taken on the gateway as it was after the change described below (long polls woken by notifications, outcomes and heartbeats sent in batches); they were not re-run for the current release.

Gateway throughput ​

Worker processes against one or two server instances. Higher is better for jobs per second; lower is better for the latencies.

One server instance ​

WorkerProcessesDrain jobs/sEnqueue/sp50 msp99 ms
Python12,680 (2,537–2,709)3,45578
Python24,260 (4,212–4,510)3,29578
Python45,234 (5,225–5,823)3,51579
Go12,656 (2,597–2,741)3,55779
Go24,798 (4,154–5,637)3,14679
Go45,595 (5,261–5,658)3,882710
TypeScript11,898 (1,815–2,215)3,247713
TypeScript22,906 (2,813–2,914)2,859813
TypeScript43,114 (2,590–4,397)2,524715
Java12,099 (1,930–2,305)2,970715
Java22,499 (2,409–2,690)2,863815
Java43,218 (2,895–3,467)3,646714
Crystal, direct Redis16,436 (6,436–6,664)22,3724191
Crystal, direct Redis210,523 (10,098–10,635)20,3844190
Crystal, direct Redis414,213 (14,146–14,418)20,5594090

Two server instances ​

WorkerProcessesDrain jobs/sEnqueue/sp50 msp99 ms
Python12,695 (2,631–2,754)3,32778
Python24,026 (3,749–4,236)3,37778
Python44,982 (4,982–4,998)3,36879
Go12,606 (2,325–2,626)3,30078
Go23,925 (3,860–3,962)3,41068
Go45,243 (5,118–6,274)3,46568
TypeScript11,862 (1,835–1,867)3,26579
TypeScript23,017 (2,990–3,299)3,085810
TypeScript44,230 (3,977–4,297)3,480710
Java12,226 (2,144–2,289)3,12979
Java23,144 (3,130–3,329)3,411811
Java43,362 (3,256–3,931)3,309711

The Crystal rows have no second instance: that worker does not use the gateway.

What it shows ​

  • A job took 6 to 8 ms at the median and 8 to 16 ms at the 99th percentile from enqueue to completion through the gateway, whatever the language, the number of workers or the number of instances. A poll is answered when a job arrives. What is left of the median is mostly the 5 ms an SDK waits to batch outcomes, plus the enqueue call and the event stream.
  • One worker process drained about 1,900 to 2,700 jobs per second, depending on the SDK. Four processes reached about 3,100 to 5,600. Past about 5,000 to 5,600 jobs per second in total, the server, Redis and the workers were out of CPU on this machine: that ceiling belongs to the 4 cores, not to the gateway.
  • A second server instance changed little on one machine, because both instances shared the same 4 cores. A second instance is for more CPU on other machines and for availability. Leases and waits are claimed atomically in Redis, so instances do not step on each other.
  • Enqueueing one job per call reached about 2,500 to 3,900 jobs per second from 8 threads, whatever the worker. Each call is one audited HTTP request. enqueue_many stores up to 500 jobs in one call; this benchmark did not use it.
  • Direct Redis was 2.5 to 3 times faster per process than the gateway SDKs on the same machine (6,436 against 2,100 to 2,700 jobs per second for one process), as expected: the gateway adds an HTTP hop and a lease record per task. Its latency is higher here (41 and 91 ms), because the Crystal worker's own polling interval sets it.

What changed from the first measurement ​

The same benchmark was run before the gateway moved from a 50 ms polling timer to notification-woken long polls and batched acknowledgements and heartbeats. One worker process, one server instance:

WorkerDrain jobs/s beforeafterp50 ms before / afterp99 ms before / after
Python1582,68028 / 754 / 8
Go1,9522,65627 / 753 / 9
TypeScript1,6111,89828 / 753 / 13
Java9252,09929 / 761 / 15

The Python worker gained the most, 17 times, because it no longer sleeps 50 ms when its slots are full. The Crystal worker was not affected (6,436 jobs per second before and after).

What was not measured ​

TLS, a load balancer, workers on other machines, a server instance on its own machine, real handlers (anything that does work), and workflows (one task per run plus a heartbeat per step). The gateway's own CPU came out of the same 4 cores as everything else, so its capacity on a dedicated machine is higher than shown, by an amount nobody measured.

Per-request cost of the API (historical) ​

An earlier, separate measurement counted the memory each API route allocates per request and the time it takes, in one process with no network. It was taken on the legacy API stack, before the Azu refactor, so it does not describe the current server. It is kept as the reference the refactor was judged against: compare runs of the same measurement, not absolute numbers.

Release build, Crystal 1.22.2, CRYSTAL_WORKERS=1, local Redis and PostgreSQL, one handler call per request with no socket. About 34 KB of every response with a body is the measurement harness itself; "net" is what the application adds above it.

RouteStatusBytes per requestNet of harnessµs per request
Harness floor (a handler that prints {"ok":true})20034,307016.7
GET /capabilities (public, no Redis)20040,6896,38232.4
GET /openapi.json (public, large body)200136,438102,13140.3
GET /queues (authenticated, Redis)20042,6448,337646.4
GET /nope (authenticated, 404 answer)40439,9465,63951.4
POST /session with {} (public, 422 answer)42239,6835,37646.9
POST /queues/default/pause (operator write, audited)2045,695below the floor242.0
  • Bytes are stable, time is not. Two runs gave 40,688 and 40,689 bytes for /capabilities, but 755 and 646 µs for /queues: Redis round trips on a shared machine. Judge memory by the bytes, and time only by large, repeated differences.
  • GET /queues is dominated by Redis calls (about five per queue), not by memory.
  • GET /openapi.json is built once and cached; its 100 KB is the cached text copied into the response.
  • It does not cover the live stream, /metrics or concurrent requests.

Using these numbers ​

Size from your own handlers. In practice throughput is the number of tasks your workers run at once divided by how long a task takes, and a real handler is slower than the gateway by far. See Scale workers for the controls and Capacity for what to size beside the server.