Edge Load Balancing via URI

The Edge Load Balancer is actually a HAProxy and supports different ways of balancing traffic between servers. One of these is balancing HTTP requests by URI, the web address of the page, which is what we will be looking at in this article.

This type of balancing is used when you need to separate 'heavy' requests from the rest of the traffic and redirect them to a separate pool of servers.

Test infrastructure

To demonstrate this method of balancing, we have deployed three virtual machines in a separate vApp: web1, web2, web3.

In our case, web2 will handle heavy traffic, and web1 and web3 will handle all other traffic.

Temporary fw and dnat rules have been added for debugging and testing the web servers.

Firewall - Allow traffic to the external IP on ports 80 to 83.

NAT - each port is redirected to its own server

The nginx web server was used, and two additional pages, light.html and heavy.html, were added to the home page.

The virtual machine and web server configurations are identical.

The differences are the hostnames, internal IP addresses and the web pages themselves: the header shows the hostname of the web server for clarity.

 

 

Load Balancer configuration

Global Configuration

Enabling balancing

Application Profiles

Add the application profile to be used by the virtual server.

 

 

Service Monitoring

Add web server monitoring. This is not required, but allows you to monitor performance and only use 'live' pool servers.

Monitor or None will be selected in the next step.

 

Pools

Add two pools of servers: for "heavy" traffic and for all other traffic

 

Application Rules

Add a rule that will allow the balancer to distribute traffic into pools depending on URIs:

acl site_heavy path_beg -i /heavy
use_backend pool-web2 if site_heavy

Pages with /heavy addresses will be handed over to pool-web2 pool servers.

There can be more rules than the virtual server uses.

Virtual Servers

Add a virtual server. On the General tab, enable it and select the Application Profile, External IP Address, Protocol and Default Pool.

On the Advanced tab, select the previously defined Application Rules.

The result will be the following settings:

Checking

Homepage

Clicking on the light url

Click on the heavy-link

URI balancing now works, setup is complete.

 

You can find examples of the different rules in the official documentation.

Have you tried Cloud4U services? Not yet?

Visit Website

Try for free

  • Edge, Load Balancer, Balance by URI
  • 70 Users Found This Useful
Was this answer helpful?

Related Articles

Load balancing with advanced edge

A load balancer built into the advanced edge accepts UDP, TCP, HTTP, HTTPS requests and...

Network configuration of VMware infrastructure (NAT, DHCP, Firewall, Static Routing, VPN)

Network configuration of VMware infrastructure (NAT, DHCP, Firewall, Static Routing, VPN)....

How to Redeploy Edge Gateway

If Edge Gateway is not working correctly, when you change Edge Gateway or VDC Network settings,...

How to find out the external IP address in VMware?

You can find the external IP address in the following section of vCloud Director: select...

How to provide access to virtual machine services via the Internet?

  Providing access to Virtual Machine services is done by means of external IP address/port...