Load Balancing Between Starter Package ECS Instances: Part 2

What Is Server Load Balancer?

Server Load Balancer (SLB) service improves your applications’ performance by forwarding traffic to multiple ECS instances. By distributing traffic, it extends the servicing capability of applications. SLB also helps in eliminating single points of failure (SPOFs) to improve the availability of applications.

- <strong>Listener Protocol</strong>: SLB supports HTTP, HTTPS, TCP, and UDP protocols.
- <strong>Listening Port</strong>: It is used to receive requests and forward it to backend servers.
- <strong>Port of Backend Servers</strong>: The port opened on the backend server to receive requests. It can be the same in an SLB instance.
- <strong>Weight of Backend Servers</strong>: An ECS instance with a higher weight value receives more requests. Setting the weight value to zero is equal to removing the ECS instance from Server Load Balancer.

Create SLB Instance

Log in to your Alibaba Cloud Console and click on the menu icon beside the Alibaba Cloud’s logo, to view all the Alibaba Cloud Products.

  • Primary Zone: It carries traffic in normal conditions.
  • Instance Name: Enter a name for the SLB instance.
  • Backup Zone: If applicable, the secondary zone only takes over traffic when the primary zone is unavailable.
  • Instance Type: There are two types of instances. An Internet SLB instance provides a public IP address and can be accessed from the Internet. An intranet SLB instance provides a private IP address and can be only accessed from the intranet. In this tutorial, we will choose Internet Instance.
  • Instance Spec: Select a performance specification for your SLB instance. The performance varies by the specification. For a shared-performance instance, performance is not guaranteed and resources are shared by all instances. The other instances provide guaranteed performance metrics and are opposite to a shared-performance instance. There are three key performance metrics for guaranteed-performance SLB instances:
  1. Connection Per Second (CPS): The maximum number of new connections that can be established per second.
  2. Query Per Second (QPS): The maximum number of HTTP/HTTPS requests that can be processed per second.
  • Bandwidth: The communications between ECS instances and SLB instances are through an internal network, and do not incur any traffic fees. For more information, refer to Network Traffic Flow. Traffic fees for SLB instances that use the Internet apply to outgoing traffic (downstream traffic) and no fees are charged for incoming traffic (upstream traffic).

Configure HTTP Traffic Forwarding on SLB Instance

To configure HTTP Traffic Forwarding on your SLB Instance, create an HTTP Listener by following the steps below:

Configure HTTPS Traffic Forwarding on SLB Instance

Follow the steps below to configure HTTPS traffic forwarding on your SLB instance:

Redirect HTTP to HTTPS

For redirecting HTTP to HTTPS, you need to create an HTTP Listener by clicking Configure Listener in the Actions column on the Server Load Balancer page and following the below steps:

Traffic Forwarding Based on Domain Names or URLs

Server Load Balancer supports domain name-based and URL-based forwarding rules to forward requests with different domain names or URLs to various backend servers. It helps to process the client’s requests for your service using your domain names instead of the public IP address of your SLB instance.

yourdomain.com. IN A SLB_PUBLIC_IP
www.yourdomain.com. IN A SLB_PUBLIC_IP
http://SLB_PUBLIC_IP/instance.html
http://SLB_DOMAIN_NAME/instance.html

Original Source

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store