How to increase AWS ELB keep-alive timeout when deployed from Traefik

May 8, 2024

The default timeout of the AWS Elastic Load Balancer (ELB) is 60 seconds. For some use cases (like long LLM calls) this might be too short and you might want to increase it.

When deploying Traefik on Kubernetes, it might be hard to find the right configuration to increase the keep-alive timeout on the ELB, as Traefik is the one creating the ELB.

Well, after some searches it is pretty easy to change it. You need to add the right annotation on the Kubernetes Service with the type Load Balancer.

Here is the documentation with available annotations:

With the Traefik Helm chart, it is as simple as updating this values.yaml file:

    # 2 minutes '120'

Some examples of configuration used with nginx ingress controller:

And that's it!