AI Crawler · Collection Records

Bot summary · Last 24 hours

top — Real-time process status

A basic tool that shows the top processes by CPU and memory usage in real time. The starting point for identifying the cause of load.
Markdown source·Anything to add or correct?

💬 "top command"

top shows system load and processes in real time. This is the first screen to check when something seems wrong.

You can see load average, CPU usage, memory, and top processes at a glance.

  • load average: Average load over 1/5/15 minutes. Compare it with the number of CPU cores to interpret it.
  • %Cpu(s): The share of user/system/iowait. If iowait is high, it's a disk bottleneck.
  • MiB Mem: Total/used/free memory. If free is close to 0, it's dangerous.
  • Process list: Top CPU or memory processes are displayed.

Frequently used options

OptionDescription
-HDisplay by thread
-u <user>View only a specific user's processes
-b -n 1Output only once (for scripts/collection)
-o %MEMSort by memory

Three essential command combinations

  • top -b -n 1 | head -15 — Capture current state once
  • top -o %CPU -b -n 1 | head -20 — Check top CPU-consuming processes
  • top -u www-data -b -n 1 | head — View only web server account processes

💬 "Tell me how to use it together with monitoring"

Here are common situations on production servers, organized in order.

Step 1 · Check overall load

Check load average and CPU/memory status.


top -b -n 1 | head -5

Step 2 · Identify the culprit process

Check the top CPU/memory processes.


top -o %CPU -b -n 1 | head -12

Step 3 · Further inspection

Look at the details of that process.


ps -o pid,ppid,%cpu,%mem,etime,cmd -p <PID>

How it's used in practice

1. Slow server response

Situation — Web response suddenly became slow.


top -b -n 1 | head -5

Result — If load average is significantly higher than the number of cores or iowait is high, you can narrow down the cause.

Point — Even if load is high, if the CPU is idle it may be I/O wait, so check %Cpu(s) as well.

2. Running low on memory

Situation — You're worried about OOM.


top -o %MEM -b -n 1 | head -12

Result — Find processes using a lot of memory and consider limiting or restarting them.

Point — Check with free -h and also verify whether swap is being used.

Things to watch out for

  • Since top refreshes in real time, use -b -n 1 to print only once in scripts.
  • Load average should be interpreted relative to core count (for example, on 8 cores, 8 means saturation).
  • Because it is a momentary snapshot, it can miss short spikes, so repeated collection may be necessary.

Actual execution screen

This is the result of checking load average and CPU/memory status.

!top command execution result: system load and processes

Production server


Source (HTML): https://games.aidebatehub.com/programs/linux/services/top.html This file is an auto-generated Markdown twin of the DevHub document.

Visitor Comments

Loading…
💬 Comments: 0 · Author type: human | Built: 2026-10-30T20:31:00+09:00