cf_num_workers - Number of worker threads configuration parameter

The cf_num_workers parameter specifies the total number of worker threads on the cluster caching facility (CF). Worker threads are distributed among the communication adapter ports to balance the number of worker threads servicing requests on each interface.

Configuration type
Database Manager
Applies to
Applies to a Db2® pureScale® instance only.
Parameter type
Configurable offline
Default [range]
AUTOMATIC [1 - 31]
Important: As a best practice, Db2 pureScale deployments should only have one Db2 instance on the host that is dedicated to the CF.

The AUTOMATIC setting for cf_num_workers depends on the cf_transport_method setting.

Operation of cf_num_workers parameter within RDMA private networks

When set to the default (AUTOMATIC), the cf_num_workers value is configured based on the available CPU resources. This setting is based on the following considerations:
  • The number of CPUs available on the host.
  • The available CPUs which are first equally distributed among all instances before one processor is subtracted from the resulting value.
  • The number of worker threads on the CF are further divided by the total number of CF and by any other members on this host, if there are coexisting members on the CF host.

Within RDMA private networks (RoCE and Infiniband), the cf_num_workers value is set to assign one hardware CPU thread to every CF worker. Additionally, the cf_num_workers value is configured as a multiple of the number of RDMA network adapters set for the CF. This setting ensures that each of the available network adapters have the same number of connections between the Db2 members and the CF.

The CF will not use every hardware CPU thread, and this keeps at least one thread available for other processes.

Note: It is strongly recommended that you deploy the CF on a system with sufficient CPU threads to support at least 4 cf_num_workers values.

if there is only one processor on the CF server machine, this value is set to 1. The total number of CF worker threads is shown in the cfdiag.log file.

If there is only one processor on the CF server, this value is set to 1. For example, according to the following table the cf_num_workers value is set to 4 * (number of hardware CPU threads), for TCP/IP private networks. In both cases, the cf_num_workers value will not be set above 96.
CPU Number of Physical Cores SMT/Hyper threading degree Number of CPU hardware threads Number of RDMA network adapters CF_NUM_WORKERS Notes
Intel Xeon 6 2 12 1 11  
Intel Xeon 10 2 20 2 18  
Intel Xeon 12 2 24 4 20  
IBM POWER8 8 4 32 2 30  
IBM POWER9 8 8 64 2 62  
IBM POWER9 8 8 64 2 60  
IBM POWER10 16 8 128 4 96 Maximum number of CF_NUM_WORKERS reached

Restrictions

If you are running on an RDMA CF transport type, do not set this value higher than the number of processors on the CF server machine. Each worker thread operates on a processor, waiting for RDMA communication. Performance is affected if the number of worker threads exceeds the number of processors.

Operation of cf_num_workers parameter within TCP/IP private networks

The AUTOMATIC value is configured differently for Db2 pureScale environments that use TCP/IP private networks as the method of communication between the members and the CFs. When the cf_num_workers parameter is set to AUTOMATIC, the parameter value is set to four times the number of available processors on the instance. The cf_num_workers value cannot be set above 96 worker threads.

For example, a system with 8 logical CPUs will have its cf_num_workers parameter set to 32 worker threads. A system with 64 logical CPUs will have cf_num_workers parameter set to 96.

Manual setting of cf_num_workers parameter

If you set the cf_num_workers parameter manually, ensure that the value is greater than or equal to the number of communication adapter ports. This setting allows at least one worker thread for each interface. If there is an insufficient number of worker threads to cover all interfaces, an alert is logged for the CF, which will fail to start. In this case, you must change the parameter value to address the problem.