© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Cloudflare DevelopersCD
Cloudflare Developers•2y ago•
8 replies
favo

Rate Limit not limitting

I have a simple worker that reads an API Key from D1 and shall use the rate limitter to apply limits to it.

I've configured a very small limit in my config to test it:

[[unsafe.bindings]]
name = "RPC_LIMITER"
type = "ratelimit"
namespace_id = "1"
simple = { limit = 1, period = 60 }
[[unsafe.bindings]]
name = "RPC_LIMITER"
type = "ratelimit"
namespace_id = "1"
simple = { limit = 1, period = 60 }


and I wanted to test the limit, it was not applied. Even calling it with a hard coded key does not limit it in my tests:

            const limit = await env.RPC_LIMITER.limit({ key: "apiKey.userId" })
            const { success } = limit
            if (!success) {
                return new Response(`429 Failure – rate limit exceeded for ${apiKey.userId}`, { status: 429 })
            }
            const limit = await env.RPC_LIMITER.limit({ key: "apiKey.userId" })
            const { success } = limit
            if (!success) {
                return new Response(`429 Failure – rate limit exceeded for ${apiKey.userId}`, { status: 429 })
            }


Am I missing something? It seems like the limitter is not incrementing.

Thanks a lot, in advance, for any help!
Cloudflare Developers banner
Cloudflare DevelopersJoin
Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news
85,042Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Rate limit?
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
3y ago
Rate Limit not defined on env
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
2y ago
New worker Rate limit
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
5mo ago
Rate limit namespace_id clarification
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
12mo ago