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. When sending http headers that are bigger than the default 4KB, you can increase this value. Otherwise, you may encounter a Too big request header service invocation error. You can change the http header size by using the dapr.io/http-read-buffer-size annotation or --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:

  1. 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:

  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: myapp
  5. namespace: default
  6. labels:
  7. app: myapp
  8. spec:
  9. replicas: 1
  10. selector:
  11. matchLabels:
  12. app: myapp
  13. template:
  14. metadata:
  15. labels:
  16. app: myapp
  17. annotations:
  18. dapr.io/enabled: "true"
  19. dapr.io/app-id: "myapp"
  20. dapr.io/app-port: "8000"
  21. dapr.io/http-read-buffer-size: "16"
  22. ...

Last modified June 23, 2022: Merge pull request #2550 from ItalyPaleAle/cosmosdb-harcoded-dapr-version (cf03237)