ALB Average connection duration - how does it work with websockets?

0

Hello,

I have an application that creates let's say 5000 websocket connections and the clients do not close their connection for even months.

When I checked the pricing calculator, https://calculator.aws/#/createCalculator/ElasticLoadBalancing, I was suprised how much I can actually pay for load balancing.

Is ALB a good way how to load balance websockets connections? I would expect to pay around 40 USD for such a thing, but when I enter: Average number of new connections per ALB=100/minute Average connection duration: 86400 seconds (1 day)

I get 314 USD, but the Average connection duration would be much higher in practice.

What can I expect the real price to be? In the calculator, it looks like the Classic Load Balancer does not depend on the Average connection duration, is it a better choice in this case?

Thank you,

Martin

asked 5 days ago42 views
1 Answer
0

Hi Martin,

Handling a large number of persistent WebSocket connections can indeed be costly with AWS Application Load Balancer (ALB). The pricing for ALB is based on Load Balancer Capacity Units (LCUs), which take into account new connections, active connections, processed bytes, and rule evaluations. This can add up quickly, especially with long-lived connections.

Given your scenario, where connections remain open for months, the Classic Load Balancer (CLB) might be a more cost-effective option. CLB pricing is based on the number of hours the load balancer is running and the amount of data transferred1. Since CLB does not charge based on the duration of connections, it could potentially lower your costs significantly.

However, it’s important to note that CLB is considered a legacy service and might not support some of the advanced features available in ALB, such as content-based routing and enhanced security features. If your application doesn’t require these advanced features, CLB could be a suitable choice.

Please find these sources: https://aws.amazon.com/elasticloadbalancing/pricing/ https://www.cloudzero.com/blog/aws-alb-pricing/

profile picture
EXPERT
answered 5 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions