CertGrid CertGrid
Hands-on Lab·LPIC-2

Load, memory, and what the numbers mean

Topic 200 is capacity planning, and almost all of it is interpretation rather than commands. This guide reads load, memory, CPU and disk from a deliberately idle machine and is specific about what each number does NOT mean - because the commonest capacity mistakes are misreadings, not missing tools.

201: Capacity Planning Guide 10 of 29 Intermediate

One host, deliberately idle. Every command on these pages reads a counter or a pseudo-file; nothing is configured and no process is signalled.
Server NameIP AddressOSRolesCPURAMHDD
LPIC2-A01192.168.0.78Ubuntu 26.04 LTSPrimary service host - BIND, Apache, Samba, Postfix. Topic 204 RAID runs on loop devices; this machine has no spare disk2 Core4 GB50 GB

This guide includes

Use this for capacity planning, which is interpretation rather than commands. This matters because load average is not a percentage - and the memory figure most people read is the wrong one.

Before you start

  1. Load average is not a percentage

    Two numbers together, or neither means anything.

    bash Example session
    uptime; echo "---"; nproc; echo "--- load is runnable+uninterruptible tasks, NOT a percentage" 06:58:29 up 20:29,  1 user,  load average: 0.11, 0.12, 0.09---2--- load is runnable+uninterruptible tasks, NOT a percentagecat /proc/loadavg; echo "--- 1min 5min 15min running/total lastpid"0.11 0.12 0.09 1/144 10453--- 1min 5min 15min running/total lastpid

    Expected resultload average: 0.11, 0.12, 0.09 on a machine with 2 CPUs, and 1/144 runnable out of total tasks.

    Success conditionYou can say whether a load figure is high without guessing.

  2. Memory, and the number people misread

    free is fine. available is the answer.

    bash Example session
    free -h; echo "--- available is the number that matters, not free"               total        used        free      shared  buff/cache   availableMem:           3.3Gi       518Mi       2.3Gi       4.1Mi       781Mi       2.8GiSwap:          3.8Gi          0B       3.8Gi--- available is the number that matters, not freegrep -E '^(MemTotal|MemFree|MemAvailable|Buffers|^Cached|SwapTotal|SwapFree)' /proc/meminfoMemTotal:        3480376 kBMemFree:         2387232 kBMemAvailable:    2954824 kBBuffers:           77488 kBCached:           679708 kBSwapTotal:       4003836 kBSwapFree:        4003836 kBcat /proc/sys/vm/swappiness; echo "--- how eagerly the kernel swaps, 0-100"60--- how eagerly the kernel swaps, 0-100

    Expected result3.3Gi total, 518Mi used, 2.3Gi free but 2.8Gi available, 781Mi in buff/cache - and swappiness 60 with no swap in use.

    Success conditionYou can answer "is this machine short of memory" correctly.

  3. Where the time goes

    Three sampling tools, and one shared trap.

    bash Example session
    vmstat 1 3 2>/dev/null | tail -3; echo "--- the FIRST line is an average since boot, ignore it" 0  0      0 2389936  77488 723256    0    0    14    20  121    0  0  0 100  0  0  0 0  0      0 2395256  77488 723348    0    0     0     0  135   68  0  0 100  0  0  0 0  0      0 2402484  77488 723348    0    0     0     0  133   67  0  0 100  0  0  0--- the FIRST line is an average since boot, ignore itiostat -x 1 2 2>/dev/null | tail -6 || echo "iostat not installed - sysstat package"loop1            0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00    0.00    0.00   0.00loop2            0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00    0.00    0.00   0.00sda              0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00    0.00    0.00   0.00sdb              0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00    0.00    0.00   0.00sar -u 1 2 2>/dev/null | tail -3 || echo "sar has no data yet - sysstat collection may be off"06:58:34 AM     all      0.00      0.00      0.00      0.00      0.00    100.0006:58:35 AM     all      0.00      0.00      0.00      0.00      0.00    100.00Average:        all      0.00      0.00      0.00      0.00      0.00    100.00

    Expected resultvmstat showing 100 idle with no swap activity, iostat with every device at zero, and sar reporting 100% idle across two samples.

    Success conditionYou can sample CPU and disk over an interval rather than guessing.

  4. Two ways a disk fills up

    Blocks and inodes are separate limits.

    bash Example session
    df -h / /boot | column -tFilesystem                         Size  Used  Avail  Use%  Mounted  on/dev/mapper/ubuntu--vg-ubuntu--lv  48G   6.9G  39G    16%   //dev/sda2                          2.0G  101M  1.7G   6%    /bootdf -i / | column -t; echo "--- inodes: a filesystem can be full with space left"Filesystem                         Inodes   IUsed   IFree    IUse%  Mounted  on/dev/mapper/ubuntu--vg-ubuntu--lv  3145728  117327  3028401  4%     /--- inodes: a filesystem can be full with space leftsudo -n du -xh --max-depth=1 /var 2>/dev/null | sort -h | tail -5824K	/var/backups30M	/var/log164M	/var/cache190M	/var/lib383M	/var

    Expected result48G root at 16% used; 3145728 inodes with 4% used; and /var totalling 383M with /var/lib and /var/cache largest.

    Success conditionYou can diagnose a full filesystem that still reports free space.

Troubleshooting

Official sources