How to configure multiple origins with load balancing algorithms

When you create an edge application, you need to define an origin. However, more complex and robust infrastructures may need multiple origins for the same application. The Load Balancer module allows you to use load balancing algorithms to manage high access numbers and control the behaviors of your origin.

The following steps will walk you through a hypothetical scenario where the default origin should be of the Load Balancer-type with the Round Robin algorithm. Feel free to interpret and modify the step-by-step instructions according to your specific use case.

The following business rules of different origin servers must be configured with load balancing:

  • The application should have three origins.
    • The primary server should have a higher load capacity.
    • The secondary server should have a medium load capacity, enough to handle large surges of incoming traffic.
    • The backup server should have a low load capacity and only be active in special circumstances.
  • Each of these servers should be hosted in a different storage provider or cloud service since server outages don’t often occur simultaneously.
  • All origins must contain the same content and be set up in the exact same way for the edge application.

Therefore, the setup would be:

OriginRoleAddressLoad capacityStatus
1Primary serverexample.comHigh load capacityShould always be active.
2Secondary serverexample.netMedium load capacityShould always be active.
3Backup serverexample.orgLow load capacityShould only be active in case of maintenance or traffic surges.

First, to enable the Load Balancer module:

  1. Access Azion Console > Edge Application.
  2. Click the edge application for which you want to configure a new origin with load balancer.
  3. On the Main Settings tab, under Modules, activate Load Balancer.
  4. Click the Save button.

To customize the origin according to the scenario described above:

  1. Select the Origins tab.
  2. In the Origins tab, click the Default Origin from the list.
  3. Give your new origin a name.
  4. Under Type, select Load Balancer.
  5. In the Method field, select Round-Robin.
  6. In the first Address field, specify the primary server. For example, example.com`.
  7. Since this origin has a higher load capacity, in the Weight field, add a weight of 3 to this first origin.
  8. In the Server Role field, keep Primary selected.
  9. Keep this origin Active.
  10. In the second Address field, specify the secondary server. In this case, example.net.
  11. Due to its lower capacity, in the Weight field, add a weight of 2 to this origin.
  12. In the Server Role field, select Primary. This origin has a lower weight value, the preferred origin for connections will be the first.
  13. Keep this origin Active.
  14. Add a third origin by clicking the + Add Origin button.
  15. In the Address field, specify the backup origin. In this case, example.org.
  16. Keep the Weight field blank. It’ll assume a default value of 1.
  17. In the Server Role field, select Backup.
  18. Disable this origin by turning off the Active switch.
  19. Click the Save button.

Wait a few minutes for the changes to propagate. Then, access your application or use the command line to make a request and check if the changes were made.


Contributors