BLOG

Open Source Spotlight: Auto Scaling Mesos

Lori MacVittie Thumbnail
Lori MacVittie
Published September 25, 2017

Thanks to cloud, auto scaling applications has become nearly synonymous with scalability. If you can’t support auto scaling, you aren’t scalable by most folks’ estimation.

Auto scaling apps in any environment – cloud, container, or traditional for that matter – relies heavily on coordinating specific actions across multiple systems. That coordination is achieved via APIs. Which are the cornerstone of both cloud and containerized environments.

Until recently, auto scaling apps with Mesos was a mostly manual endeavor. Which probably worked fine for the more than half (51%) of Mesos users (according to their survey) who looked to containers for deploying monolithic and legacy applications. But for those adopting Mesos for greater efficacy of resources and agility through scalability, it’s not sustainable. Anytime you must fallback to manual methods of scaling apps you run the risk of human error and incur operational costs that increase the cost per transaction. People don’t work for free, after all, and if they’re spending time on scaling apps up and down, they aren’t able to work on other projects that may be vital to the growth and success of the organization. Too, costs per transaction is an important metric for cloud and container environments, as their efficacy is in part desired to keep those costs down. The more it costs per transaction, the less profit or productivity is realized. And both are important measures of business health these days.

Gaurav Kumar, an engineer at an early enterprise adopter of Mesos, met this challenge in a manner consistent with an open source attitude: he built one. Because APIs and open source enable communities and customers to do that kind of thing.

autoscaling mesos f5

To enable auto scaling of apps within Mesos with an F5 BIG-IP required two existing open source solutions:

  1. F5 Container Connector for Marathon, which is responsible for listening for Marathon events and then configuring a BIG-IP appropriately. 
  2. Prometheus exporter for BIG-IP metrics forked from an existing open source project - BIG-IP Exporter - which collects relevant telemetry (number of TCP connections, HTTP requests, etc…) from a BIG-IP.

Kumar then developed the third leg of this solution, the “F5 based autoscaling component for DCOS/Marathon services” (called ‘F5 Autoscaler’).  

The F5 Autoscaler component fetches statistics from the F5 Exporter and compares them to defined thresholds. When one of those thresholds is reached, the F5 Autoscaler puts in a scaling request to the DCOS master to add a pool member. Marathon fulfills that request as it normally would, by deploying a new container/app instance and then notifying the BIG-IP via the F5 Container Connector for Marathon, which configures the BIG-IP with the new pool member.

Voila! Auto scaling apps.

This solution is a great example of how open source enables organizations to do more than just reduce costs and time to market. It provides a framework for solving real business challenges.  

Open source software highlighted in this spotlight: