When your web application grows in popularity, it becomes more and more difficult to efficiently provide fast service to all of your users. This tutorial explores ways of using Cedexis Openmix to intelligently route traffic across multiple application origins, providing the fastest possible service to each end user.
Before We Start
If you don’t have a CenturyLink Cloud account yet, head over to our website and sign up for a free trial. You’ll need it to access CenturyLink Cloud Compute servers and other services.
You will also need a Cedexis Portal account. Visit the Cedexis Portal new account page and create one. You will need this to set up a new Openmix load balancer.
CenturyLink Cloud Network Load Balancer is a multi-tenant, scalable and programmable infrastructure presented to the customer as a service. It is based on Citrix® NetScaler®.
Cedexis Openmix is a scriptable global traffic-management service that reacts to real-time data. It can be used to balance traffic across cloud providers, CDNs, and bare metal servers.
Web Applications Across Clouds
This tutorial gets you started with a simple multi-tiered load balancing setup. Closest to your content, we will set up a CenturyLink Load Balancer to handle distribution of traffic across a number of services in a specific data center. Closest to the user, we will deploy a Cedexis Openmix application to balance traffic across content providers and CDNs.
CenturyLink Load Balancer
A CenturyLink Load Balancer can be used to distribute network traffic across multiple virtual private servers, network applications, or any service that can run over TCP. In this section, we will set up a load balancer to distribute traffic across virtual servers that all live in the same data center.
- Log-in to the CenturyLink Cloud Control Portal.
- From the Navigation Menu, click Network > Load Balancer.
- From the "Load Balancer" page, click create load balancer.
Select the data center to host your new load balancer. Add a name and description.
Click create load balancer.
You will be returned to the "Load Balancer" page. It might take a few minutes for your new load balancer to be provisioned.
Once your new load balancer is ready, click on its name on the "Load Balancer" page. You will be taken to a status and configuration page.
- Click add pool.
- You can now configure a group of IP addresses to be part of this pool.
- Set mode / port to
- Select method and persistence modes that match the requirements of your web application.
- Add the IP address and port of each web application server to the nodes section. For web services, the port will usually be
- Click add pool.
Note: Record the IP address of your load balancer. We will need it to configure the Openmix Application later in the tutorial.
Cedexis Openmix Application
In this example, we will only be adding one content delivery platform to our Cedexis Openmix application. However, note that this is a second tier of load-balancing that operates between the CenturyLink load balancer and the end-user. To take full advantage of Openmix, you will need to configure multiple delivery platforms so it has options to pick from.
One solution that takes full advantage of CenturyLink Cloud's multi-homed services is to create a separate Load Balancer for each data center. For example, this means hosting web applications on multiple virtual servers in both VA1 and WA1, for example. Create a load balancer in each data center using the directions in the previous section to handle traffic distribution across each data center individually.
Add a Cedexis Platform
Cedexis Openmix relies on delivery platforms to measure web application performance, and an application to distribute traffic across multiple platforms. To add platforms to Cedexis Openmix, follow these steps.
- Log-in to your Cedexis Portal account.
- Click Platforms in the left column.
- Click the + icon in the upper right-hand corner to open the "New Platform" dialog.
- From the drop-down menu, click CATEGORY > Cloud Computing.
Select the CenturyLink Cloud data center from the PLATFORM drop-down menu.
- You don't need to fill out anything on the next screen, so click COMPLETE.
Repeat this process for each CenturyLink Load Balancer data center or other content delivery platform you wish to add.
Create an Openmix Application
The Openmix application routes traffic to your CenturyLink Load Balancers based on the algorithm you tell it to use. Before you dive into configuration, let's take a moment to understand what the different options are.
Optimal RTT uses Cedexis Radar and real user measurements to intelligently route network traffic along the fastest possible path. This is the option we will use.
Round Robin is the simplest form of traffic management. It simply hands network traffic to each provider in turn.
Static Routing routes one Cedexis Openmix application to a single service provider.
To add a new Openmix application and configure it to use Optimal RTT, follow these steps:
- Log-in to your Cedexis Portal account.
- In the left column, click Openmix > Application Configuration.
- Click the + icon in the upper right-hand corner to open the "New Openmix Application" window.
For APPLICATION TYPE, select "Optimal RTT" from the drop-down menu.
Enter NAME, DESCRIPTION, and TAGS to suit your project requirements.
- Click NEXT to go to the "Fallback Information" window.
- For FALLBACK, enter the IP address of one of your CenturyLink load balancers.
- Click NEXT to go to the "Availability Information" window.
- Click NEXT to go to the "Platform Information" window.
- For PLATFORM, select one of your CenturyLink data centers.
- For CNAME/IP, enter the IP address of your CenturyLink Load Balancer for this data center.
- Click + ADD PLATFORM.
- Repeat steps 10 through 12 for each CenturyLink data center or content provider you wish to add.
- Click COMPLETE.
- On the "Application created" window, click PUBLISH.
Note: Record the CNAME for your new Openmix application for later configuration.
Routing Traffic with DNS
Cedexis Openmix uses DNS to route traffic. In your DNS configuration create a CNAME record for your web application and point it at the CNAME for your Openmix application. If you look up your web application's address from the command line, it should look similar to the following:
$ host tutorial1.example.com tutorial1.example.com is an alias for 2-01-2e8d-000b.cdx.cedexis.net. 2-01-2e8d-000b.cdx.cedexis.net has address 126.96.36.199
Note that the ending IP address (which is 188.8.131.52" in this example) will change according to Cedexis's realtime performance measurements from your Internet provider.
The next step is to separate the static elements of your web application and deliver them through a separate Cedexis Openmix application. This step usually includes deploying multiple CDNs, so it can be a little more complicated. The process can vary widely based on the CDNs you select, but most of the steps in this tutorial will still guide you to a successfully configured performance-based load balancer.
Sign-up for our Developer-focused newsletter CODE. Designed hands-on by developers, for developers. Keep up to date on topics of interest: tutorials, tips and tricks, and community building events.
We’re a different kind of cloud provider – let us show you why.