To increase the maximum throughput of Kong Gateway deployed in a Kubernetes environment, you need to determine which resources to adjust.
How do I adjust resources to increase maximum throughput for Kong Gateway in Kubernetes?
What resources should be adjusted for Kong Gateway deployed in a Kubernetes environment to increase maximum throughput?
Throughput is primarily CPU-bound, so increase CPU allocation and run a performance benchmark to determine the right amount. Scale vertically (more CPU per pod) or horizontally (more pods) based on the results.
Solution
When preparing to scale Kong Gateway to increase maximum throughput, it’s essential to ensure that you have adequate CPU and memory resources. The maximum throughput Kong Gateway can handle is highly dependent on these resources. To accommodate the increased load, it’s better to add more compute power, which typically involves increasing the CPU allocation to handle the additional requests.
The exact amount of CPU to increase can vary based on several factors, including the type of requests being processed, network latency, and other use case-specific details. Therefore, we recommend conducting performance benchmarking and optimization exercises to determine the precise resource requirements.
Here are the steps you should consider:
- Review the current resource usage (CPU and memory usage, resource limits) and the minimum and maximum number of pods per cluster.
- Consult the Kong Gateway sizing guidelines to understand the scaling dimensions.
- Plan and run a performance test simulating the additional transactions per second (
tps) to assess if the current resources can handle the increased load. - Based on the performance test results, adjust the CPU resources accordingly. This may involve scaling vertically (increasing the CPU resources for existing pods) or horizontally (adding more pods to the cluster).
It’s important to note that while you may have enough capacity both vertically and horizontally to support your required throughput increase, the performance test will provide the best indication of whether additional adjustments are needed.
Remember to monitor the performance and resource usage closely after implementing the changes to ensure that Kong Gateway is operating optimally with the increased traffic.