Skip to content

High KEDA_HTTP_CONNECT_TIMEOUT causes slow cold starts #1385

@linkvt

Description

@linkvt

Report

Reported in discussion #1382

KEDA_HTTP_CONNECT_TIMEOUT is used as the base duration for exponential backoff retries, not just as TCP connection timeout. This causes unnecessarily slow cold start responses.

With default KEDA_HTTP_CONNECT_TIMEOUT=500ms I'm seeing these numbers, its even worse with higher timeouts:

  • Actual TCP connection time: <5ms
  • Cold start response time: ~3.5s
  • Expected response time: ~1.5s
KEDA_HTTP_CONNECT_TIMEOUT Measured Response Time
500ms (default) 3.35s
5s 7.81s
20s 21.54s

Expected Behavior

Cold start requests should complete in ~1-1.5 seconds (pod startup time + minimal connection overhead).

Actual Behavior

Cold start requests take 3-3.5 seconds due to 500ms retry backoff intervals, even though TCP connections succeed in <5ms within the cluster.

Steps to Reproduce the Problem

  1. Set high connect timeout: kubectl set env deployment/keda-add-ons-http-interceptor -n keda KEDA_HTTP_CONNECT_TIMEOUT=500ms
  2. Deploy HTTPScaledObject with minReplicas: 0
  3. Scale scaled deployment to 0: kubectl scale deployment <app> --replicas=0
  4. Make request: time curl http://<ingress>/<path> -H "Host: <host>"

Logs from KEDA HTTP operator

no logs

HTTP Add-on Version

0.11.1

Kubernetes Version

1.33

Platform

Any

Anything else?

I will investigate this and create a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    To Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions