---
title: Fastly VCL constraints and limitations
summary: null
url: https://www.fastly.com/documentation/reference/vcl/constraints-and-limitations
---

VCL services are subject to the following restrictions or limits:

| Item                         | Limit           | Implications of exceeding the limit                                                                                                                                                                                                                                                                |
| ---------------------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| URL size                     | 8KB             | VCL processing is skipped and a "Too long request string" error is emitted.                                                                                                                                                                                                                        |
| `Cookie` header size         | 32KB            | The cookie header will be unset and Fastly will set `req.http.Fastly-Cookie-Overflow = "1"`, then run your VCL as normal.                                                                                                                                                                          |
| Request header size          | 69KB            | Depending on the circumstances, exceeding the limit can result in Fastly closing the client connection abruptly, the client receiving  a `502 Gateway Error` response with "I/O error" in the body, or receiving a `503 Service Unavailable` response with the text "Header overflow" in the body. |
| Response header size         | 69KB            | A `503` error is triggered with `obj.response` value of "backend read error". This error can be intercepted in `vcl_error`. See [Fastly generated errors](https://www.fastly.com/documentation/guides/concepts/errors/) to learn about all synthetic errors generated by Fastly.                   |
| Request header count         | 255             | VCL processing is skipped or aborted if in progress, and a response with "Header overflow" in the body is emitted. A number of headers are added to the request by Fastly, so the practical limit is lower, but is not a predictable constant. Assuming a practical limit of 200 is safe.          |
| Response header count        | 96              | VCL processing is skipped or aborted if in progress, and a response with "Header overflow" in the body is emitted. A number of headers are added to the response by Fastly, so the practical limit is lower, but is not a predictable constant. Assuming a practical limit of 85 is safe.          |
| `req.body` size              | 8KB             | Larger requests will have an empty `req.body`, so request body payload is available in `req.body` only for payloads smaller than 8KB.                                                                                                                                                              |
| Surrogate key size           | 1KB             | Requests to the [purge API](https://www.fastly.com/documentation/reference/api/purging/) that cite longer keys will fail, so in practical terms it is useless to tag content with keys exceeding the length limit.                                                                                 |
| Surrogate key header size    | 16KB            | Only keys that are entirely within the first 16KB of the surrogate key header value will be applied to the cache object.                                                                                                                                                                           |
| VCL file size                | 1MB             | Attempts to upload [VCL via the API](https://www.fastly.com/documentation/reference/api/vcl-services/vcl/) will fail if the VCL payload is larger.                                                                                                                                                 |
| VCL total size               | 3MB             | Attempts to upload [VCL via the API](https://www.fastly.com/documentation/reference/api/vcl-services/vcl/) will fail if the VCL payload would cause your total service VCL to be larger than this.                                                                                                 |
| `restart` limit              | 3 restarts      | The 4th invocation of the `restart` statement will trigger a `503` error. This error can be intercepted in `vcl_error`.                                                                                                                                                                            |
| Dictionary item count        | 1000            | Attempts to [create dictionary items](https://www.fastly.com/documentation/reference/api/dictionaries/dictionary-item/) will fail if they exceed the limit. Contact [Fastly support](https://support.fastly.com/) to discuss raising this limit.                                                   |
| Dictionary item key length   | 256 characters  | Attempts to [create dictionary items](https://www.fastly.com/documentation/reference/api/dictionaries/dictionary-item/) will fail.                                                                                                                                                                 |
| Dictionary item value length | 8000 characters | Attempts to [create dictionary items](https://www.fastly.com/documentation/reference/api/dictionaries/dictionary-item/) will fail.                                                                                                                                                                 |

> **WARNING:** Personal data should not be incorporated into VCL. Our [Compliance and Law FAQ](https://www.fastly.com/trust/faq) describes in detail how Fastly handles personal data privacy.
