Exceeded the limit of 1,000 worker routes

Anyone know why I would suddenly get this error when there are over 1,300 routes already on the worker?
15 Replies
Scott
ScottOP2mo ago
This is not documented anywhere, and my app is currently broken to new users.
Erisa
Erisa2mo ago
It's documented here https://developers.cloudflare.com/workers/platform/limits/#routes-and-domains It shouldn't have let you go above it though, unless you had those 1,300 before the limit was in place (1 or 2 years ago at a guess?) The official process to get it raised is to fill out https://forms.gle/ukpeZVLWLnKeixDu7, but there isn't a guarantee about response times and the docs say to consider using Workers for Platforms instead.
Scott
ScottOP2mo ago
Yeah I see, it actually hit 1,000 exactly. Thanks. I'll look into that. Yeah i see the worker has more than 1,000 routes but the zone does not
Erisa
Erisa2mo ago
Interesting, the docs say it should be 1,000 per worker and separately also 1,000 per zone Oh wait no I understood that wrong, it's 1,000 zones per worker, not 1,000 routes per worker So a Worker can have more than 1,000 routes as long as they're on different zones, while a zone can't have more than 1,000 routes across all Workers It's not a fun limit to run up against out of nowhere, but it is documented at least and has been for as long as I can remember the limit being a thing
Scott
ScottOP2mo ago
Yeah thats right, it looks like can potentially do away with this though if I pay for the workers for platforms There must be a way to do this without a cap
Walshy
Walshy2mo ago
Workers for Platforms is the solution, you should not have over 1k routes. Even more than a hundred sounds like you're heading in a bad direction
Scott
ScottOP2mo ago
I'm looking into that, but don't I still need to specify which customer routes hit the worker? Even if I am using wildcard subdomains, every customer needs a route, no? customer.domain.com is CNAMEing to hosting.mydomain.com, and I'm adding a route for the customer. but are you thinking I can make this work with just one route? the hosting route?
Chaika
Chaika2mo ago
Cloudflare Docs
Workers as your fallback origin · Cloudflare for Platforms docs
Learn how to use a Worker as the fallback origin for your SaaS zone.
Chaika
Chaika2mo ago
WfP would let you deploy different workers per customer which you execute via binding, ex: Dispatch worker */* -> uses something like hostname/etc to dynamically call specific user worker or if it's a single worker for all, just */* Worth mentioning, as that guide says, */* will grab everything and you need to exclude your own domain *domain.com/* if you have any other unused subdomains. I always just tell people to get a seperate domain for CF For SaaS to avoid any issues, since firewall rules/etc apply too, easy to accidentally effect custom hostnames if they use the same domain as your main website
Scott
ScottOP2mo ago
ah where do you exclude?
Chaika
Chaika2mo ago
you can just make a second worker route with Service: none
Scott
ScottOP2mo ago
so lets say i dont want the room domain for my main site to hit it it does seem the asterisk is working across all sites just might want to handle exlcusions now
Chaika
Chaika2mo ago
room.mainsite.com/* service: none
Scott
ScottOP2mo ago
i see.. and is it not possible to do something like this? api.*/* i have a worker for just api routes how does the worker know what URL to send to the worker though, using the wildcard? anything resolving to my domain? i guess i can just move this logic into a single worker oh anything entering the proxy is going to hit that worker
Chaika
Chaika2mo ago
it doesn't change it, it's just whatever it receives wildcards have to be at the beginning and end

Did you find this page helpful?