How-To: Handle large HTTP header size
Configure a larger HTTP read buffer size
Dapr has a default limit of 4KB for the HTTP header read buffer size. If you’re sending HTTP headers larger than the default 4KB, you may encounter a Too big request header
service invocation error.
You can increase the HTTP header size by using:
- The
dapr.io/http-read-buffer-size
annotation, or - The
--dapr-http-read-buffer-size
flag when using the CLI.
When running in self-hosted mode, use the --dapr-http-read-buffer-size
flag to configure Dapr to use non-default http header size:
dapr run --dapr-http-read-buffer-size 16 node app.js
This tells Dapr to set maximum read buffer size to 16
KB.
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/http-read-buffer-size: "16"
#...
Related links
Dapr Kubernetes pod annotations spec
Next steps
Handle large HTTP body requestsFeedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.
Last modified December 18, 2024: Merge pull request #4461 from dapr/dependabot/npm_and_yarn/daprdocs/nanoid-3.3.8 (5660a64)