SlideShare a Scribd company logo
1 of 35
Download to read offline
Ratpack
The story so far
Phill Barber - Team Thor - Team Cirrus - Energized Work
Agenda
● What is Ratpack?
● Why did we decide to use it?
● A look at the code.
● Mistakes you can make.
● Issues we currently face.
● Retrospective.
What is Ratpack?
What is ratpack?
● A high performance Java web framework.
● Asynchronous and non-blocking model.
● Aims to make asynchronous programming on the JVM easier.
● Built on Java 8 and Netty.
● Currently at version 1.1.1
What is ratpack? (continued)
Assuming your application is I/O bound, it offers the following
benefits:
● High throughput
● Low CPU usage
● Lower Memory usage (due to less threads)
All of these benefits are due to its threading model and using
non blocking I/O
Synchronous - Blocking I/O
Asynchronous - Non Blocking I/O
What is ratpack? (continued)
This efficiency comes with the cost of increased complexity.
● Steep learning curve.
● Easy to get wrong.
● Hard to debug.
Ratpack misconceptions
● Asynchronicity is internal only!
○ It’s just a web server.
○ It takes time to respond to http requests.
● Doesn’t improve latency.
○ If a downstream call takes 500ms, ratpack will take > 500ms to respond.
● If you are using Ratpack - it doesn’t mean your system will
necessarily perform any better.
○ You can make it perform worse!
Why did we decide to use
it?
Ratpack vs Dropwizard
Ratpack vs Dropwizard
Ratpack vs Dropwizard - Load profiles
Three load profiles were given to each application as detailed
below:
1. 5 minute duration, 100 JMeter Threads
2. 5 minute duration, 200 JMeter Threads
3. 5 minute duration, 300 JMeter Threads
Ratpack vs Dropwizard
Ratpack vs Dropwizard
Ratpack vs Dropwizard
Ratpack vs Dropwizard
Why did we decide to use it?
● We will be I/O bound.
● We will be at high load.
● Ratpack vs Dropwizard Performance Test revealed
encouraging stats.
● We had a sense of optimism that we’d pick up the async
challenges.
A look at the code
A look at the code - Overview
● Runnable Jar.
● main() method starts the server.
○ Simple and easy to start for testing.
● URIs mapped to Handlers.
● Execution model deals with Promises.
● We decided to use Rx Java in “service” layer and use
Observables.
A look at the code
● Happy path example.
A look at the code
● Happy path example.
● High throughput example.
A look at the code
● Happy path example.
● High throughput example.
● Deterministic demonstration.
Mistakes you can make
...BIG BIG mistakes!
Mistakes - Two Types
1. Dangerous mistakes.
2. Annoying mistakes.
Dangerous mistakes
● Calling a blocking method.
○ So many ways to do this.
IMPACT: ?
Dangerous mistakes
● Making new Threads
IMPACT: Memory & CPU increase -> Ultimately low
throughput
Annoying mistakes
● Not understanding execution model.
○ Not using Promises when you should.
Annoying mistakes
● Messing up Threads
○ Using Cassandra thread to call Cassandra.
○ Happened to us whilst implementing ListenableFuture
Issues we currently face
Issues (continued)
● Ratpack http client does not use a connection pool.
● AppDynamics integration still ongoing.
Issues
Performance related issue: At load, 1 in 1000 requests would not get a response.
● Hard to debug
● Thread dumps revealed that (big surprise) nothing was blocking. Where do you
go from here?
Now Resolved
● Was actually an issue related to secretly running in Development mode. InteliJ
IDEA
○ Issue #909
Retrospective
Retro / Assorted notes...
● It was harder than we expected.
● It took longer than expected to get up to speed.
● Rx bought us flexibility but introduced an extra learning curve.
● Cost vs Reward analysis is difficult but would have been a benefit.
● Monitoring our CPU and Memory usage is key to realising the benefit.
● Confidence is improving day by day… BUT…
● Still not proven - We’re not live yet!
Thanks!
Questions?
More info: http://phillbarber.blogspot.co.uk/
Code: https://github.com/phillbarber/ratpack-demo

More Related Content

What's hot

Javascript test automation demo
Javascript test automation demoJavascript test automation demo
Javascript test automation demoSara Fawad
 
Web performance
Web  performance Web  performance
Web performance Major Ye
 
Speeding up Page Load Times by Using Starling
Speeding up Page Load Times by Using StarlingSpeeding up Page Load Times by Using Starling
Speeding up Page Load Times by Using StarlingErik Osterman
 
Let's use Xslate - Osdc.tw 2011
Let's use Xslate - Osdc.tw 2011Let's use Xslate - Osdc.tw 2011
Let's use Xslate - Osdc.tw 2011Goro Fuji
 
Gearman and asynchronous processing in PHP applications
Gearman and asynchronous processing in PHP applicationsGearman and asynchronous processing in PHP applications
Gearman and asynchronous processing in PHP applicationsDinh Pham
 
Performant Django - Ara Anjargolian
Performant Django - Ara AnjargolianPerformant Django - Ara Anjargolian
Performant Django - Ara AnjargolianHakka Labs
 
Asynchronous programming using CompletableFutures in Java
Asynchronous programming using CompletableFutures in JavaAsynchronous programming using CompletableFutures in Java
Asynchronous programming using CompletableFutures in JavaOresztész Margaritisz
 
Episode 13 - Advanced Apex Triggers
Episode 13 - Advanced Apex TriggersEpisode 13 - Advanced Apex Triggers
Episode 13 - Advanced Apex TriggersJitendra Zaa
 

What's hot (10)

Javascript test automation demo
Javascript test automation demoJavascript test automation demo
Javascript test automation demo
 
Web performance
Web  performance Web  performance
Web performance
 
Merb Core
Merb CoreMerb Core
Merb Core
 
Speeding up Page Load Times by Using Starling
Speeding up Page Load Times by Using StarlingSpeeding up Page Load Times by Using Starling
Speeding up Page Load Times by Using Starling
 
Let's use Xslate - Osdc.tw 2011
Let's use Xslate - Osdc.tw 2011Let's use Xslate - Osdc.tw 2011
Let's use Xslate - Osdc.tw 2011
 
Gearman and asynchronous processing in PHP applications
Gearman and asynchronous processing in PHP applicationsGearman and asynchronous processing in PHP applications
Gearman and asynchronous processing in PHP applications
 
Performant Django - Ara Anjargolian
Performant Django - Ara AnjargolianPerformant Django - Ara Anjargolian
Performant Django - Ara Anjargolian
 
Unit testing hippo
Unit testing hippoUnit testing hippo
Unit testing hippo
 
Asynchronous programming using CompletableFutures in Java
Asynchronous programming using CompletableFutures in JavaAsynchronous programming using CompletableFutures in Java
Asynchronous programming using CompletableFutures in Java
 
Episode 13 - Advanced Apex Triggers
Episode 13 - Advanced Apex TriggersEpisode 13 - Advanced Apex Triggers
Episode 13 - Advanced Apex Triggers
 

Viewers also liked

Look at it This Way - Persuasive paper
Look at it This Way - Persuasive paperLook at it This Way - Persuasive paper
Look at it This Way - Persuasive paperMikenzi L. Schulze
 
Liferay Symposium – Italy 2015
Liferay Symposium – Italy 2015Liferay Symposium – Italy 2015
Liferay Symposium – Italy 2015Sourcesense
 
Implementing portlets using Web Scripts
Implementing portlets using Web ScriptsImplementing portlets using Web Scripts
Implementing portlets using Web ScriptsPiergiorgio Lucidi
 
Real-time Analytics with Apache Flink and Druid
Real-time Analytics with Apache Flink and DruidReal-time Analytics with Apache Flink and Druid
Real-time Analytics with Apache Flink and DruidJan Graßegger
 
Real-time analytics with Druid at Appsflyer
Real-time analytics with Druid at AppsflyerReal-time analytics with Druid at Appsflyer
Real-time analytics with Druid at AppsflyerMichael Spector
 
Aggregated queries with Druid on terrabytes and petabytes of data
Aggregated queries with Druid on terrabytes and petabytes of dataAggregated queries with Druid on terrabytes and petabytes of data
Aggregated queries with Druid on terrabytes and petabytes of dataRostislav Pashuto
 
Victoria's Secret Angels Campaign
Victoria's Secret Angels CampaignVictoria's Secret Angels Campaign
Victoria's Secret Angels CampaignJohn White
 
도커 무작정 따라하기: 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!
도커 무작정 따라하기: 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!도커 무작정 따라하기: 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!
도커 무작정 따라하기: 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!pyrasis
 

Viewers also liked (11)

Look at it This Way - Persuasive paper
Look at it This Way - Persuasive paperLook at it This Way - Persuasive paper
Look at it This Way - Persuasive paper
 
Liferay Symposium – Italy 2015
Liferay Symposium – Italy 2015Liferay Symposium – Italy 2015
Liferay Symposium – Italy 2015
 
Knight templar banners
Knight templar bannersKnight templar banners
Knight templar banners
 
El héroe de tu vida
El héroe de tu vidaEl héroe de tu vida
El héroe de tu vida
 
Implementing portlets using Web Scripts
Implementing portlets using Web ScriptsImplementing portlets using Web Scripts
Implementing portlets using Web Scripts
 
Real-time Analytics with Apache Flink and Druid
Real-time Analytics with Apache Flink and DruidReal-time Analytics with Apache Flink and Druid
Real-time Analytics with Apache Flink and Druid
 
Real-time analytics with Druid at Appsflyer
Real-time analytics with Druid at AppsflyerReal-time analytics with Druid at Appsflyer
Real-time analytics with Druid at Appsflyer
 
Aggregated queries with Druid on terrabytes and petabytes of data
Aggregated queries with Druid on terrabytes and petabytes of dataAggregated queries with Druid on terrabytes and petabytes of data
Aggregated queries with Druid on terrabytes and petabytes of data
 
Scalable Real-time analytics using Druid
Scalable Real-time analytics using DruidScalable Real-time analytics using Druid
Scalable Real-time analytics using Druid
 
Victoria's Secret Angels Campaign
Victoria's Secret Angels CampaignVictoria's Secret Angels Campaign
Victoria's Secret Angels Campaign
 
도커 무작정 따라하기: 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!
도커 무작정 따라하기: 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!도커 무작정 따라하기: 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!
도커 무작정 따라하기: 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!
 

Similar to The Story So Far with Ratpack: High Performance Java Web Framework

Gatling - Bordeaux JUG
Gatling - Bordeaux JUGGatling - Bordeaux JUG
Gatling - Bordeaux JUGslandelle
 
Concurrency - Why it's hard ?
Concurrency - Why it's hard ?Concurrency - Why it's hard ?
Concurrency - Why it's hard ?Ramith Jayasinghe
 
Performance optimization techniques for Java code
Performance optimization techniques for Java codePerformance optimization techniques for Java code
Performance optimization techniques for Java codeAttila Balazs
 
The Bleeding Edge
The Bleeding EdgeThe Bleeding Edge
The Bleeding EdgejClarity
 
Performance Test Automation With Gatling
Performance Test Automation  With GatlingPerformance Test Automation  With Gatling
Performance Test Automation With GatlingKnoldus Inc.
 
The benefits of running Spark on your own Docker
The benefits of running Spark on your own DockerThe benefits of running Spark on your own Docker
The benefits of running Spark on your own DockerItai Yaffe
 
Elephant grooming: quality with Hadoop
Elephant grooming: quality with HadoopElephant grooming: quality with Hadoop
Elephant grooming: quality with HadoopRoman Nikitchenko
 
kranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadkranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadKrivoy Rog IT Community
 
Benchmarks, performance, scalability, and capacity what's behind the numbers
Benchmarks, performance, scalability, and capacity what's behind the numbersBenchmarks, performance, scalability, and capacity what's behind the numbers
Benchmarks, performance, scalability, and capacity what's behind the numbersJustin Dorfman
 
Benchmarks, performance, scalability, and capacity what s behind the numbers...
Benchmarks, performance, scalability, and capacity  what s behind the numbers...Benchmarks, performance, scalability, and capacity  what s behind the numbers...
Benchmarks, performance, scalability, and capacity what s behind the numbers...james tong
 
Improve the deployment process step by step
Improve the deployment process step by stepImprove the deployment process step by step
Improve the deployment process step by stepDaniel Fahlke
 
Anatomy of in memory processing in Spark
Anatomy of in memory processing in SparkAnatomy of in memory processing in Spark
Anatomy of in memory processing in Sparkdatamantra
 

Similar to The Story So Far with Ratpack: High Performance Java Web Framework (20)

Gatling - Bordeaux JUG
Gatling - Bordeaux JUGGatling - Bordeaux JUG
Gatling - Bordeaux JUG
 
Concurrency - Why it's hard ?
Concurrency - Why it's hard ?Concurrency - Why it's hard ?
Concurrency - Why it's hard ?
 
Why Concurrency is hard ?
Why Concurrency is hard ?Why Concurrency is hard ?
Why Concurrency is hard ?
 
Performance optimization techniques for Java code
Performance optimization techniques for Java codePerformance optimization techniques for Java code
Performance optimization techniques for Java code
 
The Bleeding Edge
The Bleeding EdgeThe Bleeding Edge
The Bleeding Edge
 
The Bleeding Edge
The Bleeding EdgeThe Bleeding Edge
The Bleeding Edge
 
Gatling
Gatling Gatling
Gatling
 
Performance Test Automation With Gatling
Performance Test Automation  With GatlingPerformance Test Automation  With Gatling
Performance Test Automation With Gatling
 
The benefits of running Spark on your own Docker
The benefits of running Spark on your own DockerThe benefits of running Spark on your own Docker
The benefits of running Spark on your own Docker
 
Gatling
GatlingGatling
Gatling
 
Elephant grooming: quality with Hadoop
Elephant grooming: quality with HadoopElephant grooming: quality with Hadoop
Elephant grooming: quality with Hadoop
 
Java concurrency
Java concurrencyJava concurrency
Java concurrency
 
kranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadkranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High load
 
Benchmarks, performance, scalability, and capacity what's behind the numbers
Benchmarks, performance, scalability, and capacity what's behind the numbersBenchmarks, performance, scalability, and capacity what's behind the numbers
Benchmarks, performance, scalability, and capacity what's behind the numbers
 
Benchmarks, performance, scalability, and capacity what s behind the numbers...
Benchmarks, performance, scalability, and capacity  what s behind the numbers...Benchmarks, performance, scalability, and capacity  what s behind the numbers...
Benchmarks, performance, scalability, and capacity what s behind the numbers...
 
Netty training
Netty trainingNetty training
Netty training
 
Improve the deployment process step by step
Improve the deployment process step by stepImprove the deployment process step by step
Improve the deployment process step by step
 
Anatomy of in memory processing in Spark
Anatomy of in memory processing in SparkAnatomy of in memory processing in Spark
Anatomy of in memory processing in Spark
 
Netty training
Netty trainingNetty training
Netty training
 
Play Framework
Play FrameworkPlay Framework
Play Framework
 

Recently uploaded

Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingShane Coughlan
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsJean Silva
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shardsChristopher Curtin
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...OnePlan Solutions
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingShane Coughlan
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonApplitools
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxRTS corp
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesKrzysztofKkol1
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 

Recently uploaded (20)

Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero results
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 

The Story So Far with Ratpack: High Performance Java Web Framework

  • 1. Ratpack The story so far Phill Barber - Team Thor - Team Cirrus - Energized Work
  • 2. Agenda ● What is Ratpack? ● Why did we decide to use it? ● A look at the code. ● Mistakes you can make. ● Issues we currently face. ● Retrospective.
  • 4. What is ratpack? ● A high performance Java web framework. ● Asynchronous and non-blocking model. ● Aims to make asynchronous programming on the JVM easier. ● Built on Java 8 and Netty. ● Currently at version 1.1.1
  • 5. What is ratpack? (continued) Assuming your application is I/O bound, it offers the following benefits: ● High throughput ● Low CPU usage ● Lower Memory usage (due to less threads) All of these benefits are due to its threading model and using non blocking I/O
  • 7. Asynchronous - Non Blocking I/O
  • 8. What is ratpack? (continued) This efficiency comes with the cost of increased complexity. ● Steep learning curve. ● Easy to get wrong. ● Hard to debug.
  • 9. Ratpack misconceptions ● Asynchronicity is internal only! ○ It’s just a web server. ○ It takes time to respond to http requests. ● Doesn’t improve latency. ○ If a downstream call takes 500ms, ratpack will take > 500ms to respond. ● If you are using Ratpack - it doesn’t mean your system will necessarily perform any better. ○ You can make it perform worse!
  • 10. Why did we decide to use it?
  • 13. Ratpack vs Dropwizard - Load profiles Three load profiles were given to each application as detailed below: 1. 5 minute duration, 100 JMeter Threads 2. 5 minute duration, 200 JMeter Threads 3. 5 minute duration, 300 JMeter Threads
  • 18. Why did we decide to use it? ● We will be I/O bound. ● We will be at high load. ● Ratpack vs Dropwizard Performance Test revealed encouraging stats. ● We had a sense of optimism that we’d pick up the async challenges.
  • 19. A look at the code
  • 20. A look at the code - Overview ● Runnable Jar. ● main() method starts the server. ○ Simple and easy to start for testing. ● URIs mapped to Handlers. ● Execution model deals with Promises. ● We decided to use Rx Java in “service” layer and use Observables.
  • 21. A look at the code ● Happy path example.
  • 22. A look at the code ● Happy path example. ● High throughput example.
  • 23. A look at the code ● Happy path example. ● High throughput example. ● Deterministic demonstration.
  • 24. Mistakes you can make ...BIG BIG mistakes!
  • 25. Mistakes - Two Types 1. Dangerous mistakes. 2. Annoying mistakes.
  • 26. Dangerous mistakes ● Calling a blocking method. ○ So many ways to do this. IMPACT: ?
  • 27. Dangerous mistakes ● Making new Threads IMPACT: Memory & CPU increase -> Ultimately low throughput
  • 28. Annoying mistakes ● Not understanding execution model. ○ Not using Promises when you should.
  • 29. Annoying mistakes ● Messing up Threads ○ Using Cassandra thread to call Cassandra. ○ Happened to us whilst implementing ListenableFuture
  • 31. Issues (continued) ● Ratpack http client does not use a connection pool. ● AppDynamics integration still ongoing.
  • 32. Issues Performance related issue: At load, 1 in 1000 requests would not get a response. ● Hard to debug ● Thread dumps revealed that (big surprise) nothing was blocking. Where do you go from here? Now Resolved ● Was actually an issue related to secretly running in Development mode. InteliJ IDEA ○ Issue #909
  • 34. Retro / Assorted notes... ● It was harder than we expected. ● It took longer than expected to get up to speed. ● Rx bought us flexibility but introduced an extra learning curve. ● Cost vs Reward analysis is difficult but would have been a benefit. ● Monitoring our CPU and Memory usage is key to realising the benefit. ● Confidence is improving day by day… BUT… ● Still not proven - We’re not live yet!
  • 35. Thanks! Questions? More info: http://phillbarber.blogspot.co.uk/ Code: https://github.com/phillbarber/ratpack-demo