microsoft / azure-container-apps

Roadmap and issues for Azure Container Apps
MIT License
355 stars 27 forks source link

HTTP scaling not working as expected #1167

Open janssensjeroen opened 1 month ago

janssensjeroen commented 1 month ago

This issue is a: (mark with an x)

Issue description

I'm not entirely sure whether this is a bug or a bug in the documentation, but HTTP scaling does not work as documented.

A small highlight from the documentation:

Every 15 seconds, the number of concurrent requests is calculated as the number of requests in the past 15 seconds divided by 15. In the following example, the revision scales out up to five replicas and can scale in to zero. The scaling property is set to 100 concurrent requests per second.

From this documentation I understand that scaling is done based on the number of concurrent requests per second and this is calculated every 15 seconds over a period of the last 15 seconds. But when I send X number of requests per second to the container app, the scaling does not behave as I expect.

Steps to reproduce

  1. Create container app with ingress enabled, minimum scale replicas 0, maximum scale replicas 5 and an http scale rule for 10 concurrent requests
  2. For 10 minutes send 1 request per second to the container app
  3. For 10 minutes send 20 requests per second to the container app
  4. For 10 minutes run 1 request per second to the container app

Expected behavior [What you expected to happen.]

  1. For the first 10 minutes I expect 1 replica to be active (since there is only 1 request per second)
  2. For the second 10 minutes I expect 2 replicas to be active eventually (since there are 20 requests per second)
  3. For the third 10 minutes I expect 1 replica to be active eventually (since there is only 1 request per second)

Actual behavior [What actually happened.]

  1. For the first 10 minutes there were 3 replicas active
  2. For the second 10 minutes there were 5 replicas active
  3. For the third 10 minutes there were 5 replicas active

Screenshots
Replica count screenshot from Azure portal: image

Request count screenshot from Azure portal (requests per minute): image

Request count screenshot from Datadog (requests per second): image