You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: Troubleshoot Performance Issues with the Managed NGINX Ingress Controller in AKS
3
-
description: Step-by-step guide to identify and resolve performance issues with the Managed NGINX Ingress Controller in Azure Kubernetes Service (AKS), including common symptoms, root cause analysis, and configuration adjustments.
2
+
title: Troubleshoot Performance Issues With the Managed NGINX Ingress Controller in AKS
3
+
description: Step-by-step guide to identify and resolve performance issues in the Managed NGINX Ingress Controller in AKS.
4
4
ms.reviewer: claudiogodoy
5
5
ms.service: azure-kubernetes-service
6
6
ms.date: 05/24/2025
7
7
---
8
8
# Managed NGINX ingress controller guidance
9
9
10
-
The [Managed NGINX ingress controller](/azure/aks/app-routing) is a routing add-on that enables routing HTTP and HTTPS traffic to applications running on an [Azure Kubernetes Service (AKS)](/azure/aks/) cluster.
10
+
The [Managed NGINX ingress controller](/azure/aks/app-routing) is a routing add-on that enables routing HTTP and HTTPS traffic to applications that run on an [Azure Kubernetes Service (AKS)](/azure/aks/) cluster.
11
11
12
-
In performance-related problems, the routing system may be the root cause. This article provides step-by-step guidance to troubleshoot NGINX ingress controller performance issues.
12
+
The routing system might be the root cause of performance-related problems. This article provides step-by-step guidance to troubleshoot NGINX ingress controller performance issues. This aricle also discusses common symptoms, root cause analysis, and configuration adjustments.
13
13
14
14
## Prerequisites
15
15
16
-
Before you start, ensure you have the following tool installed:
16
+
Before you start, make sure that you have the following tool installed:
17
17
18
-
-**Kubernetes CLI (`kubectl`)**: Use Azure CLI and run the command `az aks install-cli`.
18
+
-**Kubernetes CLI (`kubectl`)**: Use Azure CLI, and run the `az aks install-cli` command.
19
19
20
20
## Symptoms
21
21
@@ -24,24 +24,29 @@ Before you start, ensure you have the following tool installed:
24
24
|**HTTP Gateway Errors**| Error codes like `502` and `504` can indicate an NGINX exhaustion problem. |
25
25
|**High Response Time Difference**| Significant difference between your service response time and the end-to-end response time. There's a common latency added by NGINX. When it's too large, you might have an NGINX exhaustion problem. |
26
26
27
-
## Step 1: Verify horizontal pod autoscaler (HPA) behavior
27
+
## Cause
28
28
29
-
The most common reason for performance issues on the NGINX is CPU exhaustion. During a load spike in the system, a good approach is to monitor [HPA](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/) behavior.
30
-
By default, the routing add-on creates a [namespace](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/) named `app-routing-system`.
29
+
The most common cause of performance issues on the NGINX is CPU exhaustion. During a load spike in the system, a good troubleshooting method is to monitor [HPA](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/) behavior. By default, the routing add-on creates a [namespace](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/) that's named `app-routing-system`.
31
30
32
-
1.**Get the HPA name**:
31
+
## Resolution
32
+
33
+
To troubleshoot the issue, follow these steps.
34
+
35
+
### Step 1: Verify horizontal pod autoscaler (HPA) behavior
36
+
37
+
1. Get the HPA name:
33
38
34
39
```console
35
40
kubectl get hpa -n app-routing-system
36
41
```
37
42
38
-
2. **Monitor the HPA behavior**:
43
+
2. Monitor the `HPA` behavior:
39
44
40
45
```console
41
46
kubectl get hpa <HPA_NAME> -n app-routing-system -w
42
47
```
43
48
44
-
3. **Evaluate the results**:
49
+
3. Evaluate the results:
45
50
46
51
```console
47
52
$ kubectl get hpa <HPA_NAME> -n app-routing-system -w
@@ -52,35 +57,33 @@ By default, the routing add-on creates a [namespace](https://kubernetes.io/docs/
52
57
nginx Deployment/nginx cpu: 133%/70% 1 2 2 80m
53
58
```
54
59
55
-
The **TARGETS** column shows the CPU threshold where the `HPA` triggers to scale up the pods. There are a few possibilities for this behavior:
60
+
The **TARGETS** column shows the CPU threshold at which the `HPA` is triggered to scale up the pods. There are a few possibilities for this behavior:
56
61
57
62
- `HPA` has reached the maximum number of pods.
58
-
- There are no available nodes to schedule the pods.
59
-
60
-
## Step 2: Look for pods in pending state
63
+
- No nodes are available to use to schedule the pods.
61
64
62
-
If in your evaluation you saw that `NGINX HPA` hadn't reached the maximum number of pods, the [kube-scheduler](https://kubernetes.io/docs/concepts/scheduling-eviction/kube-scheduler/#kube-scheduler) might not be able to find available nodes to schedule the `NGINX pods`.
65
+
### Step 2: Look for pods in a pending state
63
66
64
-
1. **Get pending pods**:
67
+
If your evaluation reveals that `NGINX HPA` hasn't reached the maximum number of pods, the [kube-scheduler](https://kubernetes.io/docs/concepts/scheduling-eviction/kube-scheduler/#kube-scheduler) might not be able to find available nodes to use to schedule the `NGINX pods`. To find pending pods, run the following command:
65
68
66
69
```console
67
70
kubectl get pod --field-selector=status.phase=Pending -n app-routing-system
68
71
```
69
72
70
-
> [!NOTE]
71
-
> If there are pending pods, the cluster is probably facing a resource exhaustion problem. See [Troubleshoot pod scheduler errors in Azure Kubernetes Service](azure/azure-kubernetes/availability-performance/troubleshoot-pod-scheduler-errors)for more details.
73
+
> [!NOTE]
74
+
> If there are pending pods, the cluster might experience a resource exhaustion problem. For more information, see [Troubleshoot pod scheduler errors in Azure Kubernetes Service](azure/azure-kubernetes/availability-performance/troubleshoot-pod-scheduler-errors).
72
75
73
-
## Step 3: Verify if there are Limits applied to the NGINX deployment
76
+
### Step 3: Check whether limits are applied to the NGINX deployment
74
77
75
-
Any misconfiguration on the `NGINX` [resource limits or requests](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) can lead to `HPA` scaling up more pods than necessary.
78
+
Any misconfiguration on the `NGINX` [resource limits or requests](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) can cause the `HPA` to scale up more pods than what's necessary. To check the limits, follow these steps:
@@ -99,32 +102,32 @@ Any misconfiguration on the `NGINX` [resource limits or requests](https://kubern
99
102
...
100
103
```
101
104
102
-
## Solution
105
+
## More information
103
106
104
-
By default, the current version of the NGINX ingress controller doesn't set limits for NGINX pods and requests `500m` CPU, which is used by the `HPA`. It's not recommended to change these values directly in the deployment definition.
107
+
By default, the current version of the NGINX ingress controller doesn't set limits for NGINX pods. The controller requests `500m` CPU to be used by the `HPA`. We recommend that you don't change these settings directly in the deployment definition.
105
108
106
-
If your `HPA` is reaching the maximum number of pods and the deployment's requests and limits remain unchanged, configure the [custom resource definition (CRD)](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) named [NginxIngressController](https://github.com/Azure/aks-app-routing-operator/blob/main/config/crd/bases/approuting.kubernetes.azure.com_nginxingresscontrollers.yaml).
109
+
If the `HPA` reaches the maximum number of pods, and the deployment requests and limits remain unchanged, configure the [custom resource definition (CRD)](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) that's named [NginxIngressController](https://github.com/Azure/aks-app-routing-operator/blob/main/config/crd/bases/approuting.kubernetes.azure.com_nginxingresscontrollers.yaml).
107
110
108
111
### Configuration options
109
112
110
-
The following configuration options directly impact the `HPA` behavior:
113
+
The following configuration options directly affect the `HPA` behavior.
0 commit comments