A photo of Mitesh Shah

Mitesh Shah

Linux Expert | Automation Enthusiast | Security Consultant

Email Skype Github Twitter Resume Hire Me Keybase LinkedIn Stackoverflow


How to Disable CPU Cores

Overview

CPU Information

  • I’ve Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz processor, Which has 8 cores.
[mitesh@Matrix ~]$ cat /proc/cpuinfo | grep processor
processor	: 0
processor	: 1
processor	: 2
processor	: 3
processor	: 4
processor	: 5
processor	: 6
processor	: 7

Check Online Cores

[mitesh@Matrix ~]$ cat /sys/devices/system/cpu/online
0-7

NOTE!: All cores from 0 to 7 are online.

Disable core 6 and core 7

[mitesh@Matrix ~]$ sudo sh -c "echo 0 > /sys/devices/system/cpu/cpu6/online"
[mitesh@Matrix ~]$ sudo sh -c "echo 0 > /sys/devices/system/cpu/cpu7/online"

NOTE!: You can check cpu cores using htop command or cat /sys/devices/system/cpu/online





Post Navigation