Thursday, November 17, 2005

Disabling CPUs on Linux - Part One

For running performance tests and to determine the potential benefit of additional CPUs it can be very helpful to be able to disable CPUs. CPU's can be disabled by adding the following clause to the kernel configuration line in the grub.conf configuration line:
maxcpus=<NUM_CPUS>
The placeholder NUM_CPUS has to be replaced with the number of CPUs that will be enabled. After re-booting with the correct kernel verify that the correct number of CPUs are active. This can be verified with the file /proc/cpuinfo.

Disabling Hyper-Threading

The use of Hyper-Threading for server applications is questionable, especially if the number of I/O requests is high. To determine the cost or the potential performance improvements it makes sense to disable the Hyper-threading (from known on abbreviated with HT) support. The are two ways to disable HT:
  • Disable Hyper-Threading in the kernel
  • Disable Hyper-threading by the BIOS
Intel recommends to disable Hyper-Threading in the BIOS as it is more cleanly to disable at that point. To disable it in the BIOS look for a description logical CPU (this how it is called for Dell servers) or something similar.

The other option is to specify the noht switch in the kernel line of the grub configuration file. Unfortunately this doesn't work with Redhat AS 4.

To check if HT is really disabled check the file /proc/cpuinfo. This file should only report the physical CPU's.

Upgrade to RedHat AS 4.0


Upgrading to RedHat 4.0 introduces some new challenges. With the switch to the 2.6 linux kernel the udev device filesystem was introduced. By default the udev device tree does not support raw devices anymore. Luckily it is still supported with the Redhat distribution. It can be configured in the old way with the rawdevices service configuration.

To check if it is currently enabled run the following command:
# chkconfig --list
and search for rawdevices. If it is not enabled yet add the rawdevices service with
# chkconfig --level 345 rawdevices on.
Afterwards start the service in the usual way with service start rawdevices.

The next step is to set the permissions correctly. especially for Oracle database files, OCR and the voting disks it is important to set the correct file permissions. Setting the permissions on the raw devices directly will only work partially. As soon as the node gets rebooted the raw devives will be reset tohave root privileges. To make the change final it is necessary to edit the file /etc/udev/permissions.d/50-udev.permissions. Search for the substring "raw" in this file. You will find something like
raw/*:root:disk:0660
and change the line to
raw/*:oracle:dba:0660
For the future it makes sense to no longer use /dev/raw. There are plans to completely de-support it with kernel version 2.7.