0
votes

We're looking to implement load balancing for our asp.net site using IIS Application Request Routing (ARR). Weighted Round Robin seems like a decent starting point, but we would like to do something custom and we're hoping that someone out there can help point us in the right direction.

We would like the ability to route certain requests to specific servers, but let the rest of the requests function like a round robin to the remaining load balanced servers. For example, consider the following five requests that come into our load balancer running ARR:

1.) https://example.com/api/myendpoint/36321
2.) https://example.com/somepage.aspx
3.) https://example.com/documents/upload.aspx
4.) https://example.com/orders/orderdetails.aspx
5.) https://example.com/anotherpage.aspx?p1=432

We would like request #1 to be routed to our api server based on the "/api/" in the url. We would like request #3 to be routed to our documents server based on the "/documents/" in the url. The other three requests should follow round robin and be distributed accordingly to our generic load balanced servers.

Is this possible using ARR? If so, how would we configure it? If not, what tools are available to accomplish this?

Thanks!

1

1 Answers

0
votes

If you want to stick purely to IIS then I'd follow the pattern below. The trick will be getting your rules setup, but in general you'll need 3 re-writes:

  1. Write a rule that matches ./api/. and route it to your api server.
  2. Write a rule that matches ./documents/. and route it to your documents server.
  3. Write a rule that doesn't match ./documents/. ./api/. and direct it to your round robin server farm. For the round robin you should read this article: http://www.iis.net/learn/extensions/configuring-application-request-routing-%28arr%29/http-load-balancing-using-application-request-routing and this article: http://www.iis.net/learn/extensions/configuring-application-request-routing-(arr)/define-and-configure-an-application-request-routing-server-farm

To learn more about writing the rules, see: http://www.iis.net/learn/extensions/url-rewrite-module/creating-rewrite-rules-for-the-url-rewrite-module