Load balancing
Friscia, Michael
michael.friscia at yale.edu
Thu May 10 13:17:42 UTC 2018
I’m working on a project to perform A/B testing with the web hosting platform. The simple version is that we are hosted everything on Azure and want to compare using their Web Apps versus running a VM with IIS.
My question is about load balancing since there seems to be two ways to go about this. First is to use a simple config where I setup the three hosts I’m testing like this:
upstream ym-host
{
least_conn;
server ysm-iis-prod1.northcentralus.cloudapp.azure.com;
server ysm-iis-prod2.northcentralus.cloudapp.azure.com;
server ysm-ym-live-prod.trafficmanager.net;
}
This works but I am not sure how to set a header to indicate which host is being used.
The alternative is to use split_client and the same configuration looks like this:
upstream ym_host1
{
server ysm-iis-prod1.northcentralus.cloudapp.azure.com;
}
upstream ym_host2
{
server ysm-iis-prod2.northcentralus.cloudapp.azure.com;
}
upstream ym_host3
{
server ysm-ym-live-prod.trafficmanager.net;
}
split_clients "$arg_token" $ymhost
{
25% ym_host1;
25% ym_host2;
50% ym_host3;
}
Granted the $arg_token will change to something else but for now I use that since I can manipulate it easier.
The benefit of the second is that I can add a header like X-UpstreamHost $ymhost and then I can see which host I am hitting.
The benefit of the first is using the least connected round robin approach but I can’t add a header to indicate which host is being hit. For good reasons I won’t get into, adding the header at the web app is not an option.
My question is three part
1. Which is considered the best approach to load balance for this sort of testing?
2. Is there a way to get the name of the host being used if I stick with the simpler approach that uses just the single upstream configuration?
3. What would be the best variable to use for the split_client approach to achieve closest to a round robin?
___________________________________________
Michael Friscia
Office of Communications
Yale School of Medicine
(203) 737-7932 - office
(203) 931-5381 - mobile
http://web.yale.edu<http://web.yale.edu/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20180510/642ff7ae/attachment-0001.html>
More information about the nginx
mailing list