Redirect to specific origin with load balancing?

I've been reading the documentation for load balancing because it's a service I'm considering purchasing in the near future for a project, I'd be interested in Geo steering for pools and Random steering for origins. However, I would also like to provide the option for a user to send their request to a specific origin, ideally through something like a request header or a query string, bypassing load balancing. Would it be possible to do this through configuring load balancing or would I have to make that user use a different URL for their request, and use subdomains for different origins or something?
29 Replies
Brandon | Cloudflare TSE
Check out Origin Rules 👍
Kris
KrisOP14mo ago
The reason I ask if it's possible to do through configuring load balancing is so that request is taken into account when distributing requests, otherwise a user could slow down a server by bypassing load balancing and the load balancer wouldn't know any better
Brandon | Cloudflare TSE
Load Balancing itself is more for doing exactly that, balancing the load over multiple handlers. It only has a small subset of rules that it can apply to traffic, and it looks like Query String is one of the operators.
No description
Brandon | Cloudflare TSE
sorry, let me give you the full screenshot context there
Kris
KrisOP14mo ago
oh that looks perfect thank you I was just reading the traffic steering documentation and didn't see any way to create custom rules like that
Brandon | Cloudflare TSE
there's more options but i don't want to send a gazillion screenies and i do believe you can add more custom rules to a LB, or we might be able to expand it.
Kris
KrisOP14mo ago
just one should be enough for this but it's good to know that option is available
Brandon | Cloudflare TSE
heck it
Brandon | Cloudflare TSE
that's all the options for incoming request attributes 👍
Kris
KrisOP14mo ago
awesome, thanks
Brandon | Cloudflare TSE
you bet
Kris
KrisOP14mo ago
here when it says "terminates" as the override, could you clarify what that means please? terminates the load balancer and forwards the request, or terminates the request?
Kris
KrisOP14mo ago
based on those possible actions, there doesn't seem to be a way to redirect to a specific origin, unless i'm missing something?
Brandon | Cloudflare TSE
Origin pool override, like my very first screenshot. If the request matches <your selections> override the LB logic with <origin pool you pick>
Kris
KrisOP14mo ago
so to go to a specific origin I'd create an origin pool with just one origin in it? can an origin be in multiple pools?
Brandon | Cloudflare TSE
If you want the option to select one specific origin, then yeah it looks like it'd have to be in its own pool. and I do believe you can have the same origin in multiple pools. For example, you could set pool1 for origin A, origin B, and set the origin weight to 50/50 random selection. then you could do pool2 for Origin A and Origin C, 50/50 random. Set the weight for both pools to 50% Then Pool 3 can have its own, standalone origin server, with no weight, but you can still select it in the custom rule. that seems to be my understanding of it at the moment.
Brandon | Cloudflare TSE
yeah, like this.
No description
No description
Kris
KrisOP14mo ago
I've just realised the limit for the number of pools is 20, the same as the number of origins. I was originally going to create pools based on geographical regions and then use random to spread the load, but I think now it makes more sense to just have each origin in its own pool and then use dynamic traffic steering. if i'm reading the docs right RTT should take into account both geographical region and if the server is running slower because of increased traffic (outside of the server actually slowing down because its at full capacity there is no advantage to me to having an even number of requests across all origins. Geographic region is the most important factor and then if the origin is struggling then requests should go elsewhere which is what dynamic seems to do because round trip time would increase if the server was behind right?), and having each in its own pool gives me the option to redirect to any specific origin
Brandon | Cloudflare TSE
don't use my screenshot as evidence, i have custom entitlements the base LB plan comes with two origins
Kris
KrisOP14mo ago
oh no i used the docs for that
Kris
KrisOP14mo ago
No description
Brandon | Cloudflare TSE
yeah, 20 LBs and 20 pools i think is the default, and you can choose how many origins, up to 8 i think nice
Kris
KrisOP14mo ago
i believe it's $5 a month for 2 origins and then $5 per additional origin per month up to 20
Brandon | Cloudflare TSE
5 bucks per origin after 2 iirc, check the LB pricing page or the dash, when you click "Enable" it brings up a pricing options modal
Kris
KrisOP14mo ago
and i doubt i will ever hit the limitation of 20 origins i'm not a big company yet i'm just a person lol anyways thank you for your help and enjoy the rest of your day possibly consider eating something for lunch as well as sleeping
Want results from more Discord servers?
Add your server