Product Documentation

Database Administrator's Guide

Previous Topic

Next Topic

AIX

An AIX system with two CPUs using the Workload Partitioning feature (WPAR), which supports two SMT threads per processor, will report four CPUs. The AIX system call that detects the number of CPUs counts the virtual processors created by the threads, which causes it to report four CPUs in this example. If the FairCom DB Server was licensed for two CPUs, the following message would be displayed:


* * * * * * * * * * * * * * * * * * * * * * * * * * * *

LICENSE NOTICE:

FairCom DB is licensed for 2 CPU's, but 4 CPU's have

been detected in the host machine. Either upgrade

the FairCom DB license to support a greater number

of CPU's or bind FairCom DB to specific CPU's.

* * * * * * * * * * * * * * * * * * * * * * * * * * * *

One of the following options can be used to correct this situation:

  1. Change the binding to a single CPU.
  2. Disable the SMT support.
  3. Purchase a larger FairCom DB Server license that supports 4 cores.

AIX does not support the CPU_AFFINITY keyword.

Binding to Specific CPUs

execrset

On AIX, the FairCom DB Server can be launched via the execrset command to operate with a given resource set.

Usage:

execrset [-P][-F] rsetname [-e] command [args]

execrset [-P][-F] -c cpuNum [cpuNum] [-m memNum [memNum]] -e command [args]

For example, execrset -c 0 -e ctreesql will launch the server and bind it to processor 0.

To use the execrset command, the user must have root permissions or have the CAP_NUMA_ATTACH and CAP_PROPAGATE capabilities assigned. To assign these capabilities to a user, the chuser command can be used:

chuser capabilities=CAP_NUMA_ATTACHED,CAP_PROPAGATE user

To check if the capabilities are assigned to a user, you can use the lsuser command:

lsuser -a capabilities user

bindprocessor

If the FairCom DB Server is already running, the bindprocessor command can be used. This command may also be used to query the list of available processors.

taskset

A process can be bound to a given set of CPUs by using the taskset command (see the Linux section). This utility is installed as part of the util-linux package.

An AIX Program

The simple program listed below compiles on AIX 5.3 and later showing one way to programmatically determine the CPU count, whether or not the partition supports SMT, and whether or not it is on. This program could easily be incorporated into the server startup logic.


/* sample program cpustats.c */

#include <stdio.h>

#include <libperfstat.h>

int main(int argc, char* argv[])

{

perfstat_cpu_total_t cpustats;

perfstat_partition_total_t partstats;

if (!perfstat_cpu_total(NULL, &cpustats, sizeof(perfstat_cpu_total_t), 1)) {

perror("perfstat_cpu_total");

exit(-1);

}

if (!perfstat_partition_total(NULL, &partstats, sizeof(perfstat_partition_total_t), 1)) {

perror("perfstat_partition_total");

exit(-1);

}

printf("\nCurrent number of active CPUs: %d", cpustats.ncpus);

if (partstats.type.b.smt_capable)

printf("\nOS supports SMT mode");

else

printf("\nOS DOES NOT support SMT mode");

if (partstats.type.b.smt_enabled)

printf("\nSMT mode is ON\n\n");

else

printf("\nSMT mode is OFF\n\n");

return(0);

}

To compile the program, use the command line:


- cc cpustats.c -o cpustats -lperfsta

FairCom Server physical CPU counting method on AIX

Note: This is a Compatibility Change.

The physical CPU counting method used by FairCom Server on AIX has been changed to account for LPAR CPU assignment. The physical CPU count returns the total number of CPUs on the system. However, on AIX, an LPAR can be defined that has access to a subset of the CPUs. To accommodate this, we now base our count on the "maximum virtual CPUs" assigned to the LPAR. 

TOCIndex