More often than not, the bottlenecks in Kong Gateway are caused by bottlenecks in third-party systems used by Kong Gateway.
The following sections explain common third-party bottlenecks and how to fix them.
Action: If you use Redis and any plugin is enabled, the CPU can cause a bottleneck.
Scale Redis vertically by giving it an additional CPU.
Explanation: If you use Redis and any plugin is enabled, ensure Redis is not a bottleneck.
The CPU generally creates a bottleneck for Redis, so check CPU usage first.
If this is the case, scale Redis vertically by giving it an additional CPU.
Action: Migrate to the new DNS client.
Explanation: The new DNS client is designed to be more performant than the old one, so migrating will improve performance.
For more information, see the migration docs.
Action: Increase dns_stale_ttl
or resolver_stale_ttl
v3.8+ to 300
or up to 86400
.
Explanation: DNS servers can bottleneck Kong Gateway since Kong Gateway depends on DNS to determine where to send the request.
In the case of Kubernetes, DNS TTLs are 5 seconds long and can cause problems.
You can increase dns_stale_ttl
or resolver_stale_ttl
, depending on the Kong Gateway version and DNS client you are using, to 300
or up to 86400
to rule out DNS as the issue.
If DNS servers are the root cause, you will see coredns
pods creating a bottleneck on the CPU.