Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Affinity mask

...

settings

The Antenna allows users to change affinity masks for threads with different purposes. This allows the application to run functionality on a critical path at dedicated threads/CPU cores. It results in response time spreading reduction and helps to keep it minimal.

...

Info
NOTE: Some of the affinity masks don't use for FAST sessions

Affinity

...

Affinity is specified as bitmask where a serial number of the bit is the serial number of the core.
The default value is 0. It means that the engine will not change the thread affinity mask.

...

Application properties

  • mask for all worker pool threads

    Code Block
    WorkerCpuAffinity = 0
  • mask for dispatcher and other auxiliary threads

    Code Block
    HelperCpuAffinity = 0

Session

...

properties

  • mask for dedicated sending thread of a session. It makes sense only for an aggressive send mode

    Code Block
    Session.Default.SendCpuAffinity = 0
  • mask for the dedicated receiving thread of a session. It makes sense only for an aggressive receive mode

    Code Block
    Session.Default.RecvCpuAffinity = 0
  • mask for dedicated threads of a session. It makes sense only for aggressive modes

    Code Block
    Session.Default.CpuAffinity = 0

...

Supported affinity formats

  1. Decimal

    Code Block
    WorkerCpuAffinity = 31

    The setting above exposes cores #0,1,2,3,4
    (see Backward compatibility)

  2. Hexadecimal 

    Info

    Introduced in FA C++ 2.27.1

    Code Block
    WorkerCpuAffinity = 0x1F3A 

    The setting above exposes cores #1,3,4,5,8,9,10,11,12

  3. Cores-set format (like Linux' taskset command)

    Info

    Introduced in FA C++ 2.27.1

    Code Block
    # core numbers: integer values of set [0..63]
    Session.Default.RecvCpuAffinity = 2-4
    
    # separator character: ','
    HelperCpuAffinity = 1,4
    
    # grouping characters: '{' '}'
    WorkerCpuAffinity = {0}

    The settings above expose cores respectively #2,3,4;  #1,4; #0;

    Info

    NOTE: To avoid erroneous reading with the cores-set format, use a grouping of characters in case of single-core in the mask:

    WorkerCpuAffinity = 31 - it means cores #0,1,2,3,4

    WorkerCpuAffinity ={31} - it means cores #31

...