Linux Enable and Disable CPU Core Commands

Fig.01: Howto enable and disable CPU core in on a multi-core server

Fig.01: Howto enable and disable CPU core in on a multi-core server

You can enable and disable CPU core in Linux operating system on a multi-core server. You must run following command as root user.

How to disabling CPU online

The syntax is as follows to disable cpu core # 4:
echo 0 > /sys/devices/system/cpu/cpu3/online

How to enabling CPU online

The syntax is as follows to disable cpu core # 4:
echo 1 > /sys/devices/system/cpu/cpu3/online
The above command can be used to reactive cpu core #4.

How do I verify it?

Use any one of the following command:
grep "processor" /proc/cpuinfo
OR
lscpu

Examples and usage: Linux Hotplug a CPU and Disable CPU Cores At Run Time

1 comment

  1. I have followed your guide, but still the cpu cannot online. I am using Red Hat Enterprise Linux Server 6.7 on vmware. Please kindly help! Thank you!

    Have a question? Post it on our forum!