Cedexis Logo

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 activate an account. 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.

Tools Used

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

A web application that needs to be high performance but also serves a large audience frequently needs to be hosted across multiple services. Dynamically generated content may be processed by application engines such as CenturyLink AppFog, while static assets such as images, PDFs, and JavaScript are served by a content delivery network (CDN). However, because of the complexity of the Internet, it's nearly impossible for any single service provider to reach every end user with the most speed and efficiency.

This challenge has prompted the development of a number of innovative solutions for spreading application traffic across multiple channels. The most sophisticated solutions, such as Cedexis Openmix, implement performance-based cross-provider load balancing using real user monitoring (RUM). Performance-based load monitoring uses a JavaScript tag or other monitoring code embedded in the web application to figure out which providers offer the fastest, most reliable service to each end user.

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.

  1. Log-in to the CenturyLink Cloud Control Portal.
  2. From the Navigation Menu, click Network > Load Balancer.
  3. From the "Load Balancer" page, click create load balancer.
  4. Select the data center to host your new load balancer. Add a name and description.

    Create Load Balancer

  5. Click create load balancer.

  6. You will be returned to the "Load Balancer" page. It might take a few minutes for your new load balancer to be provisioned.

    Provision a Load Balancer

  7. 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.

  8. Click add pool.
  9. You can now configure a group of IP addresses to be part of this pool.
  10. Set mode / port to http and 80.
  11. Select method and persistence modes that match the requirements of your web application.
  12. Add the IP address and port of each web application server to the nodes section. For web services, the port will usually be 80.
  13. 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.

  1. Log-in to your Cedexis Portal account.
  2. Click Platforms in the left column.
  3. Click the + icon in the upper right-hand corner to open the "New Platform" dialog.
  4. From the drop-down menu, click CATEGORY > Cloud Computing.
  5. Select the CenturyLink Cloud data center from the PLATFORM drop-down menu.

    Add a new platform to Cedexis

  6. Click NEXT.

  7. 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.

  • A Custom Javascript Application uses the Cedexis API to make complex decisions based on any number of metrics and variables collected by Cedexis tools.

  • 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:

  1. Log-in to your Cedexis Portal account.
  2. In the left column, click Openmix > Application Configuration.
  3. Click the + icon in the upper right-hand corner to open the "New Openmix Application" window.
  4. For APPLICATION TYPE, select "Optimal RTT" from the drop-down menu.

    New Openmix Application

  5. Enter NAME, DESCRIPTION, and TAGS to suit your project requirements.

  6. Click NEXT to go to the "Fallback Information" window.
  7. For FALLBACK, enter the IP address of one of your CenturyLink load balancers.
  8. Click NEXT to go to the "Availability Information" window.
  9. Click NEXT to go to the "Platform Information" window.
  10. For PLATFORM, select one of your CenturyLink data centers.
  11. For CNAME/IP, enter the IP address of your CenturyLink Load Balancer for this data center.
  12. Click + ADD PLATFORM.
  13. Repeat steps 10 through 12 for each CenturyLink data center or content provider you wish to add.
  14. Click COMPLETE.
  15. On the "Application created" window, click PUBLISH.

Note: Record the CNAME for your new Openmix application for later configuration.

Application CNAME

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

Note that the ending IP address (which is" in this example) will change according to Cedexis's realtime performance measurements from your Internet provider.

Next Steps

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.