Skip to content

Commit 84833b1

Browse files
committed
update with jose's changes
1 parent f35a5a5 commit 84833b1

1 file changed

Lines changed: 19 additions & 12 deletions

File tree

support/azure/azure-kubernetes/availability-performance/identify-memory-saturation-aks.md

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ This article discusses methods for troubleshooting memory saturation issues. Mem
1414
## Prerequisites
1515

1616
- The Kubernetes [kubectl](https://kubernetes.io/docs/reference/kubectl/overview/) command-line tool. To install kubectl by using [Azure CLI](/cli/azure/install-azure-cli), run the [az aks install-cli](/cli/azure/aks#az-aks-install-cli) command.
17-
- The [krew](https://sigs.k8s.io/krew) package manager for installing [Inspektor Gadget](https://go.microsoft.com/fwlink/?linkid=2260072). You can follow the [krew quickstart guide](https://krew.sigs.k8s.io/docs/user-guide/quickstart/) to install it.
18-
- The open source project [Inspektor Gadget](/troubleshoot/azure/azure-kubernetes/logs/capture-system-insights-from-aks#how-to-install-inspektor-gadget-in-an-aks-cluster) for advanced process level memory analysis.
17+
- The open source project [Inspektor Gadget](/troubleshoot/azure/azure-kubernetes/logs/capture-system-insights-from-aks#what-is-inspektor-gadget) for advanced process level memory analysis. You can find details around installation in [this guide](/troubleshoot/azure/azure-kubernetes/logs/capture-system-insights-from-aks#how-to-install-inspektor-gadget-in-an-aks-cluster).
1918

2019
## Symptoms
2120

@@ -166,12 +165,20 @@ Now that you've identified the pods that are using high memory, you can identify
166165

167166
For advanced process level memory analysis, use [Inspektor Gadget](https://go.microsoft.com/fwlink/?linkid=2260072) to monitor real time memory usage at the process level within pods:
168167

168+
1. Install Inspektor Gadget using the instructions found in the [documentation](/troubleshoot/azure/azure-kubernetes/logs/capture-system-insights-from-aks#how-to-install-inspektor-gadget-in-an-aks-cluster)
169+
170+
2. Run the [top_process gadget](https://aka.ms/igtopprocess) to identify processes that are using large amounts of memory. You can use `--fields` to select certain columns and can filter events based on specific field values, for example the pod names of previously identified pods with high memory consumption. You can also
171+
- Identify top memory-consuming processes across the cluster
172+
- Identify top memory-consuming processes on a specific node
173+
- Identify top memory-consuming processes on a specific namespace
174+
169175
```bash
170-
# Install Inspektor Gadget
171-
kubectl krew install gadget
172-
kubectl gadget deploy # Monitor top memory-consuming processes across all containers
176+
# Run top_process across the cluster
173177
kubectl gadget run top_process --sort memoryRelative --max-entries 12
174178

179+
# Monitor processes on a specific pod
180+
kubectl gadget run top_process --sort memoryRelative --podname <pod-name>
181+
175182
# Monitor processes on a specific node
176183
kubectl gadget run top_process --sort memoryRelative --node <node-name>
177184

@@ -183,16 +190,16 @@ For advanced process level memory analysis, use [Inspektor Gadget](https://go.mi
183190

184191
```output
185192
186-
K8S.NODE K8S.NAMESPACE K8S.PODNAME MEMORYVIRTUAL MEMORYRSS MEMORYRELATIVE
187-
aks-agentpool-3…901-vmss000001 default memory-stress 944 MB 943 MB 5.6
188-
aks-agentpool-3…901-vmss000001 default memory-stress 944 MB 943 MB 5.6
189-
aks-agentpool-3…901-vmss000001 default memory-stress 944 MB 872 MB 5.2
190-
aks-agentpool-3…901-vmss000001 default memory-stress 944 MB 796 MB 4.8
191-
aks-agentpool-3…901-vmss000000 436805632 339316736 2.0
193+
K8S.NODE K8S.NAMESPACE K8S.PODNAME PID MEMORYVIRTUAL MEMORYRSS MEMORYRELATIVE
194+
aks-agentpool-3…901-vmss000001 default memory-stress 21676 944 MB 943 MB 5.6
195+
aks-agentpool-3…901-vmss000001 default memory-stress 21678 944 MB 943 MB 5.6
196+
aks-agentpool-3…901-vmss000001 default memory-stress 21677 944 MB 872 MB 5.2
197+
aks-agentpool-3…901-vmss000001 default memory-stress 21679 944 MB 796 MB 4.8
198+
192199
```
193200

194201

195-
You can use this output to identify the processes that are consuming the most memory on the node. The output can include the node name, namespace, pod name, container name, process ID (PID), command name (COMM), CPU and memory usage, check https://inspektor-gadget.io/docs/latest/gadgets/top_process/ for further details
202+
You can use this output to identify the processes that are consuming the most memory on the node. The output can include the node name, namespace, pod name, container name, process ID (PID), command name (COMM), CPU and memory usage, check [the documentation](https://aka.ms/igtopprocess) for more details.
196203

197204

198205
### Step 3: Review best practices to avoid memory saturation

0 commit comments

Comments
 (0)