A deep dive into benchmarking five Node.js WebSocket servers: default Socket.io, Socket.io with Connection State Recovery, uWebSockets.js, AnyCable OSS, and AnyCable Pro. The post documents two major measurement traps: a saturated single-process load generator that inflated AnyCable's p99 latency from 11ms to 234ms, and a real throughput gap between AnyCable and uWS that turned out to be genuine. Key methodology lessons include running the load generator co-located with servers, sharding clients across multiple processes to avoid event loop saturation, equalizing reconnect backoff windows across libraries, and always validating surprising results with a second independent measurement. Final results show all five servers within a few milliseconds at 10K subscribers, but AnyCable leads on 100% message delivery under network drops, deploy-time reconnect storms, and broadcast throughput at scale, while uWS is lightest per connection and Socket.io caps around 120K connections per node.

16m read timeFrom evilmartians.com
Post cover image
Table of contents
A tour of the Americas, sponsored by an abuse-detection systemLesson zero: get the measuring rig off your laptopThe twist: the rig was still lying, it was just lying from inside Railway nowThe counter-twist: sometimes you are wrong and the rig is rightField notes: the smaller traps that each cost me a nightThe scoreboardWhat “honest” turned out to mean
6.5K Impressions