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 Ratpack the story so far

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 Ratpack the story so far (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

03.2024_North America VMUG Optimizing RevOps using the power of ChatGPT in Ma...
03.2024_North America VMUG Optimizing RevOps using the power of ChatGPT in Ma...03.2024_North America VMUG Optimizing RevOps using the power of ChatGPT in Ma...
03.2024_North America VMUG Optimizing RevOps using the power of ChatGPT in Ma...jackiepotts6
 
Revolutionize Your Field Service Management with FSM Grid
Revolutionize Your Field Service Management with FSM GridRevolutionize Your Field Service Management with FSM Grid
Revolutionize Your Field Service Management with FSM GridMathew Thomas
 
8 Steps to Build a LangChain RAG Chatbot.
8 Steps to Build a LangChain RAG Chatbot.8 Steps to Build a LangChain RAG Chatbot.
8 Steps to Build a LangChain RAG Chatbot.Ritesh Kanjee
 
CYBER SECURITY AND CYBER CRIME COMPLETE GUIDE.pLptx
CYBER SECURITY AND CYBER CRIME COMPLETE GUIDE.pLptxCYBER SECURITY AND CYBER CRIME COMPLETE GUIDE.pLptx
CYBER SECURITY AND CYBER CRIME COMPLETE GUIDE.pLptxBarakaMuyengi
 
openEuler Community Overview - a presentation showing the current scale
openEuler Community Overview - a presentation showing the current scaleopenEuler Community Overview - a presentation showing the current scale
openEuler Community Overview - a presentation showing the current scaleShane Coughlan
 
Mobile App Development process | Expert Tips
Mobile App Development process | Expert TipsMobile App Development process | Expert Tips
Mobile App Development process | Expert Tipsmichealwillson701
 
Telebu Social -Whatsapp Business API : Mastering Omnichannel Business Communi...
Telebu Social -Whatsapp Business API : Mastering Omnichannel Business Communi...Telebu Social -Whatsapp Business API : Mastering Omnichannel Business Communi...
Telebu Social -Whatsapp Business API : Mastering Omnichannel Business Communi...telebusocialmarketin
 
Large Scale Architecture -- The Unreasonable Effectiveness of Simplicity
Large Scale Architecture -- The Unreasonable Effectiveness of SimplicityLarge Scale Architecture -- The Unreasonable Effectiveness of Simplicity
Large Scale Architecture -- The Unreasonable Effectiveness of SimplicityRandy Shoup
 
If your code could speak, what would it tell you? Let GitHub Copilot Chat hel...
If your code could speak, what would it tell you? Let GitHub Copilot Chat hel...If your code could speak, what would it tell you? Let GitHub Copilot Chat hel...
If your code could speak, what would it tell you? Let GitHub Copilot Chat hel...Maxim Salnikov
 
Enterprise Content Managements Solutions
Enterprise Content Managements SolutionsEnterprise Content Managements Solutions
Enterprise Content Managements SolutionsIQBG inc
 
MUT4SLX: Extensions for Mutation Testing of Stateflow Models
MUT4SLX: Extensions for Mutation Testing of Stateflow ModelsMUT4SLX: Extensions for Mutation Testing of Stateflow Models
MUT4SLX: Extensions for Mutation Testing of Stateflow ModelsUniversity of Antwerp
 
User Experience Designer | Kaylee Miller Resume
User Experience Designer | Kaylee Miller ResumeUser Experience Designer | Kaylee Miller Resume
User Experience Designer | Kaylee Miller ResumeKaylee Miller
 
Unlocking the Power of IoT: A comprehensive approach to real-time insights
Unlocking the Power of IoT: A comprehensive approach to real-time insightsUnlocking the Power of IoT: A comprehensive approach to real-time insights
Unlocking the Power of IoT: A comprehensive approach to real-time insightsconfluent
 
renewable energy renewable energy renewable energy renewable energy
renewable energy renewable energy renewable energy  renewable energyrenewable energy renewable energy renewable energy  renewable energy
renewable energy renewable energy renewable energy renewable energyjeyasrig
 
MinionLabs_Mr. Gokul Srinivas_Young Entrepreneur
MinionLabs_Mr. Gokul Srinivas_Young EntrepreneurMinionLabs_Mr. Gokul Srinivas_Young Entrepreneur
MinionLabs_Mr. Gokul Srinivas_Young EntrepreneurPriyadarshini T
 
Flutter the Future of Mobile App Development - 5 Crucial Reasons.pdf
Flutter the Future of Mobile App Development - 5 Crucial Reasons.pdfFlutter the Future of Mobile App Development - 5 Crucial Reasons.pdf
Flutter the Future of Mobile App Development - 5 Crucial Reasons.pdfMind IT Systems
 
Boost Efficiency: Sabre API Integration Made Easy
Boost Efficiency: Sabre API Integration Made EasyBoost Efficiency: Sabre API Integration Made Easy
Boost Efficiency: Sabre API Integration Made Easymichealwillson701
 
Mobile App Development company Houston
Mobile  App  Development  company HoustonMobile  App  Development  company Houston
Mobile App Development company Houstonjennysmithusa549
 
BusinessGPT - SECURITY AND GOVERNANCE FOR GENERATIVE AI.pptx
BusinessGPT  - SECURITY AND GOVERNANCE  FOR GENERATIVE AI.pptxBusinessGPT  - SECURITY AND GOVERNANCE  FOR GENERATIVE AI.pptx
BusinessGPT - SECURITY AND GOVERNANCE FOR GENERATIVE AI.pptxAGATSoftware
 

Recently uploaded (20)

03.2024_North America VMUG Optimizing RevOps using the power of ChatGPT in Ma...
03.2024_North America VMUG Optimizing RevOps using the power of ChatGPT in Ma...03.2024_North America VMUG Optimizing RevOps using the power of ChatGPT in Ma...
03.2024_North America VMUG Optimizing RevOps using the power of ChatGPT in Ma...
 
Revolutionize Your Field Service Management with FSM Grid
Revolutionize Your Field Service Management with FSM GridRevolutionize Your Field Service Management with FSM Grid
Revolutionize Your Field Service Management with FSM Grid
 
8 Steps to Build a LangChain RAG Chatbot.
8 Steps to Build a LangChain RAG Chatbot.8 Steps to Build a LangChain RAG Chatbot.
8 Steps to Build a LangChain RAG Chatbot.
 
CYBER SECURITY AND CYBER CRIME COMPLETE GUIDE.pLptx
CYBER SECURITY AND CYBER CRIME COMPLETE GUIDE.pLptxCYBER SECURITY AND CYBER CRIME COMPLETE GUIDE.pLptx
CYBER SECURITY AND CYBER CRIME COMPLETE GUIDE.pLptx
 
openEuler Community Overview - a presentation showing the current scale
openEuler Community Overview - a presentation showing the current scaleopenEuler Community Overview - a presentation showing the current scale
openEuler Community Overview - a presentation showing the current scale
 
20140812 - OBD2 Solution
20140812 - OBD2 Solution20140812 - OBD2 Solution
20140812 - OBD2 Solution
 
Mobile App Development process | Expert Tips
Mobile App Development process | Expert TipsMobile App Development process | Expert Tips
Mobile App Development process | Expert Tips
 
Telebu Social -Whatsapp Business API : Mastering Omnichannel Business Communi...
Telebu Social -Whatsapp Business API : Mastering Omnichannel Business Communi...Telebu Social -Whatsapp Business API : Mastering Omnichannel Business Communi...
Telebu Social -Whatsapp Business API : Mastering Omnichannel Business Communi...
 
Large Scale Architecture -- The Unreasonable Effectiveness of Simplicity
Large Scale Architecture -- The Unreasonable Effectiveness of SimplicityLarge Scale Architecture -- The Unreasonable Effectiveness of Simplicity
Large Scale Architecture -- The Unreasonable Effectiveness of Simplicity
 
If your code could speak, what would it tell you? Let GitHub Copilot Chat hel...
If your code could speak, what would it tell you? Let GitHub Copilot Chat hel...If your code could speak, what would it tell you? Let GitHub Copilot Chat hel...
If your code could speak, what would it tell you? Let GitHub Copilot Chat hel...
 
Enterprise Content Managements Solutions
Enterprise Content Managements SolutionsEnterprise Content Managements Solutions
Enterprise Content Managements Solutions
 
MUT4SLX: Extensions for Mutation Testing of Stateflow Models
MUT4SLX: Extensions for Mutation Testing of Stateflow ModelsMUT4SLX: Extensions for Mutation Testing of Stateflow Models
MUT4SLX: Extensions for Mutation Testing of Stateflow Models
 
User Experience Designer | Kaylee Miller Resume
User Experience Designer | Kaylee Miller ResumeUser Experience Designer | Kaylee Miller Resume
User Experience Designer | Kaylee Miller Resume
 
Unlocking the Power of IoT: A comprehensive approach to real-time insights
Unlocking the Power of IoT: A comprehensive approach to real-time insightsUnlocking the Power of IoT: A comprehensive approach to real-time insights
Unlocking the Power of IoT: A comprehensive approach to real-time insights
 
renewable energy renewable energy renewable energy renewable energy
renewable energy renewable energy renewable energy  renewable energyrenewable energy renewable energy renewable energy  renewable energy
renewable energy renewable energy renewable energy renewable energy
 
MinionLabs_Mr. Gokul Srinivas_Young Entrepreneur
MinionLabs_Mr. Gokul Srinivas_Young EntrepreneurMinionLabs_Mr. Gokul Srinivas_Young Entrepreneur
MinionLabs_Mr. Gokul Srinivas_Young Entrepreneur
 
Flutter the Future of Mobile App Development - 5 Crucial Reasons.pdf
Flutter the Future of Mobile App Development - 5 Crucial Reasons.pdfFlutter the Future of Mobile App Development - 5 Crucial Reasons.pdf
Flutter the Future of Mobile App Development - 5 Crucial Reasons.pdf
 
Boost Efficiency: Sabre API Integration Made Easy
Boost Efficiency: Sabre API Integration Made EasyBoost Efficiency: Sabre API Integration Made Easy
Boost Efficiency: Sabre API Integration Made Easy
 
Mobile App Development company Houston
Mobile  App  Development  company HoustonMobile  App  Development  company Houston
Mobile App Development company Houston
 
BusinessGPT - SECURITY AND GOVERNANCE FOR GENERATIVE AI.pptx
BusinessGPT  - SECURITY AND GOVERNANCE  FOR GENERATIVE AI.pptxBusinessGPT  - SECURITY AND GOVERNANCE  FOR GENERATIVE AI.pptx
BusinessGPT - SECURITY AND GOVERNANCE FOR GENERATIVE AI.pptx
 

Ratpack the story so far

  • 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