WebSocket Capacity Calculator
Size WebSocket fan-out: servers required, message rate, bandwidth and the memory each long-lived connection pins.
About WebSocket Capacity Calculator
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
Worked example
With the default values below, WebSocket Capacity Calculator returns Servers Required of 4. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Concurrent WebSocket connectionsaccepts 1–100,000,000 connections
- 200,000 connections
- Messages per connection per minuteaccepts 0–100,000 messages/min
- 6 messages/min
- Average message sizeaccepts 1–10,000,000 bytes
- 512 bytes
- Memory per connectionaccepts 1–8,192 KB
- 20 KB
- Connections per serveraccepts 100–10,000,000 connections
- 60,000 connections
Results
- Servers Required
- 4
- Aggregate Message Rate
- 20,000 messages/s
- Bandwidth
- 81.92 Mbps
- Total Connection Memory
- 4 GiB
- Memory per Server
- 977 MiB
Step by step
- 1Values used
- 2WebSocket Capacity
- 3Servers Required= 4
- 4Aggregate Message Rate= 20,000 messages/s
- 5Bandwidth= 81.92 Mbps
- 6Total Connection Memory= 4,096,000,000
- 7Memory per Server= 1,024,000,000
Assumptions and limits
- The result is derived only from the 5 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to 2 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
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.
Related Calculators
You might also need
- Load Balancer Capacity CalculatorCommonly used together
- Session Persistence CalculatorCommonly used together
- HTTP/2 Stream CalculatorCommonly used together
- Connection Pool CalculatorAlso in Load Balancing & ADC
- HAProxy Capacity CalculatorAlso in Load Balancing & ADC
- NGINX Capacity CalculatorAlso in Load Balancing & ADC
