predictable latency
play

Predictable Latency Adventures in Java Concurrency Martin Thompson - PowerPoint PPT Presentation

A Quest for Predictable Latency Adventures in Java Concurrency Martin Thompson - @mjpt777 If a system does not respond in a timely manner then it is effectively unavailable 1. Its all about the Blocking 2. What do we mean by Latency 3.


  1. One big file that goes on forever?

  2. No!!! Page faults, page cache churn, VM pressure, ...

  3. Clean Dirty Active Header Header Message Message Header Header Message Message Header Header Message Message Tail Header Message Header Message

  4. Do publishers need a CAS?

  5. File Header Message 1 Header Message 2 Header Message 3 Tail <<XADD>> Message X Message Y

  6. File Header Message 1 Header Message 2 Header Message 3 Message X Tail <<XADD>> Message Y

  7. File Header Message 1 Header Message 2 Header Message 3 Message X Message Y Tail

  8. File Header Message 1 Header Message 2 Header Message 3 Header Message X Message Y Tail

  9. File Header Message 1 Header Message 2 Header Message 3 Header Message X Message Y Padding Tail

  10. File File Tail Header Message 1 Header Message 2 Header Message 3 Header Message X Message Y Padding

  11. File File Header Header Message 1 Message X Header Tail Message 2 Header Message 3 Header Message Y Padding

  12. Have a background thread do zero’ing and flow control

  13. Burst Length = 1: RTT (ns) Prod # Mean 99% 1 167 189 Baseline (Wait-free) 1 281 361 ConcurrentLinkedQueue 2 381 559 3 444 705 1 170 194 ManyToOneRingBuffer 2 256 279 3 283 340 1 192 210 Aeron IPC 2 251 286 3 290 342

  14. Burst Length = 1: RTT (ns) Prod # Mean 99% 1 167 189 Baseline (Wait-free) 1 281 361 ConcurrentLinkedQueue 2 381 559 3 444 705 1 170 194 ManyToOneRingBuffer 2 256 279 3 283 340 1 192 210 Aeron IPC 2 251 286 3 290 342

  15. Aeron Data Message Header 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-------------------------------------------------------------+ |R| Frame Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-------------------------------+ | Version |B|E| Flags | Type | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-------------------------------+ |R| Term Offset | +-+-------------------------------------------------------------+ | Session ID | +---------------------------------------------------------------+ | Stream ID | +---------------------------------------------------------------+ | Term ID | +---------------------------------------------------------------+ | Encoded Message ... ... | +---------------------------------------------------------------+

  16. Burst Length = 100: RTT (ns) Prod # Mean 99% 1 721 982 Baseline (Wait-free) 1 12,916 15,792 ConcurrentLinkedQueue 2 25,132 35,136 3 39,462 56,768 1 3,773 3,992 ManyToOneRingBuffer 2 11,286 13,200 3 27,255 34,432 1 4,436 4,632 Aeron IPC 2 7,623 8,224 3 10,825 13,872

  17. Burst Length = 100: RTT (ns) Prod # Mean 99% 1 721 982 Baseline (Wait-free) 1 12,916 15,792 ConcurrentLinkedQueue 2 25,132 35,136 3 39,462 56,768 1 3,773 3,992 ManyToOneRingBuffer 2 11,286 13,200 3 27,255 34,432 1 4,436 4,632 Aeron IPC 2 7,623 8,224 3 10,825 13,872

  18. Less “False Sharing” - Inlined data vs Reference Array Less “Card Marking”

  19. Is avoiding the spinning “CAS” loop is a major step forward?

  20. Burst Length = 100: RTT (ns) Prod # Mean 99% 1 721 982 Baseline (Wait-free) 1 12,916 15,792 ConcurrentLinkedQueue 2 25,132 35,136 3 39,462 56,768 1 3,773 3,992 ManyToOneRingBuffer 2 11,286 13,200 3 27,255 34,432 1 4,436 4,632 Aeron IPC 2 7,623 8,224 3 10,825 13,872

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend