Skip to content
GoDjango-DevelopmentPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

28 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

busy

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.

Usage

Build the program:

make prepare
make

Run it:

./busy

In another terminal, monitor the CPU sensors:

watch -n 1 sensors

You can also use busy together with watch in a pipeline:

./busy | watch -n 1 sensors

This is a convenient way to run the CPU workload while continuously refreshing the sensors output.

How it works

busy:

  1. Detects the number of online CPUs using POSIX sysconf().
  2. Creates one worker process for each CPU.
  3. Places the worker processes in the same process group.
  4. Each worker continuously consumes CPU time.
  5. Ctrl+C stops the workload.

The number of workers is therefore determined automatically by the system rather than being hard-coded.

Portability

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.

Example

Run the stress test and monitor the CPU temperature:

./busy | watch -n 1 sensors

Example 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.

Requirements

  • Linux
  • POSIX-compatible C environment
  • make
  • A working lm-sensors installation for temperature monitoring

On Debian-based systems, install lm-sensors with:

sudo apt install lm-sensors

Author

Luis Miguel Arias

lmdelbahia@gmail.com

Warning

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.

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages