Workers – Workers are no longer limited to 1000 subrequests

Workers – Workers are no longer limited to 1000 subrequests

Workers no longer have a limit of 1000 subrequests per invocation, allowing you to make more fetch() calls or requests to Cloudflare services on every incoming request. This is especially important for long-running Workers requests, such as open websockets on Durable Objects or long-running Workflows, as these could often exceed this limit and error.

By default, Workers on paid plans are now limited to 10,000 subrequests per invocation, but this limit can be increased up to 10 million by setting the new subrequests limit in your Wrangler configuration file.

  • wrangler.jsonc

    {
    "limits": {
    "subrequests": 50000,
    },
    }
  • wrangler.toml

    [limits]
    subrequests = 50_000

Workers on the free plan remain limited to 50 external subrequests and 1000 subrequests to Cloudflare services per invocation.

To protect against runaway code or unexpected costs, you can also set a lower limit for both subrequests and CPU usage.

  • wrangler.jsonc

    {
    "limits": {
    "subrequests": 10,
    "cpu_ms": 1000,
    },
    }
  • wrangler.toml

    [limits]
    subrequests = 10
    cpu_ms = 1_000

For more information, refer to the Wrangler configuration documentation for limits and subrequest limits.

Source: Cloudflare



Latest Posts

Pass It On
Leave a Comment

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *