Skip to content

Chapter 1

Introduction

Let’s set the context first and start with “What is a Load Balancer?”. Load balancing refers to efficiently distributing incoming network traffic across a group of backend servers, also known as a server farm or server pool. Modern applications receive hundreds, thousands even millions of requests concurrently.  A load balancer acts as the “traffic cop” sitting in front of your servers and routing client requests across all servers capable of fulfilling those requests in a manner that maximizes speed and capacity utilization and ensures that no server is overworked or overwhelmed, which could degrade performance or completely shut down.

As we stated, we will need this balancing feature for our instances (Workers) in Mulesoft CloudHub. CloudHub is a cloud-based integration platform as a service (iPaaS) that enables developers to integrate and orchestrate applications and services. These applications and services are run on one or more instances of MuleSoft which is known as Workers. A worker is a dedicated instance of Mule for running the application or integration. At some point you might want to access these workers -why else you would have one of the best API Management platforms, right?-, by default this access is provided over a Shared Load Balancer (SLB). The diagram below is actually Mulesoft’s VPC architecture and I think it gives a better understanding of the placement of the SLB.

As the name suggests, a ‘Shared’ Load Balancer is shared between all the CloudHub customers and it sits outside of the Client’s VPC. There is one SLB clustered instance in each CloudHub region that serves all the CloudHub customers in that AWS region. Therefore, SLB can only be used to balance the calls for the external-facing APIs, it can’t be used for balancing the load between your internal workers. You have to directly call them and if you access the workers directly, any load distribution benefits from the CloudHub load balancing layer are lost. Also, SLB is not scalable, you can hit rate limits and it is not much you can do about it.2  At that point, Mulesoft’s Dedicated Load Balancer comes into the picture.

1 https://docs.mulesoft.com/runtime-manager/cloudhub-networking-guide#regional-services
2 https://help.mulesoft.com/s/article/What-is-the-CloudHub-Shared-Load-Balancer-Rate-Limits