Responding in a timely manner
Martin Thompson - @mjpt777
Responding in a timely manner Martin Thompson - @mjpt777 Hard - - PowerPoint PPT Presentation
Responding in a timely manner Martin Thompson - @mjpt777 Hard Real-time Soft Real-time Squidgy Real-time The Unaware 1. How to Test and Measure 2. A little bit of Theory 3. A little bit of Practice 4. Common Pitfalls 5. Useful Algorithms and
Martin Thompson - @mjpt777
System Under Test
Distributed Load Generation Agents System Under Test
Distributed Load Generation Agents System Under Test
Distributed Load Generation Agents System Under Test
Distributed Load Generation Agents System Under Test Observer
Latency Histograms
Latency Histograms
Mode
Latency Histograms
Mode Median
Latency Histograms
Mode Median Mean
Source: Gil Tene (Azul Systems)
Coordinated Omission
Queuing Theory
0.0 2.0 4.0 6.0 8.0 10.0 12.0 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 Response Time Utilisation
Queuing Theory
Queuing Theory
Queuing Theory
Queuing Theory
0.0 2.0 4.0 6.0 8.0 10.0 12.0 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 Response Time Utilisation
Queuing Theory
A
Sequential Process time
B
Amdahl’s Law
A
Sequential Process
A B
Parallel Process A
A A A
time
B
Amdahl’s Law
A
Sequential Process Parallel Process B
A B
Parallel Process A
A A A
time
B A B B B B
Amdahl’s Law
Amdahl's Law
Universal Scalability Law
C(N) = N / (1 + α(N – 1) + ((β* N) * (N – 1)))
Universal Scalability Law
2 4 6 8 10 12 14 16 18 20 1 2 4 8 16 32 64 128 256 512 1024 Speedup Processors Amdahl USL
Order of Algorithms
Modern Processors
Non-Uniform Memory Architecture (NUMA)
C 1 C n C 1 C n
Registers/Buffers <1ns
L1 L1 L1 L1
~4 cycles ~1ns
L2 L2 L2 L2
~12 cycles ~3ns
L3 L3
~40 cycles ~15ns ~60 cycles ~20ns (dirty hit) ~65ns
DRAM
QPI ~40ns
MC MC DRAM DRAM DRAM DRAM DRAM DRAM DRAM
QPI QPI PCI-e 3 PCI-e 3
40X IO 40X IO
* Assumption: 3GHz Processor
Virtual Memory Management
Safepoints in the JVM
Virtualization
Notification
public class SomethingUseful { // Lots of useful stuff public void handOffSomeWork() { // prepare for handoff synchronized (this) { someObject.notify(); } } }
Notification
public class SomethingUseful { // Lots of useful stuff public void handOffSomeWork() { // prepare for handoff synchronized (this) { someObject.notify(); } } }
Law of Leaky Abstractions
Law of Leaky Abstractions
Responding in the presence of failure
Clean Room Experiments
Profiling
Smart Batching
Latency Load Typical Possible
Smart Batching
Producers
Smart Batching
Batcher Producers << Amortise Expensive Costs >>
Applying Backpressure
Transaction Service Threads Network Stack Storage Threads Network Stack Gateway Services Network Stack IO Customers
Non-Blocking Design
Lock-Free Concurrent Algorithms
interaction
involved, i.e. the OS
problem
Observable State Machines
Cluster for Response and Resilience
Service A Service A Sequencer
Cluster for Response and Resilience
Service A Service A Sequencer
Cluster for Response and Resilience
Service A Service A Service N Sequencer
Data Structures and O(?) Models
The Internet of Things (IoT)
Questions?
Blog: http://mechanical-sympathy.blogspot.com/ Twitter: @mjpt777 “It does not matter how intelligent you are, if you guess and that guess cannot be backed up by experimental evidence – then it is still a guess.”