Questions tagged [disruptor-pattern]

Disruptor is a pattern used to perform around 6-8 million transactions per second. When using this tag on implementation heavy questions - tag the code language the implementation is written in.

The Disruptor is a pattern used to perform around 6-8 million transactions per second where every producer and every consumer is running on a single thread without using multiple threads and locks.

Specifications:

  • It uses a data structure called the ring buffer.
  • It is developed by LMAX.
  • Implemented using the coding language.
  • There is also a port of the implementation.

Resources

  1. The LMAX Architecture by Martin Fowler
  2. LMAX Disruptor. Official place for the software implementing the pattern. On GitHub (previously on Google Code).
  3. The C# port is available from github
174 questions
214
votes
5 answers

How does LMAX's disruptor pattern work?

I am trying to understand the disruptor pattern. I have watched the InfoQ video and tried to read their paper. I understand there is a ring buffer involved, that it is initialized as an extremely large array to take advantage of cache locality,…
Shahbaz
  • 10,395
  • 21
  • 54
  • 83
30
votes
3 answers

How should one use Disruptor (Disruptor Pattern) to build real-world message systems?

As the RingBuffer up-front allocates objects of a given type, how can you use a single ring buffer to process messages of various different types? You can't create new object instances to insert into the ringBuffer and that would defeat the purpose…
JamesRedcoat
  • 2,083
  • 2
  • 15
  • 13
28
votes
2 answers

Disruptor.NET example

I am trying to learn how to use the Disruptor.NET messaging framework, and I can't find any practical examples. There are quite a few articles out there with pictures about how it works, but I can't find anywhere that actually goes and shows you how…
William
  • 3,335
  • 9
  • 42
  • 74
19
votes
3 answers

How to use a disruptor with multiple message types

My system has two different types of messages - type A and B. Each message has a different structure - type A contains an int member and type B contains a double member. My system needs to pass both types of messages to numerous business logic…
18
votes
5 answers

The simplest and actual example code of LMAX Disruptor

I wish I can get the simplest possible example code, which will show how to use LMAX disruptor(http://code.google.com/p/disruptor/). Unfortunately every piece of code is out of date. Does someone know, where can I found small and up to date howto…
Dejwi
  • 4,393
  • 12
  • 45
  • 74
15
votes
3 answers

LMAX's disruptor pattern: is there a port to C++?

There are open source Java and .NET versions of LMAX's Disruptor pattern, as described in the video LMAX - How to Do 100K TPS at Less than 1ms Latency. Here is more links to information on the Disruptor pattern. Is anyone aware of a port of the…
Contango
  • 76,540
  • 58
  • 260
  • 305
11
votes
2 answers

What causes this performance drop?

I'm using the Disruptor framework for performing fast Reed-Solomon error correction on some data. This is my setup: RS Decoder 1 / \ Producer- ... - Consumer \ / RS Decoder 8 The…
Zoltán
  • 21,321
  • 14
  • 93
  • 134
11
votes
1 answer

When to use the disruptor pattern and when local storage with work stealing?

Is the following correct? The disruptor pattern has better parallel performance and scalability if each entry has to be processed in multiple ways (io operations or annotations), since that can be parallelized using multiple consumers without…
9
votes
1 answer

LMAX Replicator Design - How to support high availability?

LMAX Disruptor is generally implemented using the following approach: As in this example, Replicator is responsible for replicating the input events\commands to the slave nodes. Replicating across a set of nodes requires us to apply consensus…
coder_bro
  • 10,503
  • 13
  • 56
  • 88
8
votes
1 answer

LMAX Disruptor - what determines the batch size?

I have been recently learning about the LMAX Disruptor and been doing some experimentation. One thing that is puzzling me is the endOfBatch parameter of the onEvent handler method of the EventHandler. Consider my following code. First, the dummy…
Asif Iqbal
  • 4,562
  • 5
  • 27
  • 31
8
votes
1 answer

Migrating from LinkedBlockingQueue to LMAX' Disruptor

Is there some example code for migrating from the standard LinkedBlockingQueue to LMAX' Disruptor architecture? I have an event handling application (single producer, multiple consumers) that might benefit from the change. Does it even make sense…
pmf
  • 7,619
  • 4
  • 47
  • 77
7
votes
3 answers

Disruptor helloworld example

I want to learn the Disruptor framework. Who can give me a helloworld example which can run in the main method with Java program language?
Felix
  • 1,253
  • 7
  • 22
  • 41
7
votes
2 answers

Disruptor example with 1 publisher and 4 parallel consumers

In this example https://stackoverflow.com/a/9980346/93647 and here Why is my disruptor example so slow? (at the end of the question) there is 1 publisher which publish items and 1 consumer. But in my case consumer work is much more complicated and…
Oleg Vazhnev
  • 23,239
  • 54
  • 171
  • 305
7
votes
2 answers

Should one use Disruptor (LMAX) with a big model in memory and CQRS?

Our system has structured model (about 30 different entities with several kind of relations) entirely kept in memory (about 10 Gb) for performance reasons. On this model we have to do 3 kind of operation: update one or a few entities query for a…
Uberto
  • 2,712
  • 3
  • 25
  • 27
7
votes
1 answer

Disruptor: journaling Example

I was curious regarding the most common (or recommended) implementations of disruptor about the journaling step. And the most common questions of mine are: how it is actually implemented (by example)? Is it wise to use JPA? What DB is commonly used…
Evan P
  • 1,767
  • 1
  • 20
  • 37
1
2 3
11 12