busy is a small Linux utility designed to generate a high CPU workload for testing and observing CPU temperature and thermal behavior.
It automatically detects the number of CPUs currently online and creates one worker process per CPU. Each worker continuously consumes CPU time, allowing the system to reach a high CPU utilization level.
The main purpose is to make it easy to observe how CPU temperature changes under sustained load.
Build the program:
make prepare
makeRun it:
./busyIn another terminal, monitor the CPU sensors:
watch -n 1 sensorsYou can also use busy together with watch in a pipeline:
./busy | watch -n 1 sensorsThis is a convenient way to run the CPU workload while continuously refreshing the sensors output.
busy:
- Detects the number of online CPUs using POSIX
sysconf(). - Creates one worker process for each CPU.
- Places the worker processes in the same process group.
- Each worker continuously consumes CPU time.
Ctrl+Cstops the workload.
The number of workers is therefore determined automatically by the system rather than being hard-coded.
The source code is written using standardized POSIX/XSI interfaces rather than relying on Linux-specific APIs where possible.
The build enables the following feature-test macros:
_POSIX_C_SOURCE=1
_XOPEN_SOURCE
_POSIX_C_SOURCE=1 selects the historical POSIX.1 interface level corresponding to POSIX.1-1990.
_XOPEN_SOURCE, when defined without a numeric value, enables the base X/Open interfaces without selecting a specific later X/Open/SUS revision. It should therefore not be interpreted as corresponding to a particular SUS version or year.
The project intentionally avoids requiring later feature-test levels such as:
_POSIX_C_SOURCE=200809L
_XOPEN_SOURCE=700
where they are not necessary.
This keeps the source requirements at an older standardized interface level while still allowing it to be compiled on modern POSIX-compatible systems.
Run the stress test and monitor the CPU temperature:
./busy | watch -n 1 sensorsExample output:
Package id 0: +75.0°C
Core 0: +74.0°C
Core 1: +76.0°C
Core 2: +73.0°C
Core 3: +75.0°C
You can stop the test with Ctrl+C.
- Linux
- POSIX-compatible C environment
make- A working
lm-sensorsinstallation for temperature monitoring
On Debian-based systems, install lm-sensors with:
sudo apt install lm-sensorsLuis Miguel Arias
busy intentionally generates a sustained high CPU load.
CPU temperature can increase significantly while it is running. Make sure the system has adequate cooling and stop the program if temperatures become excessive.
This utility is intended for testing, diagnostics, thermal observation, and cooling-system verification.
This project is licensed under the MIT License.