Skip to content

Max Number of WebSocket Connections that a Single Nats Server can Sustain Reliably #2770

Answered by derekcollison
dsidirop asked this question in Q&A
Discussion options

You must be logged in to vote

This is a great question.

In general, I usually start with what resource will be most constrained. This can be memory, network, or CPU (depending on latency and throughput targets).

For connection's memory footprint, it's fairly simple to run a quick test to measure for yourself the weight of an idle connection in your setup. Last we looked you should see ~20-30k or so per on avg.

Note to pay attention to how many connections would need to fail over in case of a server loss or upgrade, and whether those connections are TLS based (esp RSA). That could cause thundering herd and CPU issues. Most clients have jitter baked in, and ECC keys help alot, but something to keep in mind when scaling …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dsidirop
Comment options

Answer selected by derekcollison
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants