Scale Data Plane
Scale API7 Gateway data plane nodes horizontally to increase throughput and prepare for high-availability deployments.
API7 Gateway data plane (DP) nodes are stateless, which makes them straightforward to scale horizontally as traffic grows. Use this page when you need to add capacity to an existing deployment.
If you are planning a production deployment, read these guides together:
- Autoscale Data Plane on Kubernetes for Kubernetes-based automatic scaling.
- Data Plane High Availability for load balancers, health checks, and node failure handling.
- Data Plane Resilience for surviving extended control plane outages.
Horizontal Scaling
Horizontal scaling involves adding more data plane nodes to your deployment. This is the most common way to increase the capacity of API7 Gateway.
Stateless Design
The data plane nodes do not store any local state. All configurations are received from the control plane and held in memory. This means you can add or remove DP nodes without losing any configuration or affecting the overall system stability.
Load Balancer Configuration
A load balancer (such as NGINX, HAProxy, or a cloud provider's load balancer) is typically placed in front of the data plane nodes to distribute incoming traffic.
- Health Checks: Configure the load balancer to perform regular health checks on the DP nodes (typically at port 7085, using the
/statusor/status/readyendpoints). This listener ships disabled by default — enablestatus_endpoint(Helm) or uncomment thestatusblock inconfig.yaml(Docker/binary) first. See Configure Data Plane. - Load Balancing Algorithms: Use algorithms like Round Robin, Least Connections, or IP Hash, depending on your traffic patterns.
Kubernetes Horizontal Pod Autoscaling (HPA)
If you are running API7 Gateway on Kubernetes, the api7/gateway chart ships a HorizontalPodAutoscaler that scales the data plane pods on CPU or memory utilization. Enable it in your Helm values:
autoscaling:
enabled: true
minReplicas: 2
maxReplicas: 10
targetCPUUtilizationPercentage: 70Autoscaling needs a CPU request on the gateway pods to measure utilization against, and a Metrics Server in the cluster to report it. See Autoscale Data Plane on Kubernetes for both, and for writing your own HPA instead.
Manual Scaling
In non-Kubernetes environments, you can manually scale the data plane by starting new DP nodes and adding them to the load balancer's upstream pool.
- Start New DP Node: Deploy a new DP instance with the same configuration as existing nodes.
- Verify Connectivity: Ensure the new node can connect to the control plane.
- Add to Load Balancer: Update your load balancer configuration to include the new node's IP address.
Considerations for Scaling
When scaling the data plane, consider the following:
- Control plane capacity: Ensure the control plane can handle the increased number of DP nodes connecting to it.
- Network Bandwidth: Monitor network bandwidth to ensure it doesn't become a bottleneck as you add more nodes.
- Upstream Performance: Scaling the gateway will likely increase the load on your upstream services. Ensure they can handle the additional traffic.