Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Disruptor

98f8e6125c052c4ac3fcc94f97919371?s=47 Viney
July 30, 2019

 Disruptor

Introduce the high performance queue mechanism in JAVA

98f8e6125c052c4ac3fcc94f97919371?s=128

Viney

July 30, 2019
Tweet

Transcript

  1. Disruptor By Viney

  2. What's that?

  3. Like: syslog fluentd

  4. Speed = Money

  5. None
  6. PubSub model

  7. None
  8. Data in Queue related to policy

  9. End to end Latency = computational time + latency of

    moving data
  10. Blocking Queue 4 array-based 4 linked list based

  11. Racing issue

  12. None
  13. Synchronization Lock

  14. Issues 4 Repeatedly accessing data in memory 4 Not cache-friendly

  15. None
  16. None
  17. None
  18. None
  19. None
  20. None
  21. None
  22. None
  23. None
  24. None
  25. None
  26. None
  27. None
  28. None
  29. None
  30. None
  31. None
  32. None
  33. None
  34. None
  35. None
  36. Performance https://colobu.com/2016/07/22/using-go-disruptor/ 4 Java Disruptor : 183486238 ops/s 4 go-disruptor

    : 137931020 ops/s 4 go channel : 6995452 ops/s
  37. What if we have a slow consumer? 4 batching effect

    4 multiple consumers
  38. None
  39. What if the buffer is constantly full? 4 enhance ring

    size 4 seperate producers 4 multiple Disruptors
  40. When to use it? 4 low latency required

  41. reference 4 https://lmax-exchange.github.io/disruptor/files/ Disruptor-1.0.pdf 4 https://github.com/smartystreets-prototypes/go- disruptor

  42. Q&A