We can disable the few cores from the multi-core linux machines by following the below commands:
$ sudo sh -c "echo 'n' > /sys/devices/system/cpu/cpu1/online"
E.g.
echo 0 > /sys/devices/system/cpu/cpu2/online; echo 0 >
/sys/devices/system/cpu/cpu3/online;
The above line will disable the CPU 2 and 3 on a 4 CPU machine.
To enable it again:
echo 1 > /sys/devices/system/cpu/cpu2/online; echo 1 >
/sys/devices/system/cpu/cpu3/online;
The following command will display only enabled CPU:
cat /proc/cpuinfo