How many disruptor instances per application

82 views
Skip to first unread message

Robert Mircea

unread,
May 5, 2013, 2:37:05 PM5/5/13
to disrup...@googlegroups.com
I am considering integrating Disruptor-Net lib into a project which processes binary messages from multiple clients received by a TCP server implemented on top of .net's async socket operations. I am thinking using disruptor lib in order to address this kind of pipeline:

- framing of the network bytes stream (split the network received bytes stream into packet bytes)
- transforming a bytes buffer representing a single message into a C# object representation
- apply business logic to the object preparing a reply to the TCP client
- prepare a binary message encoding the reply into bytes ready to be sent over TCP connect
- send the reply back to the TCP client.

This sequence of actions takes place for each connected client (and can be many of them).

How would you recommend to use disruptor in this scenario:
1. a single instance for all the clients?
2. multiple instances - one for each connected socket?
Generally, does it make sense to use multiple disruptor instances in one application?


Thanks,
Robert

PS Putting these kind of questions shows my novice level regarding disruptor pattern, right? :-)

Tim Gebhardt

unread,
May 6, 2013, 7:48:58 AM5/6/13
to disrup...@googlegroups.com
If you were to have one per connected client you'd have multiple threads per client, which is even worse than one blocking thread per client.  You probably should just start with a single instance of the disruptor to handle all your CPU-bound tasks, especially if you're using async sockets.


--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes Disruptor-net.
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse disruptor-ne...@googlegroups.com.
Pour plus d'options, visitez le site https://groups.google.com/groups/opt_out .
 
 

Reply all
Reply to author
Forward
0 new messages