Built in Rust · Apache-2.0

Pub/Sub at
100K Scale

Keethu delivers messages to 100,000 concurrent subscribers with ≤10ms p99 latency — on a single machine. No Kafka cluster. No distributed overhead. Just physics.

Read the Deep-Dive → Explore Features
100K
Concurrent Subscribers
≤10ms
p99 Latency Target
1M+
Messages / Second
0
GC Pauses (Rust)
1
Machine. No Cluster.
Built for the numbers
that matter.

Async Fan-Out Engine

Each published message fans out to all subscribers in ~35 ns per subscriber. At 100K subscribers, the full fan-out completes in ~3.5ms — well inside the 10ms budget.

🔒

Lock-Free Subscription Registry

Topic-to-subscriber mapping lives in a DashMap with 128 independent shards. Publishing to /sports and /finance simultaneously has zero lock contention.

📦

Zero-Copy Message Delivery

Message payloads are reference-counted Bytes objects. Delivering to 100K subscribers clones a pointer, not data — total bytes copied: zero.

🌊

Per-Connection Back-Pressure

Each subscriber gets its own bounded mpsc channel. Slow consumers are isolated — one lagging client never stalls the fan-out for everyone else.

🔌

Custom Binary Protocol

A 16-byte fixed header + JSON metadata + raw payload. Parse cost: 4 integer reads. No header scanning. No ambiguity. Wire captures show KEET… for instant identification.

🦀

Rust + Tokio Runtime

Tokio's work-stealing scheduler runs async tasks across all CPU cores. No GC. Deterministic memory. 100K connections on ~10MB of task state instead of 800GB of thread stacks.

How a message travels
from publisher to 100K subscribers.
1

Publisher sends a PUBLISH frame

16-byte binary header + JSON metadata + raw payload. Keethu decodes the header in <100 ns — four integer reads, no scanning.

2

Atomic sequence number assigned

A single AtomicU64::fetch_add stamps the message with a global sequence in ~5 ns. No mutex. No coordination.

3

DashMap topic lookup

The topic string hashes to one of 128 shards. Only that shard's lock is acquired for ~20–50 ns. All other topics proceed in parallel.

4

Fan-out loop over Vec of subscribers

Cache-friendly Vec iteration. Per subscriber: clone a Bytes pointer (O(1)) + try_send to their mpsc channel (~10 ns). Total: ~35 ns/subscriber.

5

Async write task drains channel → TCP

Each connection's write task reads from its channel and calls write_all. Tokio's epoll reactor fires only when the socket is ready — no polling, no wasted cycles.

Publisher │ │ PUBLISH /sports (payload: 256B) ▼ Keethu Engine │ ├─ seq = fetch_add(1) ~5 ns ├─ DashMap["/sports"] ~20 ns │ └─ Vec[sub_1 .. sub_N] │ ├─ fan-out loop │ for sub in subs { │ frame = build(payload.clone()) O(1) │ sub.tx.try_send(frame) ~10 ns │ } │ ├─ slow consumer? → drop + warn │ (others unaffected) │ ▼ Write Tasks (one per connection) │ ├─ recv from mpsc channel ├─ write_all() → TCP socket └─ Tokio epoll: O(1) readiness
Built for real-time,
high-fan-out workloads.

Market Data Feeds

Push stock quotes, order book updates, and trade ticks to thousands of trading terminals simultaneously with deterministic latency.

Multiplayer Game Servers

Broadcast position updates to all players in a room at 60 Hz. Each frame must reach every client within one tick — 16ms.

IoT Telemetry

Fan out sensor readings from thousands of devices to dashboards, alerting systems, and data pipelines in real time.

Live Dashboards

Stream metrics, logs, and analytics to ops teams and monitoring systems. No polling. Push the moment data changes.

Collaborative Tools

Sync document edits, cursor positions, and presence data between users in shared workspaces with sub-millisecond propagation.

Real-Time Auctions

Deliver bid updates and countdown events to all participants simultaneously. Fairness requires every subscriber gets the same data at the same time.

Every nanosecond accounted for.

Keethu's design is driven by a precise latency budget. Here's where the time goes on a loaded system delivering to 100K subscribers.

OperationCostTechnique
Frame decode (16-byte header)< 100 ns4 u32 reads, no scanning
JSON header parse500 ns – 2 µsserde_json, simd-json option
Sequence number stamp~5 nsAtomicU64::fetch_add (Relaxed)
DashMap topic lookup~20–50 ns128-shard hash, single shard lock
Delivery frame build per subscriber~200 nsBytes::clone is O(1)
try_send to mpsc per subscriber~10–20 nsLock-free channel push
Fan-out 100K subscribers (serial)~3–5 ms35 ns × 100K
TCP flush via Tokio epoll~2–5 µs / connEdge-triggered, non-blocking
Total p50 end-to-end~4–6 msLAN, fully loaded
Total p99 target≤ 10 msIncludes scheduling jitter

Understand every design decision
from first principles.

The deep-dive guide covers CPU cache hierarchies, OS scheduling, TCP internals, Rust's ownership model, and Tokio's work-stealing scheduler — every concept behind Keethu's architecture.

Chapter 1
CPU & Cache Internals
Chapter 2
OS & epoll Deep Dive
Chapter 3
TCP & Zero-Copy
Chapter 4 – 6
Rust, Tokio & Keethu Design
Read the Full Tutorial

Learn Rust in 1 day —
the Keethu way.

Zero to production-quality Rust in 12 focused hours. Ownership, async, traits, macros, unsafe — every concept with real code. No prior systems experience required.

Hour 1 – 4
Setup · Ownership · Types · Errors
Hour 5 – 8
Traits · Iterators · Closures · Smart Ptrs
Hour 9 – 10
Concurrency · Async / Tokio
Hour 11 – 12
Macros · Unsafe · Build a Broker
Start the Rust Tutorial