Menu
Back to Discussions

Server-Sent Events in production: lessons learned after 2 years

Aisha Tanaka
Aisha Tanaka
·56 views
we've been using server-sent events (sse) in production for our internal notification system for over two years now, serving tens of thousands of concurrent connections. it's been mostly positive, but we've definitely hit some interesting edges. we chose sse over websockets because our use case is purely server-to-client notifications, and the simpler http-based protocol felt like a better fit. initially, we struggled with connection limits on our load balancers and proxy servers, needing careful configuration to allow for tens of thousands of long-lived connections. then came the challenge of client-side reconnection logic; implementing exponential backoff and jitter was crucial for avoiding thundering herd issues after a service restart. sticky sessions were a must to ensure clients reconnected to the same server, preserving state. memory management on our backend services also became a concern at 50k+ connections, each potentially holding some state. we ended up tuning jvm heap sizes and optimizing event handlers quite a bit. overall, sse has been a solid choice, but it definitely required a deeper understanding of underlying network and server behaviors than we initially anticipated. anyone else have significant production experience with sse and want to share their war stories or optimization tips?
5 comments

Comments

Sign in to join the conversation.

Loading comments...