docs/daprdocs/content/en/operations/configuration/increase-request-size.md

1.6 KiB

type title linkTitle weight description
docs How-To: Handle larger body requests Request body size 6000 Configure http requests that are bigger than 4 MB

{{% alert title="Note" color="primary" %}} The existing flag/annotationdapr-http-max-request-size has been deprecated and updated to max-body-size. {{% /alert %}}

By default, Dapr has a limit for the request body size, set to 4MB. You can change this for both HTTP and gRPC requests by defining:

  • The dapr.io/max-body-size annotation, or
  • The --max-body-size flag.

{{< tabpane text=true >}}

{{% tab "Self-hosted" %}}

When running in self-hosted mode, use the --max-body-size flag to configure Dapr to use non-default request body size:

dapr run --max-body-size 16 node app.js

{{% /tab %}}

{{% tab "Kubernetes" %}}

On Kubernetes, set the following annotations in your deployment YAML:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: myapp
  namespace: default
  labels:
    app: myapp
spec:
  replicas: 1
  selector:
    matchLabels:
      app: myapp
  template:
    metadata:
      labels:
        app: myapp
      annotations:
        dapr.io/enabled: "true"
        dapr.io/app-id: "myapp"
        dapr.io/app-port: "8000"
        dapr.io/max-body-size: "16"
#...

{{% /tab %}}

{{< /tabpane >}}

This tells Dapr to set the maximum request body size to 16 MB for both HTTP and gRPC requests.

[Dapr Kubernetes pod annotations spec]({{% ref arguments-annotations-overview.md %}})

Next steps

{{< button text="Install sidecar certificates" page="install-certificates.md" >}}