r/programming • u/nickcraver • Feb 17 '16
Stack Overflow: The Architecture - 2016 Edition
http://nickcraver.com/blog/2016/02/17/stack-overflow-the-architecture-2016-edition/
1.7k
Upvotes
r/programming • u/nickcraver • Feb 17 '16
View all comments
Show parent comment
5
u/nickcraver Feb 18 '16
Websockets are the majority of our concurrent connections since webpage requests are pretty brief (we send a 5-15 second keepalive, depending on what you're hitting). During peak traffic, it's about a half million websockets, but that's on both sides of the load balancer - so roughly a million connections.
The 4 load balancers are: 2 for CloudFlare (or whatever DDoS mitigation) and 2 direct. One of each pair is "active" (via keepalived, though the each set actually has 2 sections of the /24 active for multi-IP-per-bind setups). We can run out of ephemeral ports, but we current mitigate this in two ways: 1) Inside HAProxy from TLS processes (bind 2 3 4 procs) to the :80 (bind 1 proc) frontend, we're using abstract named sockets. 2) We bind the socket servers running on the web tier to multiple sockets (5 currently), and we add them as separate "servers" in the HAProxy backend (here's a screenshot).
Here's a recent hardware list, but I'll be doing a follow-up post with more hardware details soon.