---
title: Load balancer for gateway cluster
source: https://docs.newrelic.com/docs/new-relic-control/pipeline-control/gateway/load-balancer-for-gateway
---

New Relic recommends implementing a load balancer for the gateway cluster.

1.  [Assess load requirements](https://docs.newrelic.com/docs/new-relic-control/pipeline-control/sizing-and-scaling):

    -   Determine expected data throughput and identify potential bottlenecks.
    -   Evaluate the number of APM agents and peak load times.

2.  Select load balancer type:

    -   Choose a [software load balancer that integrates well with Kubernetes](https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/). Options include cloud-based solutions such as [AWS Application Load Balancer](https://docs.aws.amazon.com/eks/latest/userguide/alb-ingress.html), [Google Cloud Load Balancer](https://cloud.google.com/kubernetes-engine/docs/concepts/ingress), or [Azure Load Balancer](https://learn.microsoft.com/en-us/troubleshoot/azure/azure-kubernetes/load-bal-ingress-c/create-unmanaged-ingress-controller?tabs=azure-cli), as well as open-source solutions like [NGINX](https://kubernetes.github.io/ingress-nginx/) or [Traefik](https://doc.traefik.io/traefik/providers/kubernetes-ingress/).

3.  Configure load balancer:

    -   Set up the load balancer to distribute traffic evenly across multiple gateway instances within the Kubernetes cluster.
    -   Implement health checks to ensure only healthy instances receive traffic.

4.  Set up DNS and certificates:

    -   Configure DNS entries to ensure seamless routing of data to your gateway.
    -   Obtain and set up SSL/TLS certificates to secure communication between agents and the gateway.
    -   Ensure the certificate is properly configured for the load balancer to maintain secure data transfer.

5.  Size and scale:

    -   Configure auto-scaling policies to add or remove instances based on predefined thresholds, such as CPU usage or network traffic.
    -   Monitor performance metrics to adjust scaling policies as needed.

6.  Test and optimize:

    -   Conduct load testing to ensure effective traffic distribution and identify any bottlenecks.
    -   Optimize configurations to minimize latency and maximize throughput.

As an example, learn more about how to [implement a load balancer specifically using AWS services](https://docs.newrelic.com/docs/new-relic-control/pipeline-control/aws-alb-for-gateway)
