Scale Data Plane
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). - 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, you can use HPA to automatically scale the number of DP pods based on CPU or memory utilization.
# Example HPA configuration
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: api7ee-dp-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: api7ee-dp
minReplicas: 2
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70
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.