question

Upvotes
Accepted
1 0 1 1

Correct Settings for RFA 8 app using Horizontal Scaling

We have a newly developed application that been implemented in the "Horizontal Scaling" model described in the Threading section of chapter 17 of the RFA 8 C++ Developers Guide. EG: Separate Event Queues, Separate Sessions, and Separate Connections.

The question is twofold:

One: In the Threading section of the documentation, there is no description of how to configure RFA to support this threading model. We believe that it may be un-necessary to configure it explicitly because each event queue is registered against is respective session, and each session has it own connection, but want to be sure. We see that the "Dual-Threaded with Event Queue" (Client Model), 17.4.3, is enabled with threadModel=Dual and by specicifying an EventQueue in registerClient, so are somewhat surprised that we do not have instructions to configure the threadModel parameter.

Two: In section 16 of the RFA Dev guide, there is guidance provided that indicates if implementating Horizontal Scaling, we should set \Adapters\RSSL_Cons_Adapter\singleton = false. The RFA config used by the developer did not scope the \Adapters section, so this parameter is defaulting to true. It states in the footnote, that this will cause a single shared instance of the RSSL_Cons_Adapter to be used, but as we have two seperates sessions, each with its own connection, we are not sure if this is correct, or if we are impacted.

treprfarfa-apimulti-threading
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

The answers below have been verified as correctly answering the questions asked above and therefore accepted.

Upvotes
Accepted
23.5k 84 10 22

Hi @michael.sherman

With regards the singleton parameter, setting to false ensures that each connection uses its own instance of the RSSL Consumer Adaptor.
The default value of true means that both your connections will share a single instance of the RSSL Adaptor - and thereby share resources.

So, to take full advantage of your separate queues, connections etc you need to set it to false. Otherwise you introduce a bottleneck in the single adaptor instance.

The threadModel parameter is used to favour Latency or Throughput.

  • The default value of Dual means RFA will optimize for higher throughput.
  • The value of Single will optimize for lower latency.

Please refer to the threadModel section 6.5.3.1 of the Developer guide for a more detailed description.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
11.3k 25 8 13

@michael.sherman

The purpose of the horizontal scaling is to distribute the processing of response message to different threads while running a single process on the machine, so the threads can be utilized by multiple CPU cores environment.

The basic concept is to create multiple instances of Consumer connections to subscribe a subset of items, so that each of the applications, sessions, and adapters are required to process only a subset of the data. This means that application needs to create multiple OMMConsumer instances with separated Sessions.

However, even there are multiple Sessions and RSSL Connections configured, there is still only one RFA Adapter instance used. You needs to configure \Adapters\RSSL_Cons_Adapter\singleton = false to allow each instance of the Session/RSSL_Cons_Adapter pair is independent of the others.

There is no solid configuration/implementation. Please see the following diagram which is high-level overview of an application using the Horizontal Scaling feature and the flexibility of the configuration. For this implementation in detailed, please see the 16.3 Horizontal Scaling section of the RFA Developers Guide.


horizontalscaling.png (141.3 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.