SlideShare a Scribd company logo
1 of 26
Download to read offline
©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd.	
 	
 	
 	
 	
 	
LMAX Exchange and the Zing JVM
Mark Price, Senior Developer, LMAX Exchange

Gil Tene, CTO & co-Founder, Azul Systems
Low Latency Java
in the Real World
©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd.	
 	
 	
 	
 	
 	
LMAX Exchange and the Zing JVM
Mark Price, Senior Developer, LMAX Exchange

Gil Tene, CTO & co-Founder, Azul Systems
Low Latency
Java
in the
Real World
©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd.	
 	
 	
 	
 	
 	
About me: Gil Tene
co-founder, CTO @Azul
Systems
Have been working on “think
different” GC approaches
since 2002
A Long history building
Virtual & Physical Machines,
Operating Systems,
Enterprise apps, etc...
I also depress people by
demonstrating how terribly
wrong their latency
measurements are… * working on real-world trash compaction issues, circa 2004
©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd.	
 	
 	
 	
 	
 	
About me: Mark Price
Senior Developer at
LMAX Exchange
Performance enthusiast
Touched pretty much
everything at LMAX over a
period of 8 years…
Currently focusing on
performance and monitoring
I’m the guy that everyone
used to come to with their
GC logs…
Then it said
“Concurrent

Mode Failure”
©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd.	
 	
 	
 	
 	
 	
Background
LMAX Exchange is a venue for low-latency
FX trading
World’s first regulated MTF for transparent,
order-driven FX trading
1st place in Tech Track 100 2014
We aim to be the world’s fastest retail FX
exchange
Open culture. A lot of open source
©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd.	
 	
 	
 	
 	
 	
Zing: what is it good for?
Not just fast. Always fast.
Eliminates GC as a problem/concern
Addresses all forms of GC pauses, large & small
Low latency or Human-scale latency
Small or Large heaps, Low or High throughput
GC is simply a solved problem. Move on…
Idiomatic Java code “just works”
Even when blips and pauses are not an option
©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd.	
 	
 	
 	
 	
 	
Stay Responsive
Even when traffic patterns change
©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd.	
 	
 	
 	
 	
 	
Real world traffic patterns
Not constant. Not Stochastic.
©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd.
©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd.	
 	
 	
 	
 	
 	
Java for low latency
Seriously?
Yes...
Time to Stability
Time to Market
Time to Performance
Overall productivity and delivery benefits
trump the various downsides
©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd.	
 	
 	
 	
 	
 	
All Java
©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd.	
 	
 	
 	
 	
 	
The good, the bad, and the ugly
Java is fast. Java is productive.
Good developers will produce good, fast code
Bad developers will produce bad, slow code
More Java devs than C/C++ devs (good & bad)
But JVMs are [normally] not consistently fast
GC pauses & Deoptimization & Deflation, oh my.
Low latency “Java” usually:
Written in the Java syntax. Avoids idiomatic Java.
Avoid using anyone else’s code...
©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd.	
 	
 	
 	
 	
 	
Zing’s impact on low latency Java
Zing is a JVM that values consistent speed
GC (and JVM) “noise” reduced to below OS “noise”
Keeps the good
Removes the bad and the ugly
Eliminates GC-related engineering efforts
All the associated bad and ugly choices
Idiomatic Java, not just “Java”
©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd.	
 	
 	
 	
 	
 	
Zing at LMAX Exchange
Started 2 years ago
Incremented from most critical to less critical
Next cover all latency-sensitive system
Also cover throughput critical systems
Throughput Critical
Latency Critical
Back

pressure
Outliers
©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd.
©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd.
©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd.	
 	
 	
 	
 	
 	
Development at LMAX Exchange
Heavy focus on TDD and CI
9000+ acceptance tests
Performance is treated as just another part of CI
Regression in performance same as a functional failure
Confidence to make large changes
©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd.	
 	
 	
 	
 	
 	
Zing at LMAX Exchange: Benefits
Improved latency behaviors
Reduced engineering effort
No more battling GC in code
Performance tuning cycles shorter
Idiomatic Java is a big deal
can avoid converting to “special practices” java
can “ease up” on no-allocation coding styles…
keep using/leveraging 3rd party code
more productive overall...
©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd.	
 	
 	
 	
 	
 	
Lessons Learnt
Attacking critical parts first:
may delay things...
critical parts have had engineering effort applied
smaller initial gains
longer time to gain confidence
With hindsight:
Could have started from “outside in” instead
Larger initial gains, shorter time-to-confidence
May have gotten to wider deployment faster
©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd.	
 	
 	
 	
 	
 	
Lessons Learnt:
GC is not the only problem
GC does tend to dominate outliers (pre-Zing)
it is natural to assume all big bad stuff is GC
with GC outliers gone, remaining problems surface
Some harder things:
page cache (kernel) lock contention
power management tuning in BIOS & OS
mapped file access faults & safepoints
©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd.	
 	
 	
 	
 	
 	
Lessons Learnt:
Proactively override Linux defaults
Out-of-the box Linux has some bad defaults
Bad for things that care about latency...
E.g. all these should be changed upfront:
Page cache: vm.min_free_kbytes [needs >1GB]
Transparent Huge Pages (THP) [should be turned off]
Swappiness [should be set to 0]
zone_reclaim_info [should be set to 0]
Each can cause multi-100s-of-msec outliers
©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd.	
 	
 	
 	
 	
 	
Lessons Learnt:
Measure, Measure, Measure
We were already measuring & collecting a lot
But jitter/hiccup/outlier measurement is tough
Especially across multiple hops
Detailed latency distribution measurements
Helped triage outlier issues and focus efforts
Full percentile spectrum histograms
Record system-level “hiccups” everywhere
©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd.	
 	
 	
 	
 	
 	
Observation points
©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd.	
 	
 	
 	
 	
 	
Time-stamping points
©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd.	
 	
 	
 	
 	
 	
Summary
Java is both viable and profitable for low latency
With “regular JVMs” you have to jump through
some hoops to get there
Zing helps low latency in Java be as easy as low
latency in other languages
Once you stop dealing with JVM-related issues,
you can get on with the interesting stuff
©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd.	
 	
 	
 	
 	
 	
Q & A

More Related Content

What's hot

Advanced off heap ipc
Advanced off heap ipcAdvanced off heap ipc
Advanced off heap ipc
Peter Lawrey
 
State: You're Doing It Wrong - Alternative Concurrency Paradigms For The JVM
State: You're Doing It Wrong - Alternative Concurrency Paradigms For The JVMState: You're Doing It Wrong - Alternative Concurrency Paradigms For The JVM
State: You're Doing It Wrong - Alternative Concurrency Paradigms For The JVM
Jonas Bonér
 
Failover or not to failover
Failover or not to failoverFailover or not to failover
Failover or not to failover
Henrik Ingo
 

What's hot (20)

Low latency for high throughput
Low latency for high throughputLow latency for high throughput
Low latency for high throughput
 
Determinism in finance
Determinism in financeDeterminism in finance
Determinism in finance
 
High Frequency Trading and NoSQL database
High Frequency Trading and NoSQL databaseHigh Frequency Trading and NoSQL database
High Frequency Trading and NoSQL database
 
Responding rapidly when you have 100+ GB data sets in Java
Responding rapidly when you have 100+ GB data sets in JavaResponding rapidly when you have 100+ GB data sets in Java
Responding rapidly when you have 100+ GB data sets in Java
 
Advanced off heap ipc
Advanced off heap ipcAdvanced off heap ipc
Advanced off heap ipc
 
Java in High Frequency Trading
Java in High Frequency TradingJava in High Frequency Trading
Java in High Frequency Trading
 
Open HFT libraries in @Java
Open HFT libraries in @JavaOpen HFT libraries in @Java
Open HFT libraries in @Java
 
Important Factors that bring down the trading systems projects
Important Factors that bring down the trading systems projectsImportant Factors that bring down the trading systems projects
Important Factors that bring down the trading systems projects
 
Introduction to OpenHFT for Melbourne Java Users Group
Introduction to OpenHFT for Melbourne Java Users GroupIntroduction to OpenHFT for Melbourne Java Users Group
Introduction to OpenHFT for Melbourne Java Users Group
 
Chronicle Accelerate Crypto Investor conference
Chronicle Accelerate Crypto Investor conferenceChronicle Accelerate Crypto Investor conference
Chronicle Accelerate Crypto Investor conference
 
Lightweight Grids With Terracotta
Lightweight Grids With TerracottaLightweight Grids With Terracotta
Lightweight Grids With Terracotta
 
State: You're Doing It Wrong - Alternative Concurrency Paradigms For The JVM
State: You're Doing It Wrong - Alternative Concurrency Paradigms For The JVMState: You're Doing It Wrong - Alternative Concurrency Paradigms For The JVM
State: You're Doing It Wrong - Alternative Concurrency Paradigms For The JVM
 
Shared Memory Performance: Beyond TCP/IP with Ben Cotton, JPMorgan
Shared Memory Performance: Beyond TCP/IP with Ben Cotton, JPMorganShared Memory Performance: Beyond TCP/IP with Ben Cotton, JPMorgan
Shared Memory Performance: Beyond TCP/IP with Ben Cotton, JPMorgan
 
Performance Tuning - Memory leaks, Thread deadlocks, JDK tools
Performance Tuning -  Memory leaks, Thread deadlocks, JDK toolsPerformance Tuning -  Memory leaks, Thread deadlocks, JDK tools
Performance Tuning - Memory leaks, Thread deadlocks, JDK tools
 
Alejandro Zuno Data Backup English
Alejandro Zuno Data Backup EnglishAlejandro Zuno Data Backup English
Alejandro Zuno Data Backup English
 
Failover or not to failover
Failover or not to failoverFailover or not to failover
Failover or not to failover
 
Prometheus design and philosophy
Prometheus design and philosophy   Prometheus design and philosophy
Prometheus design and philosophy
 
MySQL native driver for PHP (mysqlnd) - Introduction and overview, Edition 2011
MySQL native driver for PHP (mysqlnd) - Introduction and overview, Edition 2011MySQL native driver for PHP (mysqlnd) - Introduction and overview, Edition 2011
MySQL native driver for PHP (mysqlnd) - Introduction and overview, Edition 2011
 
MySQL 5.6 Global Transaction IDs - Use case: (session) consistency
MySQL 5.6 Global Transaction IDs - Use case: (session) consistencyMySQL 5.6 Global Transaction IDs - Use case: (session) consistency
MySQL 5.6 Global Transaction IDs - Use case: (session) consistency
 
Introduction to Galera Cluster
Introduction to Galera ClusterIntroduction to Galera Cluster
Introduction to Galera Cluster
 

Viewers also liked

Continuous delivery with Gradle
Continuous delivery with GradleContinuous delivery with Gradle
Continuous delivery with Gradle
Bob Paulin
 
Ch10 - Organisation theory design and change gareth jones
Ch10 - Organisation theory design and change gareth jonesCh10 - Organisation theory design and change gareth jones
Ch10 - Organisation theory design and change gareth jones
Ankit Kesri
 

Viewers also liked (20)

Rmppt
RmpptRmppt
Rmppt
 
Change management
Change managementChange management
Change management
 
Sales Hacker Conference San Francisco - Cliff Cate - Aligning Sales and Custo...
Sales Hacker Conference San Francisco - Cliff Cate - Aligning Sales and Custo...Sales Hacker Conference San Francisco - Cliff Cate - Aligning Sales and Custo...
Sales Hacker Conference San Francisco - Cliff Cate - Aligning Sales and Custo...
 
Building & Leading High Performance Teams
Building & Leading High Performance TeamsBuilding & Leading High Performance Teams
Building & Leading High Performance Teams
 
Operationalizing Change Management
Operationalizing Change ManagementOperationalizing Change Management
Operationalizing Change Management
 
Continuous delivery with Gradle
Continuous delivery with GradleContinuous delivery with Gradle
Continuous delivery with Gradle
 
Managing change during reorganization
Managing change during reorganizationManaging change during reorganization
Managing change during reorganization
 
Reactive Programming Models for IoT
Reactive Programming Models for IoTReactive Programming Models for IoT
Reactive Programming Models for IoT
 
The Cloud Native Journey
The Cloud Native JourneyThe Cloud Native Journey
The Cloud Native Journey
 
3 Success Factors that Define High Performance Teams
3 Success Factors that Define High Performance Teams3 Success Factors that Define High Performance Teams
3 Success Factors that Define High Performance Teams
 
Concurrent Programming Using the Disruptor
Concurrent Programming Using the DisruptorConcurrent Programming Using the Disruptor
Concurrent Programming Using the Disruptor
 
Reward system hr management od interventions - Organizational Change and D...
Reward system   hr management od interventions -  Organizational Change and D...Reward system   hr management od interventions -  Organizational Change and D...
Reward system hr management od interventions - Organizational Change and D...
 
Leading High Performance Teams
Leading High Performance TeamsLeading High Performance Teams
Leading High Performance Teams
 
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...
 
Strategic total rewards management remuneration and rewards summit 11 june 2014
Strategic total rewards management remuneration and rewards summit 11 june 2014Strategic total rewards management remuneration and rewards summit 11 june 2014
Strategic total rewards management remuneration and rewards summit 11 june 2014
 
Without Self-Service Operations, the Cloud is Just Expensive Hosting 2.0 - (a...
Without Self-Service Operations, the Cloud is Just Expensive Hosting 2.0 - (a...Without Self-Service Operations, the Cloud is Just Expensive Hosting 2.0 - (a...
Without Self-Service Operations, the Cloud is Just Expensive Hosting 2.0 - (a...
 
Containerization is more than the new Virtualization: enabling separation of ...
Containerization is more than the new Virtualization: enabling separation of ...Containerization is more than the new Virtualization: enabling separation of ...
Containerization is more than the new Virtualization: enabling separation of ...
 
Ch10 - Organisation theory design and change gareth jones
Ch10 - Organisation theory design and change gareth jonesCh10 - Organisation theory design and change gareth jones
Ch10 - Organisation theory design and change gareth jones
 
Types of Power
Types of PowerTypes of Power
Types of Power
 
Characteristics Of High Performance Teams
Characteristics Of High Performance TeamsCharacteristics Of High Performance Teams
Characteristics Of High Performance Teams
 

Similar to QCon London: Low latency Java in the real world - LMAX Exchange and the Zing JVM

Similar to QCon London: Low latency Java in the real world - LMAX Exchange and the Zing JVM (20)

Enabling Java in Latency Sensitive Environments - Dallas JUG April 2015
Enabling Java in Latency Sensitive Environments - Dallas JUG April 2015Enabling Java in Latency Sensitive Environments - Dallas JUG April 2015
Enabling Java in Latency Sensitive Environments - Dallas JUG April 2015
 
Enabling Java in Latency-Sensitive Environments - Austin JUG April 2015
Enabling Java in Latency-Sensitive Environments - Austin JUG April 2015Enabling Java in Latency-Sensitive Environments - Austin JUG April 2015
Enabling Java in Latency-Sensitive Environments - Austin JUG April 2015
 
Vertafore: Database Evaluation - Selecting Apache Cassandra
Vertafore: Database Evaluation - Selecting Apache CassandraVertafore: Database Evaluation - Selecting Apache Cassandra
Vertafore: Database Evaluation - Selecting Apache Cassandra
 
How NOT to Measure Latency
How NOT to Measure LatencyHow NOT to Measure Latency
How NOT to Measure Latency
 
Understanding Hardware Transactional Memory
Understanding Hardware Transactional MemoryUnderstanding Hardware Transactional Memory
Understanding Hardware Transactional Memory
 
DotCMS Bootcamp: Enabling Java in Latency Sensitivie Environments
DotCMS Bootcamp: Enabling Java in Latency Sensitivie EnvironmentsDotCMS Bootcamp: Enabling Java in Latency Sensitivie Environments
DotCMS Bootcamp: Enabling Java in Latency Sensitivie Environments
 
Skytap parasoft webinar new years resolution- accelerate sdlc
Skytap parasoft webinar new years resolution- accelerate sdlcSkytap parasoft webinar new years resolution- accelerate sdlc
Skytap parasoft webinar new years resolution- accelerate sdlc
 
JVMCON Java in the 21st Century: are you thinking far enough ahead?
JVMCON Java in the 21st Century: are you thinking far enough ahead?JVMCON Java in the 21st Century: are you thinking far enough ahead?
JVMCON Java in the 21st Century: are you thinking far enough ahead?
 
Enabling Java in Latency-Sensitive Applications
Enabling Java in Latency-Sensitive ApplicationsEnabling Java in Latency-Sensitive Applications
Enabling Java in Latency-Sensitive Applications
 
Dev talks Cluj 2018 : Java in the 21 Century: Are you thinking far enough ahead?
Dev talks Cluj 2018 : Java in the 21 Century: Are you thinking far enough ahead?Dev talks Cluj 2018 : Java in the 21 Century: Are you thinking far enough ahead?
Dev talks Cluj 2018 : Java in the 21 Century: Are you thinking far enough ahead?
 
ITT 2015 - Kirk Pepperdine - The (not so) Dark Art of Performance Tuning, fro...
ITT 2015 - Kirk Pepperdine - The (not so) Dark Art of Performance Tuning, fro...ITT 2015 - Kirk Pepperdine - The (not so) Dark Art of Performance Tuning, fro...
ITT 2015 - Kirk Pepperdine - The (not so) Dark Art of Performance Tuning, fro...
 
How to Become a Winner in the JVM Performance-Tuning Battle
How to Become a Winner in the JVM Performance-Tuning BattleHow to Become a Winner in the JVM Performance-Tuning Battle
How to Become a Winner in the JVM Performance-Tuning Battle
 
Using containerization to enable your microservice architecture
Using containerization to enable your microservice architecture Using containerization to enable your microservice architecture
Using containerization to enable your microservice architecture
 
Real World Serverless
Real World ServerlessReal World Serverless
Real World Serverless
 
Microservices
MicroservicesMicroservices
Microservices
 
Enabling Java in Latency Sensitive Applications by Gil Tene, CTO, Azul Systems
Enabling Java in Latency Sensitive Applications by Gil Tene, CTO, Azul SystemsEnabling Java in Latency Sensitive Applications by Gil Tene, CTO, Azul Systems
Enabling Java in Latency Sensitive Applications by Gil Tene, CTO, Azul Systems
 
Pivotal microservices spring_pcf_skillsmatter.pptx
Pivotal microservices spring_pcf_skillsmatter.pptxPivotal microservices spring_pcf_skillsmatter.pptx
Pivotal microservices spring_pcf_skillsmatter.pptx
 
The Cloud Native Journey
The Cloud Native JourneyThe Cloud Native Journey
The Cloud Native Journey
 
Migrate from Terma Software Jaws to CA Workload Automation iDash for Enhanced...
Migrate from Terma Software Jaws to CA Workload Automation iDash for Enhanced...Migrate from Terma Software Jaws to CA Workload Automation iDash for Enhanced...
Migrate from Terma Software Jaws to CA Workload Automation iDash for Enhanced...
 
Scaling FreeSWITCH Performance
Scaling FreeSWITCH PerformanceScaling FreeSWITCH Performance
Scaling FreeSWITCH Performance
 

More from Azul Systems, Inc.

More from Azul Systems, Inc. (7)

Unleash the Power of Apache Cassandra
Unleash the Power of Apache CassandraUnleash the Power of Apache Cassandra
Unleash the Power of Apache Cassandra
 
JVM Language Summit: Object layout presentation
JVM Language Summit: Object layout presentationJVM Language Summit: Object layout presentation
JVM Language Summit: Object layout presentation
 
JVM Language Summit: Object layout workshop
JVM Language Summit: Object layout workshopJVM Language Summit: Object layout workshop
JVM Language Summit: Object layout workshop
 
What's New in the JVM in Java 8?
What's New in the JVM in Java 8?What's New in the JVM in Java 8?
What's New in the JVM in Java 8?
 
DC JUG: Understanding Java Garbage Collection
DC JUG: Understanding Java Garbage CollectionDC JUG: Understanding Java Garbage Collection
DC JUG: Understanding Java Garbage Collection
 
Silicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM MechanicsSilicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM Mechanics
 
Winning With Java at Market Open
Winning With Java at Market OpenWinning With Java at Market Open
Winning With Java at Market Open
 

Recently uploaded

CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
anilsa9823
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
anilsa9823
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Recently uploaded (20)

Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 

QCon London: Low latency Java in the real world - LMAX Exchange and the Zing JVM

  • 1. ©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd. LMAX Exchange and the Zing JVM Mark Price, Senior Developer, LMAX Exchange Gil Tene, CTO & co-Founder, Azul Systems Low Latency Java in the Real World
  • 2. ©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd. LMAX Exchange and the Zing JVM Mark Price, Senior Developer, LMAX Exchange Gil Tene, CTO & co-Founder, Azul Systems Low Latency Java in the Real World
  • 3. ©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd. About me: Gil Tene co-founder, CTO @Azul Systems Have been working on “think different” GC approaches since 2002 A Long history building Virtual & Physical Machines, Operating Systems, Enterprise apps, etc... I also depress people by demonstrating how terribly wrong their latency measurements are… * working on real-world trash compaction issues, circa 2004
  • 4. ©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd. About me: Mark Price Senior Developer at LMAX Exchange Performance enthusiast Touched pretty much everything at LMAX over a period of 8 years… Currently focusing on performance and monitoring I’m the guy that everyone used to come to with their GC logs… Then it said “Concurrent Mode Failure”
  • 5. ©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd. Background LMAX Exchange is a venue for low-latency FX trading World’s first regulated MTF for transparent, order-driven FX trading 1st place in Tech Track 100 2014 We aim to be the world’s fastest retail FX exchange Open culture. A lot of open source
  • 6. ©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd. Zing: what is it good for? Not just fast. Always fast. Eliminates GC as a problem/concern Addresses all forms of GC pauses, large & small Low latency or Human-scale latency Small or Large heaps, Low or High throughput GC is simply a solved problem. Move on… Idiomatic Java code “just works” Even when blips and pauses are not an option
  • 7. ©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd. Stay Responsive Even when traffic patterns change
  • 8. ©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd. Real world traffic patterns Not constant. Not Stochastic.
  • 9. ©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd.
  • 10. ©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd. Java for low latency Seriously? Yes... Time to Stability Time to Market Time to Performance Overall productivity and delivery benefits trump the various downsides
  • 11. ©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd. All Java
  • 12. ©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd. The good, the bad, and the ugly Java is fast. Java is productive. Good developers will produce good, fast code Bad developers will produce bad, slow code More Java devs than C/C++ devs (good & bad) But JVMs are [normally] not consistently fast GC pauses & Deoptimization & Deflation, oh my. Low latency “Java” usually: Written in the Java syntax. Avoids idiomatic Java. Avoid using anyone else’s code...
  • 13. ©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd. Zing’s impact on low latency Java Zing is a JVM that values consistent speed GC (and JVM) “noise” reduced to below OS “noise” Keeps the good Removes the bad and the ugly Eliminates GC-related engineering efforts All the associated bad and ugly choices Idiomatic Java, not just “Java”
  • 14. ©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd. Zing at LMAX Exchange Started 2 years ago Incremented from most critical to less critical Next cover all latency-sensitive system Also cover throughput critical systems Throughput Critical Latency Critical Back pressure Outliers
  • 15. ©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd.
  • 16. ©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd.
  • 17. ©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd. Development at LMAX Exchange Heavy focus on TDD and CI 9000+ acceptance tests Performance is treated as just another part of CI Regression in performance same as a functional failure Confidence to make large changes
  • 18. ©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd. Zing at LMAX Exchange: Benefits Improved latency behaviors Reduced engineering effort No more battling GC in code Performance tuning cycles shorter Idiomatic Java is a big deal can avoid converting to “special practices” java can “ease up” on no-allocation coding styles… keep using/leveraging 3rd party code more productive overall...
  • 19. ©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd. Lessons Learnt Attacking critical parts first: may delay things... critical parts have had engineering effort applied smaller initial gains longer time to gain confidence With hindsight: Could have started from “outside in” instead Larger initial gains, shorter time-to-confidence May have gotten to wider deployment faster
  • 20. ©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd. Lessons Learnt: GC is not the only problem GC does tend to dominate outliers (pre-Zing) it is natural to assume all big bad stuff is GC with GC outliers gone, remaining problems surface Some harder things: page cache (kernel) lock contention power management tuning in BIOS & OS mapped file access faults & safepoints
  • 21. ©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd. Lessons Learnt: Proactively override Linux defaults Out-of-the box Linux has some bad defaults Bad for things that care about latency... E.g. all these should be changed upfront: Page cache: vm.min_free_kbytes [needs >1GB] Transparent Huge Pages (THP) [should be turned off] Swappiness [should be set to 0] zone_reclaim_info [should be set to 0] Each can cause multi-100s-of-msec outliers
  • 22. ©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd. Lessons Learnt: Measure, Measure, Measure We were already measuring & collecting a lot But jitter/hiccup/outlier measurement is tough Especially across multiple hops Detailed latency distribution measurements Helped triage outlier issues and focus efforts Full percentile spectrum histograms Record system-level “hiccups” everywhere
  • 23. ©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd. Observation points
  • 24. ©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd. Time-stamping points
  • 25. ©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd. Summary Java is both viable and profitable for low latency With “regular JVMs” you have to jump through some hoops to get there Zing helps low latency in Java be as easy as low latency in other languages Once you stop dealing with JVM-related issues, you can get on with the interesting stuff
  • 26. ©2015 Azul Systems, Inc. ©2015 LMAX Exchange Ltd. Q & A