Processing Capacity

Chain creation and job completion throughput for every state and notify adapter.

Throughput along two separate axes. When the state adapter varies, notify is a no-op, so only the state adapter is measured; when the notify adapter varies, state stays in-process. Each chart is one scenario, with the two axes as separate groups on their own scales. The SQLite rows run the synchronous adapter, a SqliteStateAdapter in the "sync" mode. The In-process rows run the in-process adapters synchronously, and IPC, a synchronous notify adapter, runs over the synchronous in-process state adapter, while the other notify adapters run over the asynchronous one, so compare IPC with the In-process row rather than with them. A deployment's steady-state throughput is bounded by the lower of its creation and completion rates.

Your stack

Showing every backend. Pick the ones you use to hide the rest on every benchmark page; the pick is saved in this browser.

Test setup

  • Machine
    Apple M1 Pro
  • Runtime
    Node.js v24
  • Infrastructure
    Docker Desktop on macOS
    Databases and pub/sub servers run in containers, so every round trip crosses the VM bridge.
  • Servers
    PostgreSQL 18, SQLite 3.53, MySQL 26, MariaDB 13, Redis 8, NATS 2
  • Window
    2 s per scenario
    Each scenario runs in its own child process, so a slow adapter costs the same wall time as a fast one.
  • Seeded queue
    40,000 jobs
    Every completion scenario starts from the same queue, so only concurrency varies. A run that drains it early is timed from its first job to its last.

Creation

Single is a tight client.createChain loop with one transaction per chain, the shape of HTTP-handler traffic. Batched passes 100 chains to client.createChains in one transaction, the shape of a bulk enqueue, and amortizes the transaction and the notification over them.

Creation, single

chains/s
  • State adapter (noop notify)
  • In-process
    ~298,602
  • SQLite (better-sqlite3)
    ~35,695
  • SQLite (node:sqlite)
    ~37,742
  • PostgreSQL (postgres-js)
    ~1,061
  • PostgreSQL (pg)
    ~899
  • MySQL (mysql2)
    ~484
  • MariaDB (mysql2)
    ~434
  • Redis (redis)
    ~2,945
  • Redis (ioredis)
    ~2,895
  • Notify adapter (in-process state)
  • In-process
    ~225,333
  • Redis (redis)
    ~5,221
  • Redis (ioredis)
    ~5,169
  • PostgreSQL (pg)
    ~4,202
  • PostgreSQL (postgres-js)
    ~4,693
  • NATS
    ~4,777
  • IPC
    ~220,314

Creation, batched (100)

chains/s
  • State adapter (noop notify)
  • In-process
    ~428,016
  • SQLite (better-sqlite3)
    ~95,406
  • SQLite (node:sqlite)
    ~82,585
  • PostgreSQL (postgres-js)
    ~25,792
  • PostgreSQL (pg)
    ~23,068
  • MySQL (mysql2)
    ~11,558
  • MariaDB (mysql2)
    ~13,974
  • Redis (redis)
    ~24,985
  • Redis (ioredis)
    ~24,132
  • Notify adapter (in-process state)
  • In-process
    ~299,870
  • Redis (redis)
    ~162,138
  • Redis (ioredis)
    ~160,189
  • PostgreSQL (pg)
    ~149,535
  • PostgreSQL (postgres-js)
    ~154,564
  • NATS
    ~160,229
  • IPC
    ~248,956

Completion, no-op handler

One worker drains the seeded queue. Each handler only opens its own transaction and calls complete in it. With one slot, every job's full round trip (acquire, then complete and commit) runs back to back; 4 and 16 slots show how far parallel slots scale it.

Completion, 1 slot

jobs/s
  • State adapter (noop notify)
  • In-process
    ~105,572
  • SQLite (better-sqlite3)
    ~13,169
  • SQLite (node:sqlite)
    ~11,765
  • PostgreSQL (postgres-js)
    ~494
  • PostgreSQL (pg)
    ~458
  • MySQL (mysql2)
    ~177
  • MariaDB (mysql2)
    ~182
  • Redis (redis)
    ~940
  • Redis (ioredis)
    ~1,151
  • Notify adapter (in-process state)
  • In-process
    ~62,444
  • Redis (redis)
    ~1,667
  • Redis (ioredis)
    ~1,652
  • PostgreSQL (pg)
    ~1,461
  • PostgreSQL (postgres-js)
    ~1,477
  • NATS
    ~3,697
  • IPC
    ~69,784

Completion, 4 slots

jobs/s
  • State adapter (noop notify)
  • In-process
    ~101,548
  • SQLite (better-sqlite3)
    ~15,478
  • SQLite (node:sqlite)
    ~14,285
  • PostgreSQL (postgres-js)
    ~1,333
  • PostgreSQL (pg)
    ~1,107
  • MySQL (mysql2)
    ~490
  • MariaDB (mysql2)
    ~459
  • Redis (redis)
    ~2,436
  • Redis (ioredis)
    ~2,891
  • Notify adapter (in-process state)
  • In-process
    ~88,456
  • Redis (redis)
    ~5,642
  • Redis (ioredis)
    ~9,225
  • PostgreSQL (pg)
    ~10,534
  • PostgreSQL (postgres-js)
    ~10,873
  • NATS
    ~11,970
  • IPC
    ~78,932

Completion, 16 slots

jobs/s
  • State adapter (noop notify)
  • In-process
    ~101,041
  • SQLite (better-sqlite3)
    ~15,974
  • SQLite (node:sqlite)
    ~15,342
  • PostgreSQL (postgres-js)
    ~2,590
  • PostgreSQL (pg)
    ~2,676
  • MySQL (mysql2)
    ~1,293
  • MariaDB (mysql2)
    ~1,289
  • Redis (redis)
    ~4,576
  • Redis (ioredis)
    ~6,873
  • Notify adapter (in-process state)
  • In-process
    ~91,548
  • Redis (redis)
    ~16,458
  • Redis (ioredis)
    ~29,435
  • PostgreSQL (pg)
    ~14,927
  • PostgreSQL (postgres-js)
    ~16,067
  • NATS
    ~28,704
  • IPC
    ~81,992

Reproduce

From benchmarks/processing-capacity, with Docker running. Each adapter also has its own start:<adapter> script.

Terminal

pnpm --filter benchmark-processing-capacity start
pnpm --filter benchmark-processing-capacity start:state-postgres-pg
esc

Search guides, integrations and every exported symbol.

↑ ↓ to navigate↵ to open