Skip to content

Commit

Permalink
add docs for how to set qp resources
Browse files Browse the repository at this point in the history
  • Loading branch information
skonto committed Jun 29, 2023
1 parent d9522ed commit 05609d7
Showing 1 changed file with 43 additions and 1 deletion.
44 changes: 43 additions & 1 deletion docs/serving/services/configure-requests-limits-services.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,48 @@ spec:
cpu: 1
```
## Additional resources
## Configure Queue Proxy resources
In order to set the Queue Proxy resource requests and limits you can either
set them globally in the [deployment config map](../configuration/deployment.md) or you can set them at the service level using the corresponding annotations targeting cpu, memory and ephemeral-storage resource types. The previous example becomes:
```yaml
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: example-service
namespace: default
annotations:
queue.sidecar.serving.knative.dev/cpu-resource-request: "1"
queue.sidecar.serving.knative.dev/cpu-resource-limit: "2"
queue.sidecar.serving.knative.dev/memory-resource-request: "1Gi"
queue.sidecar.serving.knative.dev/memory-resource-limit: "2Gi"
queue.sidecar.serving.knative.dev/ephemeral-storage-resource-request: "400Mi"
queue.sidecar.serving.knative.dev/ephemeral-storage-resource-limit: "450Mi"
spec:
template:
spec:
...
```

Alternatively, you could use a special annotation `queue.sidecar.serving.knative.dev/resource-percentage` that calculates the Queue Proxy resources as a percentage of the application's container.
In this case there are min, max boundaries applied to the cpu and memory resource requirements:


| Resource Requirements | Min | Max |
|-------------------------------------------|---------|---------|
| Cpu Request | 25m | 100m |
| Cpu Limit | 40m | 500m |
| Memory Request | 50Mi | 200Mi |
| Memory Limit | 200Mi | 500Mi |


!!! note
If the user simultaneously sets a percentage annotation and a specific resource value via the corresponding resource annotation then the latter takes precedence.

!!! warning
The `queue.sidecar.serving.knative.dev/resource-percentage` annotation is now deprecated and will be removed in future versions.

### Additional resources

* For more information requests and limits for Kubernetes resources, see [Managing Resources for Containers](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/).

0 comments on commit 05609d7

Please sign in to comment.