Search code examples
iisload-balancingf5

Does a request from the local machine go through the load balancer?


What happens in a load-balanced environment when an application on a server requests a resource on the same local machine?

In the scenario below I would like to understand whether the xml request will pass through the load balancer or not. How much network traffic would be generated?

Load balancer - F5
Windows Server 2008 R2 - 1x Server only 
WCF web service (IIS website)
Microsoft .NET console app (client)

The application is a console app that requests data from the web service.


Solution

  • If the request is directed toward the public IP address of the local server, it will generally be routed through the load balancer (customized routing setups may alter that).

    If the request is directed to localhost (127.0.0.1), the request will go directly to the local server.

    If the request is directed to a private IP address (e.g a 192.168.x.x address), the request is not likely to be routed through the router, but it depends on your specific network configuration.

    To ensure the console app does not go through the router, have it talk to localhost. If you use host headers on the web server to differentiate different websites on the same public IP address, you can setup an alternate mapping on a different port, e.g. if you currently talk to mysubdomain.domain.com, you could setup localhost:8888 as an alternative.