SlideShare a Scribd company logo
1 of 37
Advanced Java Data Locality and
Data IPC Transport Solutions:
An Introduction to OpenHFT
ben.cotton@jpmorgan.com
ben.cotton@alumni.rutgers.edu
Jan 27, 2015
For real-time Java deployments
(with the strictest SLAs) the
problem of JVM “Stop the World”
GC activity (on medium-lived on-
Heap objects) is a MONSTROUS
problem.
2
Simple Remedy?
Design Java developments and deployments so that medium-lived
Collections (e.g. that “old dog” HashMap) object instance(s) are taught a
“new trick” …. That “new trick” is simple: take HashMap completely Off-Heap.
The Heap
Good Boy!
Off-Heap
you go …
3
But What kind of HashMap are we putting Off-Heap?
• java.util.HashMap ?
• Collections.synchronizedMap( java.util.HashMap ); ?
• java.util.concurrent.ConcurrentHashMap ?
• something entirely different ?
ANSWER: something very different (indeed)!
• OpenHFT’s Chronicle Map SOLUTION
• net.openhft.chronicle.map.ChronicleMap
4
What exactly is OpenHFT?
• 100% Open Source
• Designed to empower Higher Frequency Trading (HFT)
• https://github.com/OpenHFT (developer source repo)
• http://www.openhft.net (Products. Services. Training)
• Provides modules that empower ultra low latency Java deployments to achieve
REAL-TIME compliance (with even their strictest of SLAs)
• Java-Lang (Marshalling / GC Free De-Marshalling / Thread-SAFE / IPC-SAFE /
Off-Heap/ 64-bit ByteBuffers)
• Chronicle-Queue (persisted low-latency Queue messaging and Logging)
• Chroncile-Map (ChronicleMap, Thread-SAFE/IPC-SAFE/Off-Heap)
• Chronicle-Engine Fast Data Framework.
• Java-Runtime-Compiler (builds OpenHFT native impl classes – in process –
of user supplied JBI interfaces)
• Java-Thread-Affinity (allows JVM Threads to be pinned by affinity to specific
OS cpus)
• TransFIX (ultra low latency FIX engine)
5
What really is OpenHFT?
OpenHFT is a 100% OSS solution that empowers Java developers to deliver
the highest performing and most flexible
• Data Locality (Optimised memory layout)
And
• Data IPC Transport (waaay faster than
UDP/TCP)
Capabilities.
6
PART 1
OpenHFT as an Advanced Java Data Locality Provider
(That’s right folks! We’re going Off-Heap)
7
java.util.HashMap
8
Collections.synchronizedMap( java.util.HashMap );
9
10
11
Java Heap Layout: Through the Generations View
12
OpenHFT: Off-Heap ChronicleMap … an Architectural View
13
OpenHFT : Step #1 (PID 1)
14
OpenHFT : Step #2 (PID 1) – thread safe write to off heap
15
OpenHFT : Step #3 (PID 1)
16
OpenHFT : Step #4 (PID 2) – thread safe read (concurrent)
17
OpenHFT : Step #5 (PID 2) update an existing entry (thread safe)
18
OpenHFT : Step #6 (PID 2)
19
OpenHFT : Step #6 (PID 2)
S
OpenHFT code sample demo Summary:
- MT-SAFE operations
- IPC-SAFE operations
- IPC-ATOMIC operations
- ZERO-COPY (*)
- GC-Free Marshalling/De-Marshalling
- Ambition to provide the symmetry of
java.util.concurrent.* API support across native Linux
processes (not just Threads!)
- Nanosecond transport latency (stay tuned for details)
* (note on Map<K,V > type domain support status).
20
Performance Results: CHM vs. SHM
On Linux 14.04, dual E5-2650 v2 @ 2.60GHz, 128 GB memory, each entry updated 32 times.
ConcurrentHashMap -Xmx110g -Xms110g -verbose:gc
21
Performance Results: CHM vs. SHM
On Linux 14.04, dual E5-2650 v2 @ 2.60GHz, 128 GB memory, each entry updated 32 times.
22
OpenHFT as an Off-Heap JCACHE Provider (e.g. RedHat JDG Infinispan)
23
OpenHFT empowers developers to use OpenJDK and Native Linux OS to
100% protect their medium-lived Java Collections (ChronicleMap) from being
impacted by STW GC pauses.
24
PART 2
OpenHFT as an Advanced Java IPC Transport Provider
(That’s right folks! UDP/TCP now joined by
native Linux /dev/shm IPC)
25
OSI Model of Networking Layers:
26
Java 7 Sockets Direct Protocol: Delivering SDP/IB as a Transport
27
Java 7 Sockets Direct Protocol: Delivering to Java its first RDMA capability
28
Intel iWARP: potential to empower Java 9 with SDP/10gE as a Transport
With SDP/10gE Java 9 will be able to deliver RDMA to the Java Ethernet
masses!
29
OpenHFT as a /dev/shm IPC Transport Provider:
peter.lawrey@higherfrequencytrading.com
“I want to be disruptive rather than
rehash or just slightly improve existing
products.”
08/14/2014
Ah, the glory!
30
OpenHFT as a /dev/shm IPC Transport Provider:
ZERO COPY capability
Advanced BytesMarshallable impl of Externalizable – for CBV Copy tolerant
parts of Liquidity Risk AE.
ZERO GC
CAPACITY LIMITED ONLY BY PHYSICAL RAM
CONSISTENTLY 438% Faster than On JVM Heap Cache<K,V> like
operands
JPM Tests show= Mean 350 nano-second /dev/shm latency (ZC
Entry<K,V> transport, RDR_DIM Mock)
DOES NOT SUPPORT FULLY-TRANSITIVE GENERIC V=Object Graph as
Cache<K,V> Operand. Currently {String, primitive} for ZC. NO immediate
Plug-N-Play w/ RDR_DIM Operands used by Liquidity Risk AE
NOT YET ADAPTED w/in RedHat JDG as JSR-107 compliant Cache<K,V>
Operand.
31
PROOF IS IN THE TEST RESULTS: What do we get using OpenHFT vs.
RedHat JDG?
OpenHFT /dev/shm/SharedHashMap<K,V> as operand provider:
To try , run the following command in 2 separated terminals ( (rm /dev/shm/*) Left
player must be started first!):
java 
org.junit.runner.JUnitCore 
net.openhft.collections.fromdocs.com.jpmorgan.pingpong_latency.PingPongPlayerLeft
java 
org.junit.runner.JUnitCore 
net.openhft.collections.fromdocs.com.jpmorgan.pingpong_latency.PingPongPlayerRigh
t
32424: 1 x _bondEntryV.getCoupon() (last _couponL=[5.00 %]) in 37.0 nanos
32425: 1 x _bondEntryV.getCoupon() (last _couponL=[5.00 %]) in 37.5 nanos
32423: 1 x _bondEntryV.getCoupon() (last _couponR=[4.00 %]) in 37.0 nanos
32424: 1 x _bondEntryV.getCoupon() (last _couponR=[4.00 %]) in 31.0 nanos
Full results at https://github.com/Cotton-
Ben/HugeCollections/tree/master/collections/src/test/java/net/openhft/collect
ions/fromdocs/com/jpmorgan/pingpong_latency
32
OpenHFT /dev/shm/SharedHashMap<K,V> as operand provider:
33
PROOF IS IN THE TEST RESULTS: What do we get using OpenHFT vs.
RedHat JDG?
RedHat JDG and JCACHE<K,V> as operand provider:
To try with a distributed cache, run the following command in separated terminals:
java 
-cp "target/classes:target/dependency/*“ 
org.infinispan.quickstart.clusteredcache.Node 
-d LEFT
java 
-cp "target/classes:target/dependency/*“ 
org.infinispan.quickstart.clusteredcache.Node 
-d RIGHT
counter=[217924] cache.put('369604103',3.000%); took 92,599 nanos
counter=[217925] cache.put('369604103',6.000%); took 90,062 nanos
counter=[42529] fl=[5%] = cache.get('369604103'); took 52,624 nanos
counter=[42530] fl=[6%] = cache.get('369604103'); took 47,981 nanos
( full results at https://github.com/Cotton-Ben/infinispan-
quickstart/tree/master/clustered-cache )
34
RedHat JDG and JCACHE<K,V> as operand provider (1,000x slower)
35
Bottom Line = Tests by Real-Time Liquidity Risk Technology AggEng team
imperically demonstrate that OpenHFT off-heap over /dev/shm IPC transport is
1,000x faster than RedHat JDG on-heap over UDP OSI-Loopback IPC transport.
IMMEDIATE NEXT STEPS:
NO DOUBT ABOUT IT = We need the OpenHFT off heap capability made
available to us via the RedHat JDG product and its JCACHE API!
Explicit commits from Mircea re: adapting Peter’s OpenHFT SHM as RedHat JDG
interoperable JSR-107 Cache<K,V>. RedHat customer support case?
Explicit commits from Bela re: “short circuiting” all node  node transport
resolution to use /dev/shm IPC as transport (instead of TCP/UDP) whenever
possible … RedHat customer support case?
Explicit commits from Peter re: supporting above with OpenHFT as the Off-Heap
provider. JPM retain OpenHFT via support subscription?
Continued commits/time planning re: Ben, Dmitry, Xiao efforts to maintained
Fork’d repo and build sound/complete/confirming tests.
36
THE END
Note: For all things re OpenHFT
Please contact:
Peter.Lawrey@higherfrequencytrading.com
www.openhft.net
Peter.Lawrey@higherfrequencytrading.com
www.openhft.net 37

More Related Content

What's hot

"Making OpenCV Code Run Fast," a Presentation from Intel
"Making OpenCV Code Run Fast," a Presentation from Intel"Making OpenCV Code Run Fast," a Presentation from Intel
"Making OpenCV Code Run Fast," a Presentation from IntelEdge AI and Vision Alliance
 
TomcatCon: from a cluster to the cloud
TomcatCon: from a cluster to the cloudTomcatCon: from a cluster to the cloud
TomcatCon: from a cluster to the cloudJean-Frederic Clere
 
Java performance monitoring
Java performance monitoringJava performance monitoring
Java performance monitoringSimon Ritter
 
Introduction of Java GC Tuning and Java Java Mission Control
Introduction of Java GC Tuning and Java Java Mission ControlIntroduction of Java GC Tuning and Java Java Mission Control
Introduction of Java GC Tuning and Java Java Mission ControlLeon Chen
 
JVM and Garbage Collection Tuning
JVM and Garbage Collection TuningJVM and Garbage Collection Tuning
JVM and Garbage Collection TuningKai Koenig
 
netfilter and iptables
netfilter and iptablesnetfilter and iptables
netfilter and iptablesKernel TLV
 
PT-4057, Automated CUDA-to-OpenCL™ Translation with CU2CL: What's Next?, by W...
PT-4057, Automated CUDA-to-OpenCL™ Translation with CU2CL: What's Next?, by W...PT-4057, Automated CUDA-to-OpenCL™ Translation with CU2CL: What's Next?, by W...
PT-4057, Automated CUDA-to-OpenCL™ Translation with CU2CL: What's Next?, by W...AMD Developer Central
 
Library Operating System for Linux #netdev01
Library Operating System for Linux #netdev01Library Operating System for Linux #netdev01
Library Operating System for Linux #netdev01Hajime Tazaki
 
Kernel Recipes 2018 - XDP: a new fast and programmable network layer - Jesper...
Kernel Recipes 2018 - XDP: a new fast and programmable network layer - Jesper...Kernel Recipes 2018 - XDP: a new fast and programmable network layer - Jesper...
Kernel Recipes 2018 - XDP: a new fast and programmable network layer - Jesper...Anne Nicolas
 
Low pause GC in HotSpot
Low pause GC in HotSpotLow pause GC in HotSpot
Low pause GC in HotSpotjClarity
 
BPF - in-kernel virtual machine
BPF - in-kernel virtual machineBPF - in-kernel virtual machine
BPF - in-kernel virtual machineAlexei Starovoitov
 
Shoot4U: Using VMM Assists to Optimize TLB Operations on Preempted vCPUs
Shoot4U: Using VMM Assists to Optimize TLB Operations on Preempted vCPUsShoot4U: Using VMM Assists to Optimize TLB Operations on Preempted vCPUs
Shoot4U: Using VMM Assists to Optimize TLB Operations on Preempted vCPUsJiannan Ouyang, PhD
 
HotSpot JVM Tuning
HotSpot JVM TuningHotSpot JVM Tuning
HotSpot JVM TuningGilad Garon
 
Startup Containers in Lightning Speed with Lazy Image Distribution
Startup Containers in Lightning Speed with Lazy Image DistributionStartup Containers in Lightning Speed with Lazy Image Distribution
Startup Containers in Lightning Speed with Lazy Image DistributionKohei Tokunaga
 
Achieving Performance Isolation with Lightweight Co-Kernels
Achieving Performance Isolation with Lightweight Co-KernelsAchieving Performance Isolation with Lightweight Co-Kernels
Achieving Performance Isolation with Lightweight Co-KernelsJiannan Ouyang, PhD
 
Introduction to Real Time Java
Introduction to Real Time JavaIntroduction to Real Time Java
Introduction to Real Time JavaDeniz Oguz
 
jcmd #javacasual
jcmd #javacasualjcmd #javacasual
jcmd #javacasualYuji Kubota
 
Design choices of golang for high scalability
Design choices of golang for high scalabilityDesign choices of golang for high scalability
Design choices of golang for high scalabilitySeongJae Park
 
HeapStats: Troubleshooting with Serviceability and the New Runtime Monitoring...
HeapStats: Troubleshooting with Serviceability and the New Runtime Monitoring...HeapStats: Troubleshooting with Serviceability and the New Runtime Monitoring...
HeapStats: Troubleshooting with Serviceability and the New Runtime Monitoring...Yuji Kubota
 

What's hot (20)

"Making OpenCV Code Run Fast," a Presentation from Intel
"Making OpenCV Code Run Fast," a Presentation from Intel"Making OpenCV Code Run Fast," a Presentation from Intel
"Making OpenCV Code Run Fast," a Presentation from Intel
 
TomcatCon: from a cluster to the cloud
TomcatCon: from a cluster to the cloudTomcatCon: from a cluster to the cloud
TomcatCon: from a cluster to the cloud
 
Java performance monitoring
Java performance monitoringJava performance monitoring
Java performance monitoring
 
Introduction of Java GC Tuning and Java Java Mission Control
Introduction of Java GC Tuning and Java Java Mission ControlIntroduction of Java GC Tuning and Java Java Mission Control
Introduction of Java GC Tuning and Java Java Mission Control
 
Basics of JVM Tuning
Basics of JVM TuningBasics of JVM Tuning
Basics of JVM Tuning
 
JVM and Garbage Collection Tuning
JVM and Garbage Collection TuningJVM and Garbage Collection Tuning
JVM and Garbage Collection Tuning
 
netfilter and iptables
netfilter and iptablesnetfilter and iptables
netfilter and iptables
 
PT-4057, Automated CUDA-to-OpenCL™ Translation with CU2CL: What's Next?, by W...
PT-4057, Automated CUDA-to-OpenCL™ Translation with CU2CL: What's Next?, by W...PT-4057, Automated CUDA-to-OpenCL™ Translation with CU2CL: What's Next?, by W...
PT-4057, Automated CUDA-to-OpenCL™ Translation with CU2CL: What's Next?, by W...
 
Library Operating System for Linux #netdev01
Library Operating System for Linux #netdev01Library Operating System for Linux #netdev01
Library Operating System for Linux #netdev01
 
Kernel Recipes 2018 - XDP: a new fast and programmable network layer - Jesper...
Kernel Recipes 2018 - XDP: a new fast and programmable network layer - Jesper...Kernel Recipes 2018 - XDP: a new fast and programmable network layer - Jesper...
Kernel Recipes 2018 - XDP: a new fast and programmable network layer - Jesper...
 
Low pause GC in HotSpot
Low pause GC in HotSpotLow pause GC in HotSpot
Low pause GC in HotSpot
 
BPF - in-kernel virtual machine
BPF - in-kernel virtual machineBPF - in-kernel virtual machine
BPF - in-kernel virtual machine
 
Shoot4U: Using VMM Assists to Optimize TLB Operations on Preempted vCPUs
Shoot4U: Using VMM Assists to Optimize TLB Operations on Preempted vCPUsShoot4U: Using VMM Assists to Optimize TLB Operations on Preempted vCPUs
Shoot4U: Using VMM Assists to Optimize TLB Operations on Preempted vCPUs
 
HotSpot JVM Tuning
HotSpot JVM TuningHotSpot JVM Tuning
HotSpot JVM Tuning
 
Startup Containers in Lightning Speed with Lazy Image Distribution
Startup Containers in Lightning Speed with Lazy Image DistributionStartup Containers in Lightning Speed with Lazy Image Distribution
Startup Containers in Lightning Speed with Lazy Image Distribution
 
Achieving Performance Isolation with Lightweight Co-Kernels
Achieving Performance Isolation with Lightweight Co-KernelsAchieving Performance Isolation with Lightweight Co-Kernels
Achieving Performance Isolation with Lightweight Co-Kernels
 
Introduction to Real Time Java
Introduction to Real Time JavaIntroduction to Real Time Java
Introduction to Real Time Java
 
jcmd #javacasual
jcmd #javacasualjcmd #javacasual
jcmd #javacasual
 
Design choices of golang for high scalability
Design choices of golang for high scalabilityDesign choices of golang for high scalability
Design choices of golang for high scalability
 
HeapStats: Troubleshooting with Serviceability and the New Runtime Monitoring...
HeapStats: Troubleshooting with Serviceability and the New Runtime Monitoring...HeapStats: Troubleshooting with Serviceability and the New Runtime Monitoring...
HeapStats: Troubleshooting with Serviceability and the New Runtime Monitoring...
 

Similar to OpenHFT: An Advanced Java Data Locality and IPC Transport Solution

H2O Design and Infrastructure with Matt Dowle
H2O Design and Infrastructure with Matt DowleH2O Design and Infrastructure with Matt Dowle
H2O Design and Infrastructure with Matt DowleSri Ambati
 
Highlights from Java 10, 11 and 12 and Future of Java at Javaland 2019 By Vad...
Highlights from Java 10, 11 and 12 and Future of Java at Javaland 2019 By Vad...Highlights from Java 10, 11 and 12 and Future of Java at Javaland 2019 By Vad...
Highlights from Java 10, 11 and 12 and Future of Java at Javaland 2019 By Vad...Vadym Kazulkin
 
Java 7 - New Features - by Mihail Stoynov and Svetlin Nakov
Java 7 - New Features - by Mihail Stoynov and Svetlin NakovJava 7 - New Features - by Mihail Stoynov and Svetlin Nakov
Java 7 - New Features - by Mihail Stoynov and Svetlin NakovSvetlin Nakov
 
Back to the future with Java 7 (Geekout June/2011)
Back to the future with Java 7 (Geekout June/2011)Back to the future with Java 7 (Geekout June/2011)
Back to the future with Java 7 (Geekout June/2011)Martijn Verburg
 
IPT High Performance Reactive Java BGOUG 2016
IPT High Performance Reactive Java BGOUG 2016IPT High Performance Reactive Java BGOUG 2016
IPT High Performance Reactive Java BGOUG 2016Trayan Iliev
 
LibOS as a regression test framework for Linux networking #netdev1.1
LibOS as a regression test framework for Linux networking #netdev1.1LibOS as a regression test framework for Linux networking #netdev1.1
LibOS as a regression test framework for Linux networking #netdev1.1Hajime Tazaki
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Direct Code Execution - LinuxCon Japan 2014
Direct Code Execution - LinuxCon Japan 2014Direct Code Execution - LinuxCon Japan 2014
Direct Code Execution - LinuxCon Japan 2014Hajime Tazaki
 
"Highlights from Java 10&11 and Future of Java" at Java User Group Bonn 2018 ...
"Highlights from Java 10&11 and Future of Java" at Java User Group Bonn 2018 ..."Highlights from Java 10&11 and Future of Java" at Java User Group Bonn 2018 ...
"Highlights from Java 10&11 and Future of Java" at Java User Group Bonn 2018 ...Vadym Kazulkin
 
Java 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from OredevJava 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from OredevMattias Karlsson
 
Highlights from Java 10-13 and Future of Java at JCON 2019 by Alukhanov and K...
Highlights from Java 10-13 and Future of Java at JCON 2019 by Alukhanov and K...Highlights from Java 10-13 and Future of Java at JCON 2019 by Alukhanov and K...
Highlights from Java 10-13 and Future of Java at JCON 2019 by Alukhanov and K...Vadym Kazulkin
 
The features of java 11 vs. java 12
The features of  java 11 vs. java 12The features of  java 11 vs. java 12
The features of java 11 vs. java 12FarjanaAhmed3
 
Inside the JVM - Follow the white rabbit! / Breizh JUG
Inside the JVM - Follow the white rabbit! / Breizh JUGInside the JVM - Follow the white rabbit! / Breizh JUG
Inside the JVM - Follow the white rabbit! / Breizh JUGSylvain Wallez
 

Similar to OpenHFT: An Advanced Java Data Locality and IPC Transport Solution (20)

Java 7 & 8
Java 7 & 8Java 7 & 8
Java 7 & 8
 
H2O Design and Infrastructure with Matt Dowle
H2O Design and Infrastructure with Matt DowleH2O Design and Infrastructure with Matt Dowle
H2O Design and Infrastructure with Matt Dowle
 
Highlights from Java 10, 11 and 12 and Future of Java at Javaland 2019 By Vad...
Highlights from Java 10, 11 and 12 and Future of Java at Javaland 2019 By Vad...Highlights from Java 10, 11 and 12 and Future of Java at Javaland 2019 By Vad...
Highlights from Java 10, 11 and 12 and Future of Java at Javaland 2019 By Vad...
 
Panama.pdf
Panama.pdfPanama.pdf
Panama.pdf
 
How can your applications benefit from Java 9?
How can your applications benefit from Java 9?How can your applications benefit from Java 9?
How can your applications benefit from Java 9?
 
Java 7 - New Features - by Mihail Stoynov and Svetlin Nakov
Java 7 - New Features - by Mihail Stoynov and Svetlin NakovJava 7 - New Features - by Mihail Stoynov and Svetlin Nakov
Java 7 - New Features - by Mihail Stoynov and Svetlin Nakov
 
Back to the future with Java 7 (Geekout June/2011)
Back to the future with Java 7 (Geekout June/2011)Back to the future with Java 7 (Geekout June/2011)
Back to the future with Java 7 (Geekout June/2011)
 
Java 7 & 8 - A&BP CC
Java 7 & 8 - A&BP CCJava 7 & 8 - A&BP CC
Java 7 & 8 - A&BP CC
 
IPT High Performance Reactive Java BGOUG 2016
IPT High Performance Reactive Java BGOUG 2016IPT High Performance Reactive Java BGOUG 2016
IPT High Performance Reactive Java BGOUG 2016
 
Java On Speed
Java On SpeedJava On Speed
Java On Speed
 
LibOS as a regression test framework for Linux networking #netdev1.1
LibOS as a regression test framework for Linux networking #netdev1.1LibOS as a regression test framework for Linux networking #netdev1.1
LibOS as a regression test framework for Linux networking #netdev1.1
 
Java 8 Overview
Java 8 OverviewJava 8 Overview
Java 8 Overview
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
How can your applications benefit from Java 9?
How can your applications benefit from Java 9?How can your applications benefit from Java 9?
How can your applications benefit from Java 9?
 
Direct Code Execution - LinuxCon Japan 2014
Direct Code Execution - LinuxCon Japan 2014Direct Code Execution - LinuxCon Japan 2014
Direct Code Execution - LinuxCon Japan 2014
 
"Highlights from Java 10&11 and Future of Java" at Java User Group Bonn 2018 ...
"Highlights from Java 10&11 and Future of Java" at Java User Group Bonn 2018 ..."Highlights from Java 10&11 and Future of Java" at Java User Group Bonn 2018 ...
"Highlights from Java 10&11 and Future of Java" at Java User Group Bonn 2018 ...
 
Java 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from OredevJava 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from Oredev
 
Highlights from Java 10-13 and Future of Java at JCON 2019 by Alukhanov and K...
Highlights from Java 10-13 and Future of Java at JCON 2019 by Alukhanov and K...Highlights from Java 10-13 and Future of Java at JCON 2019 by Alukhanov and K...
Highlights from Java 10-13 and Future of Java at JCON 2019 by Alukhanov and K...
 
The features of java 11 vs. java 12
The features of  java 11 vs. java 12The features of  java 11 vs. java 12
The features of java 11 vs. java 12
 
Inside the JVM - Follow the white rabbit! / Breizh JUG
Inside the JVM - Follow the white rabbit! / Breizh JUGInside the JVM - Follow the white rabbit! / Breizh JUG
Inside the JVM - Follow the white rabbit! / Breizh JUG
 

Recently uploaded

A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxmaisarahman1
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesRAJNEESHKUMAR341697
 
Rums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdfRums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdfsmsksolar
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.Kamal Acharya
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Call Girls Mumbai
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...HenryBriggs2
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxSCMS School of Architecture
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersMairaAshraf6
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 
Air Compressor reciprocating single stage
Air Compressor reciprocating single stageAir Compressor reciprocating single stage
Air Compressor reciprocating single stageAbc194748
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsvanyagupta248
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 

Recently uploaded (20)

A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 
Rums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdfRums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdf
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Air Compressor reciprocating single stage
Air Compressor reciprocating single stageAir Compressor reciprocating single stage
Air Compressor reciprocating single stage
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 

OpenHFT: An Advanced Java Data Locality and IPC Transport Solution

  • 1. Advanced Java Data Locality and Data IPC Transport Solutions: An Introduction to OpenHFT ben.cotton@jpmorgan.com ben.cotton@alumni.rutgers.edu Jan 27, 2015
  • 2. For real-time Java deployments (with the strictest SLAs) the problem of JVM “Stop the World” GC activity (on medium-lived on- Heap objects) is a MONSTROUS problem. 2
  • 3. Simple Remedy? Design Java developments and deployments so that medium-lived Collections (e.g. that “old dog” HashMap) object instance(s) are taught a “new trick” …. That “new trick” is simple: take HashMap completely Off-Heap. The Heap Good Boy! Off-Heap you go … 3
  • 4. But What kind of HashMap are we putting Off-Heap? • java.util.HashMap ? • Collections.synchronizedMap( java.util.HashMap ); ? • java.util.concurrent.ConcurrentHashMap ? • something entirely different ? ANSWER: something very different (indeed)! • OpenHFT’s Chronicle Map SOLUTION • net.openhft.chronicle.map.ChronicleMap 4
  • 5. What exactly is OpenHFT? • 100% Open Source • Designed to empower Higher Frequency Trading (HFT) • https://github.com/OpenHFT (developer source repo) • http://www.openhft.net (Products. Services. Training) • Provides modules that empower ultra low latency Java deployments to achieve REAL-TIME compliance (with even their strictest of SLAs) • Java-Lang (Marshalling / GC Free De-Marshalling / Thread-SAFE / IPC-SAFE / Off-Heap/ 64-bit ByteBuffers) • Chronicle-Queue (persisted low-latency Queue messaging and Logging) • Chroncile-Map (ChronicleMap, Thread-SAFE/IPC-SAFE/Off-Heap) • Chronicle-Engine Fast Data Framework. • Java-Runtime-Compiler (builds OpenHFT native impl classes – in process – of user supplied JBI interfaces) • Java-Thread-Affinity (allows JVM Threads to be pinned by affinity to specific OS cpus) • TransFIX (ultra low latency FIX engine) 5
  • 6. What really is OpenHFT? OpenHFT is a 100% OSS solution that empowers Java developers to deliver the highest performing and most flexible • Data Locality (Optimised memory layout) And • Data IPC Transport (waaay faster than UDP/TCP) Capabilities. 6
  • 7. PART 1 OpenHFT as an Advanced Java Data Locality Provider (That’s right folks! We’re going Off-Heap) 7
  • 10. 10
  • 11. 11
  • 12. Java Heap Layout: Through the Generations View 12
  • 13. OpenHFT: Off-Heap ChronicleMap … an Architectural View 13
  • 14. OpenHFT : Step #1 (PID 1) 14
  • 15. OpenHFT : Step #2 (PID 1) – thread safe write to off heap 15
  • 16. OpenHFT : Step #3 (PID 1) 16
  • 17. OpenHFT : Step #4 (PID 2) – thread safe read (concurrent) 17
  • 18. OpenHFT : Step #5 (PID 2) update an existing entry (thread safe) 18
  • 19. OpenHFT : Step #6 (PID 2) 19
  • 20. OpenHFT : Step #6 (PID 2) S OpenHFT code sample demo Summary: - MT-SAFE operations - IPC-SAFE operations - IPC-ATOMIC operations - ZERO-COPY (*) - GC-Free Marshalling/De-Marshalling - Ambition to provide the symmetry of java.util.concurrent.* API support across native Linux processes (not just Threads!) - Nanosecond transport latency (stay tuned for details) * (note on Map<K,V > type domain support status). 20
  • 21. Performance Results: CHM vs. SHM On Linux 14.04, dual E5-2650 v2 @ 2.60GHz, 128 GB memory, each entry updated 32 times. ConcurrentHashMap -Xmx110g -Xms110g -verbose:gc 21
  • 22. Performance Results: CHM vs. SHM On Linux 14.04, dual E5-2650 v2 @ 2.60GHz, 128 GB memory, each entry updated 32 times. 22
  • 23. OpenHFT as an Off-Heap JCACHE Provider (e.g. RedHat JDG Infinispan) 23
  • 24. OpenHFT empowers developers to use OpenJDK and Native Linux OS to 100% protect their medium-lived Java Collections (ChronicleMap) from being impacted by STW GC pauses. 24
  • 25. PART 2 OpenHFT as an Advanced Java IPC Transport Provider (That’s right folks! UDP/TCP now joined by native Linux /dev/shm IPC) 25
  • 26. OSI Model of Networking Layers: 26
  • 27. Java 7 Sockets Direct Protocol: Delivering SDP/IB as a Transport 27
  • 28. Java 7 Sockets Direct Protocol: Delivering to Java its first RDMA capability 28
  • 29. Intel iWARP: potential to empower Java 9 with SDP/10gE as a Transport With SDP/10gE Java 9 will be able to deliver RDMA to the Java Ethernet masses! 29
  • 30. OpenHFT as a /dev/shm IPC Transport Provider: peter.lawrey@higherfrequencytrading.com “I want to be disruptive rather than rehash or just slightly improve existing products.” 08/14/2014 Ah, the glory! 30
  • 31. OpenHFT as a /dev/shm IPC Transport Provider: ZERO COPY capability Advanced BytesMarshallable impl of Externalizable – for CBV Copy tolerant parts of Liquidity Risk AE. ZERO GC CAPACITY LIMITED ONLY BY PHYSICAL RAM CONSISTENTLY 438% Faster than On JVM Heap Cache<K,V> like operands JPM Tests show= Mean 350 nano-second /dev/shm latency (ZC Entry<K,V> transport, RDR_DIM Mock) DOES NOT SUPPORT FULLY-TRANSITIVE GENERIC V=Object Graph as Cache<K,V> Operand. Currently {String, primitive} for ZC. NO immediate Plug-N-Play w/ RDR_DIM Operands used by Liquidity Risk AE NOT YET ADAPTED w/in RedHat JDG as JSR-107 compliant Cache<K,V> Operand. 31
  • 32. PROOF IS IN THE TEST RESULTS: What do we get using OpenHFT vs. RedHat JDG? OpenHFT /dev/shm/SharedHashMap<K,V> as operand provider: To try , run the following command in 2 separated terminals ( (rm /dev/shm/*) Left player must be started first!): java org.junit.runner.JUnitCore net.openhft.collections.fromdocs.com.jpmorgan.pingpong_latency.PingPongPlayerLeft java org.junit.runner.JUnitCore net.openhft.collections.fromdocs.com.jpmorgan.pingpong_latency.PingPongPlayerRigh t 32424: 1 x _bondEntryV.getCoupon() (last _couponL=[5.00 %]) in 37.0 nanos 32425: 1 x _bondEntryV.getCoupon() (last _couponL=[5.00 %]) in 37.5 nanos 32423: 1 x _bondEntryV.getCoupon() (last _couponR=[4.00 %]) in 37.0 nanos 32424: 1 x _bondEntryV.getCoupon() (last _couponR=[4.00 %]) in 31.0 nanos Full results at https://github.com/Cotton- Ben/HugeCollections/tree/master/collections/src/test/java/net/openhft/collect ions/fromdocs/com/jpmorgan/pingpong_latency 32
  • 34. PROOF IS IN THE TEST RESULTS: What do we get using OpenHFT vs. RedHat JDG? RedHat JDG and JCACHE<K,V> as operand provider: To try with a distributed cache, run the following command in separated terminals: java -cp "target/classes:target/dependency/*“ org.infinispan.quickstart.clusteredcache.Node -d LEFT java -cp "target/classes:target/dependency/*“ org.infinispan.quickstart.clusteredcache.Node -d RIGHT counter=[217924] cache.put('369604103',3.000%); took 92,599 nanos counter=[217925] cache.put('369604103',6.000%); took 90,062 nanos counter=[42529] fl=[5%] = cache.get('369604103'); took 52,624 nanos counter=[42530] fl=[6%] = cache.get('369604103'); took 47,981 nanos ( full results at https://github.com/Cotton-Ben/infinispan- quickstart/tree/master/clustered-cache ) 34
  • 35. RedHat JDG and JCACHE<K,V> as operand provider (1,000x slower) 35
  • 36. Bottom Line = Tests by Real-Time Liquidity Risk Technology AggEng team imperically demonstrate that OpenHFT off-heap over /dev/shm IPC transport is 1,000x faster than RedHat JDG on-heap over UDP OSI-Loopback IPC transport. IMMEDIATE NEXT STEPS: NO DOUBT ABOUT IT = We need the OpenHFT off heap capability made available to us via the RedHat JDG product and its JCACHE API! Explicit commits from Mircea re: adapting Peter’s OpenHFT SHM as RedHat JDG interoperable JSR-107 Cache<K,V>. RedHat customer support case? Explicit commits from Bela re: “short circuiting” all node  node transport resolution to use /dev/shm IPC as transport (instead of TCP/UDP) whenever possible … RedHat customer support case? Explicit commits from Peter re: supporting above with OpenHFT as the Off-Heap provider. JPM retain OpenHFT via support subscription? Continued commits/time planning re: Ben, Dmitry, Xiao efforts to maintained Fork’d repo and build sound/complete/confirming tests. 36
  • 37. THE END Note: For all things re OpenHFT Please contact: Peter.Lawrey@higherfrequencytrading.com www.openhft.net Peter.Lawrey@higherfrequencytrading.com www.openhft.net 37