Strace Command: Increase CPU load

The strace command is primarily used for tracing system calls and signals made by a process. While it can generate some CPU load because of the overhead it introduces, it’s not typically used to intentionally create a “huge” CPU load. If your goal is to stress the CPU for testing or benchmarking purposes, you may want to consider other tools like stress, yes, or stress-ng.

However, if you still want to use strace to generate some CPU load, you can do so by tracing a process that performs a lot of system calls. For example, you can run a simple infinite loop that makes system calls continuously and then use strace to trace that process. Here’s an example:

# Create a simple script called that contains a loop making frequent system calls:

while true; do
    echo "Hello, world!" >/dev/null

# Make the script executable:

chmod +x

# Run the script in the background:

./ &

# Find the process ID (PID) of the running script:
ps aux | grep

# Use strace to trace the process by specifying its PID:
strace -p <PID>

Rajesh Kumar
Follow me
Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x