Using CloudFront for Long-Lived WebSocket Connections: Any Limitations?

0
36
Asked By TechyTurtle98 On

I'm running a global service where customers connect through WebSockets. Ideally, we have a 60-second keep-alive, which fits well since CloudFront's idle timeout is 10 minutes. However, I know some devices might not send this keep-alive and could idle for up to 10 minutes. We also evaluated Azure Front Door, which has a hard limit of 4 hours for connections. I'm curious if CloudFront has a similar restriction. I didn't find anything about this in the documentation, aside from the mentioned idle timeout. Has anyone here dealt with WebSockets in a similar application? Any insights or experiences would be really helpful!

5 Answers

Answered By CloudRoadmap12 On

You could also consider routing your WebSockets through CloudFront to API Gateway which upgrades the connection from HTTPS to WSS. As for the timeout, I've heard the idle limit is 10 minutes, with a max connection time of 2 hours.

Answered By UserFriendly23 On

It seems like there's a bit of confusion here. CloudFront isn't just for caching; it also offers DDoS protection, which could be useful for your setup.

Answered By ConnectionGuru77 On

If your WebSocket connection is actively being used, CloudFront won’t time it out. But if it goes idle, it will eventually disconnect after 10 minutes, and the client will need to reconnect, which honestly isn’t a bad thing.

Answered By ReconnectWizard On

Why not have the clients just reconnect if they detect a disconnect? I built a system where WebSockets communicated with an ALB. Disconnections weren't too frequent unless there were network issues, and our clients were programmed to reconnect automatically, which worked well for us.

Answered By CleverCoder99 On

AWS AppSync could be really beneficial for your setup if you're looking for something that handles WebSocket connections more smoothly.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.