The following section describes how to perform various CPU-binding operations in the Linux environment.
The ihubd process is the root parent process for all other BIRT iHub processes, so CPU binding can be done only for ihubd. Binding must be done before starting the ihubd process. Binding a running ihubd process has no effect.
On a multiple-CPU machine running the Linux operating system, the operating system assigns an ID number to each processor. The numbering starts at 0.
If you are not licensed to use all the CPU cores on the iHub 3 host machine, you must bind iHub 3 to the appropriate number of CPUs. To bind iHub3 to a set of processors, you modify the acpmdconfig.xml file in AC_SERVER_HOME/etc. For example, to bind processors to four logical cores, add the following line to acpmdconfig.xml:
<DaemonCPUaffinity>0,1,2,3</DaemonCPUaffinity>
How to configure CPU binding on Linux
The following example shows the settings for a four CPU (0,1,2,3) machine running Linux, which uses only two CPUs (0,1) for BIRT iHub:
1 In Linux, log in as root and use the less command to view CPU core information, as shown in the following example:
less /proc/cpuinfo
Use <Ctrl>+Z to suspend the command.
2 To verify CPU cores, use the cat command for more detailed information, as shown in the following example:
sudo cat /proc/cpuinfo
3 Use the taskset command, referencing the process ID (PID) to verify processor affinity, as shown in the following example:
taskset -p -c PID
The taskset command binds to the number of logical cores. If a machine does not have hyperthreading enabled, you will not see any difference between the physical and logical cores.
Using the -c option provides a processor affinity mask in list form rather than a bit mask for a PID specified using the -p option. For example, a typical affinity list generated by these arguments is 0,2,3-5.
4 Use the ps|grep commands to verify the current core settings for all running processes, as shown in the following example, where ihub_id is the user that runs the BIRT iHub processes:
ps -e -o pid,cpuid,comm,user | grep ihub_id
5 To bind CPU cores on Linux, perform the following tasks:
1 Stop BIRT iHub, including ihubd. Make sure no processes are running by typing the following command, where ihub_id is the user that runs the BIRT iHub processes:
ps -e -o pid,cpuid,comm,user | grep ihub_id
2 In a typical installation, using a text editor such as vi, open the acpmdconfig.xml file located in AC_SERVER_HOME/shared/config and edit the <DaemonCPUaffinity> element as follows:
<DaemonCPUaffinity>0,1</DaemonCPUaffinity>
3 Restart BIRT iHub. Make sure that all processes started and verify the core to which each process is bound by running the following command, where ihub_id is the user that runs the BIRT iHub processes: