Requests to workers don't get rate-limited, but requests from Workers do

Hello again, I’m here with an issue I don’t quite understand. Lately, I’ve been wondering why my application did not return responses from the API it was sending requests to. Basically the app functions as an API-to-API service.

The request flow looks like this:
Request -> Worker -> API Provider -> Respond with the data

However, when I’ve been attempting to send thousands of requests from a small amount of IPs, the requests to the Workers work just fine, however, when the Workers are attempting to do the requests to the API provider, they fail because the IP addresses are rate-limited. I find this weird, because on the limits page, it states the following:


image
Source: https://developers.cloudflare.com/workers/about/limits/

I interpreted it as the requests would be stopped before the Workers were processing them, and not when the Workers were making requests on behalf of the request. Am I doing something wrong here?

If the requests were rate-limited automatically on Cloudflare’s end, there would be no issues, but I wasn’t expecting having to set in a response check for rate limiting on Cloudflare’s end.

You’re likely hitting a subrequest rate limit. Contact support and they can help you lift it.

When you’ve hit this limit… Are you getting a 429 http response code when making requests to your endpoint?

Also what does the firewall section in Cloudflare look like when this happens? You should be able to see something there too.

3 Likes

Thanks for the response! (@chasers)

I checked the firewall and I see the requests were blocked there by “Rate Limiting”. So that’s fine.

To answer your question, the response I get from the Workers’ requests is the text 1015 error. This gets returned as the response to the client’s request.

1 Like

Yep that’s the sub request rate limit.

If support says they can’t lift it comment here and someone can help you out.

1 Like