LinuxCommandLibrary

chcpu

TLDR

Disable one or more CPUs

$ chcpu -d [1,3]
copy
Enable one or more CPU ranges
$ chcpu -e [1-3,5-7]
copy

SYNOPSIS

chcpu [options]

DESCRIPTION

chcpu enables and disables individual CPUs on a running system. This is useful for power management, testing, or isolating CPUs for specific workloads.
CPUs are specified by their logical IDs, which can be found in /proc/cpuinfo or using lscpu.

PARAMETERS

-d, --disable cpus

Disable specified CPUs
-e, --enable cpus
Enable specified CPUs
-c, --configure cpus
Configure CPUs (make available for enabling)
-g, --deconfigure cpus
Deconfigure CPUs
-r, --rescan
Rescan for CPUs

CAVEATS

Cannot disable CPU 0 on most systems. Disabling CPUs migrates processes to remaining CPUs. Requires root privileges. Not all hardware supports CPU hotplug.

SEE ALSO

lscpu(1), taskset(1), numactl(8)

Copied to clipboard