Q. I would like to restrict number of CPU activated for some software licensing issues under Linux kernel 2.6.xx.. How can I limit the number of CPUs activated in SMP mode?
A. Pass a special parameter called maxcpus to kernel. It specify maximum number of processors that an SMP Linux kernel should make use of. For example if you have four cpus and would like to use 2 CPU then pass 2 as a number to maxcpus.
This is useful to test different software performances and configurations. Some commercial software such as ERP software or Oracle are licenced per CPU. In such a case maxcpus is a life saver.
Edit your grub.conf file:
# vi grub.conf
Append parameter maxcpus at the end of Kernel line. A the end it should read as follows:
kernel /boot/vmlinuz-2.6.13-Ora10g root=/dev/sda1 ro maxcpus=2
Save and close the file. Reboot system:
Alternatively, you need to enter parameter at grub or lilo boot prompt. For example if you are using Grub as a boot loader, at Grub prompt press 'e' to edit command before booting.
- Select second line
- Again, press 'e' to edit selected command
- Select kernel line
- Append maxcpus=2 parameters.
- Press b to boot system
UPDATED for accuracy.
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012
- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop