GithubHelp home page GithubHelp logo

Comments (3)

skonto avatar skonto commented on June 24, 2024

Hi @daraghlowe, I will take a look on what you report about activation-scale and will get back to you.

from serving.

skonto avatar skonto commented on June 24, 2024

Hi @daraghlowe

We did some testing with using activation-scale but it doesn't solve the problem as the service can scale down to 1 replica when its active if it doesn't get enough request concurrency after initially activating and scaling up to 2. The description of the PR that was merged seems to indicate that it should work like we want it however, but it doesn't.

According to the docs the behavior is:

This value controls the minimum number of replicas that will be created when the Revision scales up from zero. After the Revision has reached this scale one time, this value is ignored. This means that the Revision will scale down after the activation scale is reached if the actual traffic received needs a smaller scale.

Also in the PR: "This annotation will not impact initial-scale values, as it will only apply on subsequent scales from zero."
Now in the code we have:

if a.deciderSpec.ActivationScale > 1 {
  logger.Debug("Considering Activation Scale")
  if dspc > 0 && a.deciderSpec.ActivationScale > desiredStablePodCount {
  ...

if dspc is > 0 due to traffic come in and also revision is active I am wondering why you don't see two pods.
I did try it and don't see less pods, using:

apiVersion: serving.knative.dev/v1
kind: Service
metadata:
  name: autoscale-go
  namespace: default
spec:
  template:
    metadata:
      annotations:
        # Target 10 in-flight-requests per pod.
        autoscaling.knative.dev/target: "10"
        autoscaling.knative.dev/activation-scale: "2"
        autoscaling.knative.dev/target-burst-capacity: "10"
    spec:
      containers:
      - image: ghcr.io/knative/autoscale-go:latest

Could you enable debug logging for the autoscaler and paste the output also provide more details like the ksvc you used?

cc @psschwei @dprotaso if they have more ideas.

from serving.

daraghlowe avatar daraghlowe commented on June 24, 2024

Hi @skonto

I did some additional testing and confirmed that the activation-scale annotation does work as you mentioned. As long as the revision is receiving traffic (i sent one request per 5s) then it will stay scaled up to the the number of replicas set in the activation-scale annotation.

If the revision doesn't receive traffic then it will scale down to 1 replica and it will scale back up to 2 (activation-scale) as soon as you send 1 request.

We were testing in our dev environment where the revision wasn't receiving any traffic and when we saw the replicas scale down from 2 to 1, we misunderstood how it was working as we expected that it would always stay at minimum of 2 replicas and when it scaled down, it would scale down directly to zero rather than scale down to 1 replica first.

Thanks for investigating this and clarifying how it works!

from serving.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.