1

I have an ASP.NET Web App (not web role) deployed to Azure that's being load-balanced. I'm using Redis to handle shared Session data.

I'd like to provide, for testing purposes, a way to trigger a page load to use a different server. The goal is to output the Server's local hostname (already done) and watch it change while also watching the Session data remain the same.

I'm fine if this "different server" only means "resolve the load balancing again but wipe the stickiness from my current server" (i.e. there's only a 66% chance to get a new server with my 3-server scaling). I'm also fine if this is a client-side or server-side solution. However, I don't want it to be a hands-on infrastructure solution (i.e. I want to avoid needing to get a browser on each of all 3 servers then drop the distribution down to 1 server and watch two browsers transition seamlessly to the one leftover server). I want this to be controlled by the testers, assisted by functionality in the app created by the developers.

Is something like this possible?

Jaxidian
  • 13,081
  • 8
  • 83
  • 125

1 Answers1

2

The "stickiness" is controlled by the Application Request Routing Affinity cookie (ARRAfinity). By clearing this cookie, you might get another roll of the web balancer dice.

Here's a similar question

P.S. A common technique for identifying the web farm server remotely is embedding the server hostname in an HTML comment at the bottom of your master layout page.

Community
  • 1
  • 1
Jeff Moser
  • 19,727
  • 6
  • 65
  • 85
  • I see you are correct. I was going off of some incorrect assumptions after reading this: http://azure.microsoft.com/blog/2014/10/30/azure-load-balancer-new-distribution-mode/ P.S. For my purposes, I can put the server name smack dab on the screen where it's nice and convenient. I'll now add a button, too! Thanks for answering yet another Azure question for me!! :-) – Jaxidian Jun 09 '15 at 16:43
  • 2
    Or better yet, I'll do something like this now that I know what to search for: `` – Jaxidian Jun 09 '15 at 16:52
  • Could also do that conditionally based off the authenticated user – Jeff Moser Jun 09 '15 at 16:55
  • That's also a good idea. I now have quite a few options to tackle this easily now that you've pointed out the cookie to work with. Thanks!! – Jaxidian Jun 09 '15 at 16:58