Configuring the requests per second (RPS) target

This setting specifies a target for requests-per-second per replica of an application. Your revision must also be configured to use the rps metric annotation.

  • Global key: requests-per-second-target-default
  • Per-revision annotation key: autoscaling.knative.dev/target
  • Possible values: An integer.
  • Default: "200"

Example:

Per RevisionGlobal (ConfigMap)Global (Operator)

  1. apiVersion: serving.knative.dev/v1
  2. kind: Service
  3. metadata:
  4. name: helloworld-go
  5. namespace: default
  6. spec:
  7. template:
  8. metadata:
  9. annotations:
  10. autoscaling.knative.dev/target: "150"
  11. autoscaling.knative.dev/metric: "rps"
  12. spec:
  13. containers:
  14. - image: ghcr.io/knative/helloworld-go:latest
  1. apiVersion: v1
  2. kind: ConfigMap
  3. metadata:
  4. name: config-autoscaler
  5. namespace: knative-serving
  6. data:
  7. requests-per-second-target-default: "150"
  1. apiVersion: operator.knative.dev/v1alpha1
  2. kind: KnativeServing
  3. metadata:
  4. name: knative-serving
  5. spec:
  6. config:
  7. autoscaler:
  8. requests-per-second-target-default: "150"