Service Discovery and Load Balancing

Service Discovery and Load Balancing

DC/OS provides a number of tools out of the box for service discovery and load balancing. Here’s an overview of the options, with some general guidelines on what to use in which situations.

Tool Type When should I use it?
VIPs (Minuteman) A layer 4 load balancer, which can be used for most TCP traffic for any Mesos task within a DC/OS cluster. When you have internal-only TCP services which do not require layer 7 features.
Marathon-LB Marathon-LB is an HAProxy based load balancer for Marathon only. When you require external routing or layer 7 load balancing features. Examples of layer 7 features include: TLS termination, zero-downtime deployments, HTTP sticky sessions, load balancing algorithm customization, network ACLs, HTTP basic auth, gzip compression, and more.
Mesos-DNS Mesos-DNS is a basic DNS-based service discovery tool that works with any Mesos task. When VIPs or Marathon-LB are not adequate, you can use the auto-generated Mesos-DNS names. For example, to discover Marathon-LB you’d use Mesos-DNS by connecting to Marathon-LB with marathon-lb.marathon.mesos. Or, if you have UDP services such as StatsD.
Third Party Solutions Service Discovery solutions provided by the DC/OS Community. Intended for more specific use cases.

DNS Reference

This quick reference provides a summary of the available options.

    Load Balancing and VIPs

    DC/OS comes with an east-west load balancer that’s meant to be used to enable multi-tier microservices architectures. It acts as a TCP Layer 4 load balancer, and it’s tightly integrated with the kernel. The internal Layer 4 load balancer component (dcos-minuteman.service) is also known as Minuteman.

    Marathon-LB

    Marathon-LB is based on HAProxy, a rapid proxy and load balancer. HAProxy provides proxying and load balancing for TCP and HTTP based applications, with features such as SSL support, HTTP compression, health checking, Lua scripting and more. Marathon-LB subscribes to Marathon’s event bus and updates the HAProxy configuration in real time.

    Mesos-DNS

    Mesos-DNS provides service discovery within DC/OS clusters. It is fully integrated into DC/OS and allows applications and services on the cluster to find each other through the domain name system (DNS), similar to how services discover each other throughout the Internet.

    Third Party Solutions

    In addition to VIPs, Minuteman, Marathon-LB, and Mesos-DNS, the DC/OS Universe provides other third party solutions intended for more specific use cases.