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

Fields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptxFields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptxJoão Esperancinha
 
20240319 Car Simulator Plan.pptx . Plan for a JavaScript Car Driving Simulator.
20240319 Car Simulator Plan.pptx . Plan for a JavaScript Car Driving Simulator.20240319 Car Simulator Plan.pptx . Plan for a JavaScript Car Driving Simulator.
20240319 Car Simulator Plan.pptx . Plan for a JavaScript Car Driving Simulator.Sharon Liu
 
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine HarmonyLeveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmonyelliciumsolutionspun
 
Streamlining Your Application Builds with Cloud Native Buildpacks
Streamlining Your Application Builds  with Cloud Native BuildpacksStreamlining Your Application Builds  with Cloud Native Buildpacks
Streamlining Your Application Builds with Cloud Native BuildpacksVish Abrams
 
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Jaydeep Chhasatia
 
Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsYour Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsJaydeep Chhasatia
 
eAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspectionseAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspectionsNirav Modi
 
Generative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilGenerative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilVICTOR MAESTRE RAMIREZ
 
OpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS CalculatorOpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS CalculatorShane Coughlan
 
Webinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.pptWebinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.pptkinjal48
 
IA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeIA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeNeo4j
 
ERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptxERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptxAutus Cyber Tech
 
Deep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampDeep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampVICTOR MAESTRE RAMIREZ
 
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...OnePlan Solutions
 
Top Software Development Trends in 2024
Top Software Development Trends in  2024Top Software Development Trends in  2024
Top Software Development Trends in 2024Mind IT Systems
 
online pdf editor software solutions.pdf
online pdf editor software solutions.pdfonline pdf editor software solutions.pdf
online pdf editor software solutions.pdfMeon Technology
 
Cybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadCybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadIvo Andreev
 
Enterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze IncEnterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze Incrobinwilliams8624
 
Kawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in TrivandrumKawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in TrivandrumKawika Technologies
 
Introduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntroduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntelliSource Technologies
 

Recently uploaded (20)

Fields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptxFields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptx
 
20240319 Car Simulator Plan.pptx . Plan for a JavaScript Car Driving Simulator.
20240319 Car Simulator Plan.pptx . Plan for a JavaScript Car Driving Simulator.20240319 Car Simulator Plan.pptx . Plan for a JavaScript Car Driving Simulator.
20240319 Car Simulator Plan.pptx . Plan for a JavaScript Car Driving Simulator.
 
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine HarmonyLeveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
 
Streamlining Your Application Builds with Cloud Native Buildpacks
Streamlining Your Application Builds  with Cloud Native BuildpacksStreamlining Your Application Builds  with Cloud Native Buildpacks
Streamlining Your Application Builds with Cloud Native Buildpacks
 
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
 
Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsYour Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
 
eAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspectionseAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspections
 
Generative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilGenerative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-Council
 
OpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS CalculatorOpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS Calculator
 
Webinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.pptWebinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.ppt
 
IA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeIA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG time
 
ERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptxERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptx
 
Deep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampDeep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - Datacamp
 
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
 
Top Software Development Trends in 2024
Top Software Development Trends in  2024Top Software Development Trends in  2024
Top Software Development Trends in 2024
 
online pdf editor software solutions.pdf
online pdf editor software solutions.pdfonline pdf editor software solutions.pdf
online pdf editor software solutions.pdf
 
Cybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadCybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and Bad
 
Enterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze IncEnterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze Inc
 
Kawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in TrivandrumKawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in Trivandrum
 
Introduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntroduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.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