Skip to content
Calcrivo

WebSocket Capacity Calculator

Size WebSocket fan-out: servers required, message rate, bandwidth and the memory each long-lived connection pins.

Inputs

connections
messages/min
bytes
KB
connections

Servers Required

4

Aggregate Message Rate

20,000messages/s

Bandwidth

81.92Mbps

Total Connection Memory

4 GiB

Memory per Server

977 MiB

Step by step

  1. Values used

    Concurrent WebSocket connections = 200,000 connections; Messages per connection per minute = 6 messages/min; Average message size = 512 bytes; Memory per connection = 20 KB; Connections per server = 60,000 connections

  2. WebSocket Capacity

    servers = ceil(connections ÷ per-server limit); message rate = connections × messages per minute ÷ 60; bandwidth = message rate × message size × 8.

  3. Servers Required

    = 4

  4. Aggregate Message Rate

    = 20,000 messages/s

  5. Bandwidth

    = 81.92 Mbps

  6. Total Connection Memory

    = 4,096,000,000

  7. Memory per Server

    = 1,024,000,000

How it works

WebSocket connections are idle most of the time but never close, so capacity is driven by memory and file descriptors rather than request rate. The message rate and its bandwidth are computed separately because a large fan-out can be bandwidth-trivial and memory-enormous. Long-lived connections do not drain: after a deployment every client reconnects at once, so the per-server ceiling has to leave room for the whole population to land on the remaining nodes.

Formula

WebSocket Capacity

servers = ceil(connections ÷ per-server limit); message rate = connections × messages per minute ÷ 60; bandwidth = message rate × message size × 8.

perServer
Connections one server can hold, usually bounded by ephemeral ports and memory
memPerConnKb
Socket buffers plus application state per open connection

Frequently Asked Questions

How is WebSocket Capacity calculated?

servers = ceil(connections ÷ per-server limit); message rate = connections × messages per minute ÷ 60; bandwidth = message rate × message size × 8. WebSocket connections are idle most of the time but never close, so capacity is driven by memory and file descriptors rather than request rate. The message rate and its bandwidth are computed separately because a large fan-out can be bandwidth-trivial and memory-enormous.

Why does WebSocket Capacity matter?

Long-lived connections do not drain: after a deployment every client reconnects at once, so the per-server ceiling has to leave room for the whole population to land on the remaining nodes.

What values do I need to enter?

This calculator takes 5 inputs: Concurrent WebSocket connections, Messages per connection per minute, Average message size, Memory per connection, Connections per server. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.

You might also need