BotNetwork

Horizontally scaling webhook bots

Dedup, sticky sessions myths and shared state.

Guide1 min readUpdated

Why it matters

Horizontal scaling for webhook bots means sticky-less handlers, shared idempotency keys and a queue for slow work — not just more replicas.

Practical steps

  1. Make handlers idempotent using update/event ids in a shared store.
  2. ACK fast on every replica; push slow work to a queue.
  3. Centralize rate-limit state (Redis) rather than per-process counters.
  4. Use readiness probes so half-dead replicas stop getting traffic.
  5. Load-test with realistic signature-valid payloads.

Watch out for

  • In-memory dedupe that fails across replicas.
  • Long LLM calls inside the request before ACK.

Related comparisons and tools