s u p e r s o n i c s u b a t o m i c j a v a s u p e r s
play

S U P E R S O N I C . S U B A T O M I C . J A V A . S U P E R S O - PowerPoint PPT Presentation

S U P E R S O N I C . S U B A T O M I C . J A V A . S U P E R S O N I C . S U B A T O M I C . J A V A . @SanneGrinovero L O N G R U N N I N G S E R V E R , L O N G R U N N I N G S E R V E R , P E R F O R M A N C E P E R F O R M A N C E


  1. S U P E R S O N I C . S U B A T O M I C . J A V A . S U P E R S O N I C . S U B A T O M I C . J A V A . @SanneGrinovero

  2. L O N G R U N N I N G S E R V E R , L O N G R U N N I N G S E R V E R , P E R F O R M A N C E P E R F O R M A N C E

  3. W H A T I F . . . C O N T I N U O U S W H A T I F . . . C O N T I N U O U S D E L I V E R Y D E L I V E R Y

  4. B L A C K F R I D A Y : O U R B L A C K F R I D A Y : O U R W O R S T N I G H T M A R E ? W O R S T N I G H T M A R E ?

  5. W E H A V E A P R O B L E M ? W E H A V E A P R O B L E M ? Long warmup times are no longer acceptable

  6. E N E M I E S O F S L O W E N E M I E S O F S L O W S T A R T U P S T A R T U P • Continuous Delivery • Elasticity, scale on cloud: trends, people, reality

  7. I ' M S A N N E G R I N O V E R O I ' M S A N N E G R I N O V E R O Dutch, Italian, living in London. • Red Hat, middleware engineering R&D ▪ Hibernate team lead ▪ Quarkus, founding team member ▪ Architect, Sr. Principal Software Engineer ▪ • Passionate about all OSS, Java & performance

  8. S U P E R S O N I C ? S U P E R S O N I C ? • FAST BOOT is now essential • How Quarkus achieves it

  9. S U B A T O M I C ? S U B A T O M I C ? • LOW MEMORY, high density • How Quarkus achieves it

  10. J A V A ? J A V A ? • Enable use of existing know-how • Leverage all great existing libraries • And yet enable strong innovation

  11. W H A T I S Q U A R K U S W H A T I S Q U A R K U S

  12. T O O L K I T T O O L K I T and F R A M E W O R K F R A M E W O R K for writing Java applications

  13. L I G H T , C L O U D F R I E N D L Y , L I G H T , C L O U D F R I E N D L Y , D E S I G N E D F O R G R A A L V M D E S I G N E D F O R G R A A L V M Helps overcome limitations of GraalVM

  14. L I G H T , C L O U D F R I E N D L Y , L I G H T , C L O U D F R I E N D L Y , D E S I G N E D F O R G R A A L V M D E S I G N E D F O R G R A A L V M Helps overcome limitations of GraalVM Embrace these limitations, we love them!

  15. *.class QUARKUS Maven/Gradle plugin optimized jar JVM native executable

  16. E X T E N S I O N S E X T E N S I O N S For each Java framework, a Quarkus extension Makes it compatible with GraalVM native-images And makes it much lighter to run on JVM

  17. L I B R A R I E S Y O U A L R E A D Y K N O W L I B R A R I E S Y O U A L R E A D Y K N O W ECLIPSE VERT.X HIBERNATE RESTEASY APACHE CAMEL NETTY KUBERNETES JAEGER PROMETHEUS APACHE KAFKA INFINISPAN

  18. Unifies I M P E R A T I V E I M P E R A T I V E and R E A C T I V E R E A C T I V E @Inject @Inject @Stream("kafka") SayService say; Publisher<String> reactiveSay @GET @GET @Produces(MediaType.TEXT_PLAIN) @Produces(MediaType.SERVER_SEN public String hello() { public Publisher<String> stre return say.hello(); return reactiveSay; } }

  19. C O N T A I N E R F I R S T C O N T A I N E R F I R S T

  20. C O N T A I N E R F I R S T C O N T A I N E R F I R S T 💿 Small size on disk Small container images ✓

  21. C O N T A I N E R F I R S T C O N T A I N E R F I R S T 💿 Small size on disk Small container images ✓ 🚁 Fast boot time Instant scale up ✓

  22. C O N T A I N E R F I R S T C O N T A I N E R F I R S T 💿 Small size on disk Small container images ✓ 🚁 Fast boot time Instant scale up ✓ 🔭 Low RSS 1 memory More containers with ✓ the same RAM 1) Resident Set Size

  23. M E A S U R I N G M E M O R Y M E A S U R I N G M E M O R Y RSS = all actual RAM consumed by the process There's more than heap sizes! $ ps -o pid,rss,command -p $(pgrep quarkus) PID RSS COMMAND 11229 12628 ./target/quarkus-hello java -XX:MaxRAM=50m -Xmx15m -Xss228k -jar app.jar See also: developers.redhat.com/blog/2017/04/04/openjdk- and-containers/

  24. M E M O R Y ( R S S ) M E M O R Y ( R S S ) Quarkus + GraalVM Quarkus + OpenJDK Best of traditio

  25. M E M O R Y ( R S S ) M E M O R Y ( R S S ) Quarkus + GraalVM Quarkus + OpenJDK Best of traditio REST 13 MB 74 MB 140 M REST 13 MB 74 MB 140 M

  26. M E M O R Y ( R S S ) M E M O R Y ( R S S ) Quarkus + GraalVM Quarkus + OpenJDK Best of traditio REST 13 MB 74 MB 140 M REST 13 MB 74 MB 140 M REST+JPA 35 MB 130 MB 218 M REST+JPA 35 MB 130 MB 218 M

  27. S T A R T U P T I M E S T A R T U P T I M E Often frameworks use lazy initialization "started" reported too early

  28. S T A R T U P T I M E S T A R T U P T I M E Often frameworks use lazy initialization "started" reported too early Measure time to first request

  29. T I M E T O F I R S T R E Q U E S T T I M E T O F I R S T R E Q U E S T s + GraalVM 0.014 sec Quarkus + OpenJDK 0.75 sec Traditional Cloud-Native Stack 4.3 sec

  30. T I M E T O F I R S T R E Q U E S T T I M E T O F I R S T R E Q U E S T s + GraalVM 0.014 sec Quarkus + OpenJDK 0.75 sec Traditional Cloud-Native Stack 4.3 sec JPA & DB operations s + GraalVM 0.055 sec Quarkus + OpenJDK 2.5 sec Traditional Cloud-Native Stack

  31. S H O W U S ? S H O W U S ?

  32. Show me! REST / CRUD demo

  33. H O W I T W O R K S H O W I T W O R K S

  34. H O W A T R A D I T I O N A L H O W A T R A D I T I O N A L S T A C K W O R K S S T A C K W O R K S

  35. H O W A T R A D I T I O N A L H O W A T R A D I T I O N A L S T A C K W O R K S S T A C K W O R K S

  36. H O W A T R A D I T I O N A L H O W A T R A D I T I O N A L S T A C K W O R K S S T A C K W O R K S

  37. H O W A T R A D I T I O N A L H O W A T R A D I T I O N A L S T A C K W O R K S S T A C K W O R K S

  38. H O W A T R A D I T I O N A L H O W A T R A D I T I O N A L S T A C K W O R K S S T A C K W O R K S

  39. H O W A T R A D I T I O N A L H O W A T R A D I T I O N A L S T A C K W O R K S S T A C K W O R K S

  40. T H E O V E R H E A D I S H I G H T H E O V E R H E A D I S H I G H

  41. P A Y F O R I T P A Y F O R I T N T I M E S T I M E S

  42. W H I L E I N Q U A R K U S : W H I L E I N Q U A R K U S : B U I L D T I M E B O O T B U I L D T I M E B O O T As much work as possible done at build time Output: recorded wiring bytecode Heap & state can be captured by the GraalVM native-image compiler

  43. W H I L E I N Q U A R K U S W H I L E I N Q U A R K U S

  44. E X T E N S I O N S M O D E L E X T E N S I O N S M O D E L • Each framework/library needs an extension to apply these benefits • Can physically avoid shipping some bootstrap- preparation only code • Is Quarkus a meta-build tool?

  45. E X T E N S I O N S M O D E L E X T E N S I O N S M O D E L Can physically avoid shipping some code

  46. J A N D E X J A N D E X High performance classpath scanner & indexer: avoids any class initialization

  47. A R C A R C CDI based dependency injection, at build time

  48. G I Z M O G I Z M O Bytecode generation library, used by extensions to generate all infrastructure

  49. D E S I G N C O N S E Q U E N C E S D E S I G N C O N S E Q U E N C E S • Less classes are loaded • Can physically avoid shipping some bootstrap- preparation only code • Overhead not repeated on each container boot • Far easier to get working in GraalVM native images - and better optimised code!

  50. C o r e + E x t e n s i o n s C o r e + E x t e n s i o n s

  51. D E V E L O P E R ' S J O Y ? D E V E L O P E R ' S J O Y ?

  52. Show me! Demo #2

  53. Q U A R K U S E X T E N S I O N S Q U A R K U S E X T E N S I O N S • Required for frameworks that hit GraalVM limitations • Opportunity to highly optimise also for JVM • Code strictly separates build time analysis and runtime: extremely lean output!

  54. W H A T C A N A N W H A T C A N A N E X T E N S I O N D O ? E X T E N S I O N D O ? Invoke Quarkus helpers to dynamically • Interact with the GraalVM compiler needs • Generate "Bootstrap at build" initializers • Much much more... and evolving

  55. S O , W H E R E ' S T H E S O , W H E R E ' S T H E C A T C H ? C A T C H ?

  56. N O P E R F O R M A N C E N O P E R F O R M A N C E C O M P R O M I S E S C O M P R O M I S E S

  57. &

  58. A o T c o m p i l a t i o n w i t h G r a a l V M A o T c o m p i l a t i o n w i t h G r a a l V M JDK API Application SubstrateVM classes classes classes Staticaly linked executable

  59. A o T c o m p i l a t i o n w i t h G r a a l V M A o T c o m p i l a t i o n w i t h G r a a l V M • Static analysis • Closed world assumption • Aggressive dead code elimination

  60. L I M I T A T I O N S L I M I T A T I O N S O F G R A A L V M N A T I V E O F G R A A L V M N A T I V E I M A G E S I M A G E S

  61. D Y N A M I C C L A S S L O A D I N G D Y N A M I C C L A S S L O A D I N G

  62. D Y N A M I C C L A S S L O A D I N G D Y N A M I C C L A S S L O A D I N G Deloying jars, wars, etc. at runtime impossible

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend