How do you investigate high CPU or memory use of a specific container?
IntermediateProductionOperations, Rootless & Podman
Answer
docker stats --no-stream
docker top app -eo pid,ppid,pcpu,pmem,cmd
PID=$(docker inspect -f '{{.State.Pid}}' app); sudo nsenter -t $PID -p -m top
sudo perf top -p $PID
Then use language profilers (async-profiler, py-spy dump --pid, pprof). Check throttling in cpu.stat too.
More on Operations, Rootless & Podman
How do you set up rootless Docker on Ubuntu?IntermediateHow do rootless containers handle privileged ports and networking?AdvancedWhat is Podman Quadlet?AdvancedCan Podman run Docker Compose files?IntermediateWhat is a Podman pod?IntermediateHow do you remove all Docker containers, images and volumes safely in a dev environment?Beginner