New To Disruptor / How Many Question?

201 views
Skip to first unread message

Michael C. Starkie

unread,
Feb 2, 2022, 10:06:43 AM2/2/22
to Disruptor
I am re designing our equities FIX engine for performance reasons and thinking of using Disruptor to help improve performance along with other design features.

Let's assume 1 physical Java process per customer (aka, a Participant Service). A typical host has between 32 and 64 logical cores.

Each Participant Service (PS) will allow a customer to connect in order to route orders and receive execution reports over a single FIX Session (a TCP/IP socket). So each physical connection is both a producer and consumer of messages.  Some customers can have multiple connections (e.g., multiple FIX sessions).

The PS will read a FIX message from a client, apply some business logic and publish it on a JMS connection to a downstream engine.  A JMS consumer will receive a response, apply some more business logic and send the response back to the client on the same physical connection the inbound message arrived on.

For example, let's say a client has 3 FIX connections.  

Am I correct in assuming that my Disruptor will have 4 Producers and 4 Consumers on a single ring buffer? 

Producers: 3 inbound from the client + 1 inbound from the JMS consumer
Consumers: 1 for the JMS producer + 3 for the client outbound messages.

...|P|P|P|C|C|C|C|C|C|P|P|P...

Is this a practical design?

rup...@webstersystems.co.uk

unread,
Feb 2, 2022, 10:25:20 AM2/2/22
to lmax-di...@googlegroups.com

I would have at least 2 disruptors, one for incoming traffic and another for outbound.

The business logic components sit in between the 2 disruptors.

You could need to map the incoming session id and pass it through the hoops so you can send the result back to the same session, but in that way decoupling your session layer also 😊

 

Kind regards

--
You received this message because you are subscribed to the Google Groups "Disruptor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lmax-disrupto...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/lmax-disruptor/d864d339-a21e-4b96-ab49-4d874555bd15n%40googlegroups.com.

Michael C. Starkie

unread,
Feb 2, 2022, 12:17:54 PM2/2/22
to Disruptor
Thanks, I did think of that but I have the following concerns.

With two Disruptor instances, how do you synchronize the Business Logic Handler that will need be accessed by both? For example, what if the business logic requires access to the same credit usage by both by the inbound and outbound disruptors? For example, credit is checked by the Inbound Disruptor to decide whether to accept or reject an order and then updated by the Outbound Disruptor in regards to a possible trade.  Two threads accessing the same object.  If I have to synchronize on the credit keeper, it defeats the whole purpose of using a Disruptor in the first place.

Reply all
Reply to author
Forward
0 new messages