Load Balancers

Load balance traffic to your servers.

ECmanaged provides high availability for your applications. You can easily setup HAProxy based load balancer with ECmanaged. We provide both layer 4 (TCP) and layer 7 (HTTP/HTTPS) load balancing.

You can create a pool of servers to host your application and balancer will choose between them to serve request depending upon the algorithm used. ECmanaged supports various load balancing algorithms(descriptions excerpted from official documentation):

  • Random: A random server is used to serve the request.

  • Roundrobin(Weighted): Each server is used in turns, according to their weights. This is the smoothest and fairest algorithm when the server's processing time remains equally distributed. This algorithm is dynamic, which means that server weights may be adjusted on the fly for slow starts for instance. It is limited by design to 4095 active servers per backend.

  • Roundrobin: Each server is used in turns, according to their weights. This algorithm is as similar to roundrobin(Weighted) except that it is static, which means that changing a server's weight on the fly will have no effect. On the other hand, it has no design limitation on the number of servers, and when a server goes up, it is always immediately reintroduced into the farm, once the full map is recomputed. It also uses slightly less CPU to run (around -1%).

  • Leastconnection: The server with the lowest number of connections receives the connection. Round-robin is performed within groups of servers of the same load to ensure that all servers will be used.

  • Leastconnection(Weighted): The server with the lowest number of connections receives the connection. But you can put weights to the servers. So, a server with powerful resources can get more connections than a small server.

  • Source: The source IP address is hashed and divided by the total weight of the running servers to designate which server will receive the request. This ensures that the same client IP address will always reach the same server as long as no server goes down or up. If the hash result changes due to the number of running servers changing, many clients will be directed to a different server. This algorithm is generally used in TCP mode where no cookie may be inserted. It may also be used on the Internet to provide a best-effort stickiness to clients which refuse session cookies. This algorithm is static by default, which means that changing a server's weight on the fly will have no effect,

ECmanaged supports persistent connection i.e. you can configure your balancer to forward request of an user to the same backend server.

The balancer continuously checks health of the servers. It enables automatic removal of failed servers. ECmanaged provides easy configuration of health checks using TCP, HTTP, and HTTPS protocol.

You can create your load balancer in two ways:

  • Server as Balancer: The balancer is instantiated on your preferred provider and can be used to balance traffic between multiple provider.

  • Provider's Balancer: ECmanaged also supports provider balancer. Provider load balancer is limited to only servers hosted on that provider. Currently supported providers are:
    • Amazon
    • Linode
    • Rackspace

You will create your balancer with Add New Load Balancer wizard. ECmanaged will install and configure HAProxy in a cloud server without your intervention. You can access the wizard from Infrastructure > Balancers and then clicking the New Load Balancer button, as shown below:

In the first step, Basic Information, you need to select the balancer type which is either Server as balancer or Provider's balancer. Depending on your balancer type, you choose the Provider and Balancing Algorithm. You can also choose to use persistent connection. Picture below shows an example:

In Ports step, you define the ports you want to load balance. You can choose between TCP, HTTP and HTTPS. You can bind multiple ports.

You select the ping protocol and port in the Health Check step. You can select between TCP, HTTP and HTTPS. You can also select Interval between checks (2s to 120s), Timeout check (1s - 60s) and Number of checks (2 to 10 tries).

In the last step Cloud servers, you can choose the servers to create the pool for load balancing. if you have chosen Provider's balancer then you are limited to the servers hosted on that provider, else you can select from servers from all providers.

Then, you click Save and start button to create and start the load balancer. Picture below shows a successful initiation of load balancer: