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: Number at least
0.01, encoded as a string, for both the global key and target annotation. - Default:
"200"for the global key. The annotation is unset by default. KPA applies target utilization after selecting the RPS target;containerConcurrencydoes not cap an RPS target.
See the v1.24 configuration parser, annotation validation, and target resolution for these constraints and interactions.
Example:
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: helloworld-go
namespace: default
spec:
template:
metadata:
annotations:
autoscaling.knative.dev/target: "150"
autoscaling.knative.dev/metric: "rps"
spec:
containers:
- image: ghcr.io/knative/helloworld-go:latest
apiVersion: v1
kind: ConfigMap
metadata:
name: config-autoscaler
namespace: knative-serving
data:
requests-per-second-target-default: "150"
apiVersion: operator.knative.dev/v1beta1
kind: KnativeServing
metadata:
name: knative-serving
spec:
config:
autoscaler:
requests-per-second-target-default: "150"