Back to Blog
team@tinypod.app

How to Monitor Container Resource Usage

Track CPU, memory, and disk usage across your containers. Tools and techniques for understanding where your server resources go.

monitoringcontainersresourcesguide

Why Monitor Containers?


  • Know which containers consume the most resources
  • Right-size your server
  • Detect memory leaks
  • Plan capacity
  • Debug performance issues

  • Built-In Tools


    docker stats / podman stats

    bash

    docker stats --format 'table {{.Name}} {{.CPUPerc}} {{.MemUsage}}'

    Real-time resource usage for all containers.


    docker system df

    bash

    docker system df -v

    Disk usage: images, containers, volumes, build cache.


    Monitoring Stacks


    Lightweight: Beszel

  • Agent collects container metrics
  • Web dashboard with graphs
  • Minimal resource usage

  • Medium: cAdvisor + Prometheus + Grafana

  • cAdvisor: Container metrics exporter
  • Prometheus: Time-series storage
  • Grafana: Dashboards

  • Simple: Glances or Netdata

  • Auto-detect containers
  • Per-container metrics
  • Web dashboard included

  • Key Metrics


    CPU

  • Usage percentage per container
  • Throttled time (hitting CPU limits)

  • Memory

  • Current usage vs limit
  • Cache vs working set
  • OOM (Out of Memory) kills

  • Network

  • RX/TX bytes per container
  • Connection count

  • Disk

  • Container layer size
  • Volume usage
  • I/O operations

  • Setting Limits


    yaml

    services:

    app:

    deploy:

    resources:

    limits:

    cpus: '1.0'

    memory: 512M


    Set limits to prevent one container from starving others.


    TinyPod


    TinyPod provides container resource monitoring out of the box. No setup needed — resource usage is visible in your dashboard.