What Does Purple Mean in htop CPU Bar?
The htop command-line utility is a popular interactive
process viewer for Linux that uses color-coded bars to represent CPU
usage. While many users recognize green as standard process activity,
the appearance of purple often causes confusion. In htop, a
purple indicator in the CPU bar specifically represents time spent
running low-priority processes, commonly referred to as
“nice” or “niced” user-space processes. Understanding this color helps
administrators quickly determine if a heavy CPU load is being caused by
background tasks that will automatically yield to higher-priority system
applications.
Understanding the htop CPU Color Code
To get an accurate picture of system performance, htop
breaks down CPU usage into distinct categories, each assigned a specific
color. When looking at the CPU meter at the top of your terminal, the
colors correspond to the following metrics:
- Blue: Low-priority threads (processes with a positive “nice” value greater than 0). On many terminal color schemes, this is represented as purple or violet.
- Green: Normal-priority user-space processes (the standard applications and services running on your system).
- Red: Kernel-space threads and system tasks (time spent by the OS managing hardware, I/O, and system calls).
- Orange/Yellow: Time spent waiting for hardware interrupts (irq and softirq).
What are “Nice” Processes?
In Linux, process scheduling priority is determined by a metric called the “nice” value, which ranges from -20 (highest priority) to 19 (lowest priority).
When a user or a background script launches a task with a high nice
value (such as nice -n 19 backup_script.sh), the system
lowers its execution priority. These tasks are designed to run in the
background without stuttering or slowing down the primary user interface
or critical web servers.
When htop displays purple in the CPU bar, it is simply
telling you that your processor is working hard, but it is doing so on
tasks that will instantly step aside the moment a normal or
high-priority application requests CPU cycles.
Why You See Purple and What to Do
Seeing a large block of purple in your CPU meter is generally not a cause for alarm. It typically indicates that background maintenance is occurring, such as:
- System backups or data compression.
- Video transcoding or rendering.
- Package manager updates and database indexing.
- Distributed computing tasks (like folding@home).
Because these processes are “nice,” they utilize spare CPU capacity
that would otherwise sit idle. If your system begins to lag while the
bar is purple, it may indicate an I/O bottleneck rather than a CPU
bottleneck, as low-priority CPU tasks can still saturate hard drive
read/write speeds. To investigate further, you can look down at the main
process list in htop and sort by the NI
(Nice) column to identify exactly which background applications are
generating the purple activity block.