Peter
Peter
CDCloudflare Developers
Created by Sam on 11/11/2024 in #workers-help
rate limiting issues
As long as the time window has not expired, you should eventually be rate limited using any client.
3 replies
CDCloudflare Developers
Created by Sam on 11/11/2024 in #workers-help
rate limiting issues
When you make multiple requests with your browser, it will likely keep the connection open. In turn this will usually route your requests to the same Worker with the latest rate limit state. If you use a client like curl, it will close the connection after each request. This will nearly always route your request to a different server that does not have the latest rate limit state. In fact it may take quite a few requests to return to a Worker that served your client before so that it is able to observe the updated state and apply the block.
3 replies
CDCloudflare Developers
Created by favo on 7/10/2024 in #workers-help
Rate Limit not limitting
When using your browser, it will likely keep the connection open which will increase very significantly the chance that a 2nd and subsequent request reaches the same worker with up to date state.
9 replies
CDCloudflare Developers
Created by favo on 7/10/2024 in #workers-help
Rate Limit not limitting
I agree with what Leo says here. To expand on that, the rate limiting in Workers is not likely going to work very well for really small numbers of requests. To ensure that your Workers are fast (and bills small 🙂 ) the counters are updated in the background. There are many servers in a Colo and there can be several POPs in an MCP to spread your requests over. If you are unlucky you may even find your requests are split between POPs. All of this is to say that the rate limit system will not know about the most recent state on all servers. The key thing is not the 10 seconds but the vast number of servers and the odds of your 2nd curl request being routed to the same server is pretty unlikely. If you need to rate limit on really small numbers of requests in short time periods then I recommend using another Workers product.
9 replies