SlideShare ist ein Scribd-Unternehmen logo
1 Part of
Make Java Great Again
Quarkus, GraalVM und co
Michael Frembs, Senior Consultant API & Cloud native – München, 25. Juli 2019
2 Part of
3 Part of
4 Part of
 WLP 19.0.0.6 WebProfile
 ~ 5s
 Wildfly 17.0.1 Servlet-Only
 ~ 3s
 Spring Boot 2.1.6.RELEASE mit Spring Web Starter
 ~ 3s
 + WarmUp HotSpot-Engine
Startzeit
5 Part of
 WLP 19.0.0.6 WebProfile
 verwendet ca. 220 MB
 Wildfly 17.0.1 Servlet-Only
 verwendet ca. 180 MB
 Spring Boot 2.1.6.RELEASE mit Spring Web Starter
 verwendet ca. 230 MB
Arbeitsspeicher
6 Part of
Ist das ein Problem?
App A
App B
App C
App A
App B
App C
App A
App B
App C
App B
App C App C
7 Part of
Ist das ein Problem?
App A App A1 App A2 App A3
8 Part of
Ist das ein Problem?
https://cloud.google.com/compute/pricing
9 Part of
Ist das ein Problem?
https://cloud.ibm.com/kubernetes/catalog/cluster
10 Part of
Ist das ein Problem?
https://run.pivotal.io/pricing/
11 Part of
 Wohin geht die Zukunft?
 Function as a Service / Serverless
 IoT
 Long running processes?
 Cattle vs. Pets
 Automatische Skalierung
Ist das ein Problem?
12 Part of
13 Part of
 Open Source Cloud Native, Container first framework for Java
 Apache License v2.0
 Ziel: Minimaler Footprint
 Setzt auf Standards (Microprofile) und Frameworks, die sich bereits bewiesen haben
 Baut auf GraalVM auf
 Est. März 2019
 https://quarkus.io
https://github.com/quarkusio/quarkus
Quarkus
!
14 Part of
The goal of Quarkus is to make Java a leading
platform in Kubernetes and serverless
environments while offering developers a
unified reactive and imperative programming
model to optimally address a wider range of
distributed application architectures.
https://developers.redhat.com/blog/2019/03/07/quarkus-next-generation-kubernetes-native-java-framework/
Jason Greene
Quarkus Co-Founder, Distinguished
Engineer and Manager, Red Hat
15 Part of
Native Image
JVM Mode
Quarkus: JVM Mode vs. Native Image
Todo-Service
todo-runner.jar
todo-runner
SubstrateVM
16 Part of
17 Part of
Quarkus – Startzeit und Speicherverbrauch (eigene Angabe)
https://quarkus.io/
18 Part of
0
1
2
3
4
5
6
7
8
Startzeit [s]
Liberty
Quarkus
JVM
Quarkus
Native
Startzeit
 Ausführung inkl. Starten eines Docker-Containers
 Aufruf mit Zugriff auf die Datenbank
 2 fache Ausführung, Mittelwert
 Zeit bis Beantwortung des 1. Requests
 Messung analog zu
https://quarkus.io/guides/performance-
measure#how-do-we-measure-startup-time
19 Part of
0
20
40
60
80
100
120
140
160
Memory Usage
[mb]
Liberty
Quarkus
JVM
Quarkus
Native
RAM-Verbrauch
 Anwendungen in Docker-Container gestartet
 Mind. 1 Request pro Anwendung (inkl. Zugriff auf
Datenbank)
 docker stats -a
20 Part of
0
50
100
150
200
250
300
350
400
450
Docker-Image-
Size [mb]
Liberty
Quarkus
JVM
Quarkus
Native
Docker-Image-Size
 Für WLP wurde das offizielle Image genommen
 https://hub.docker.com/_/websphere-liberty/
 Kernel
 Für Quarkus wurden die mitgelieferten Dockerfiles
verwendet
 Es wurde nicht weiter optimiert
21 Part of
Quarkus Module
Quarkus Extensions
Quarkus Core
Jandex Gizmo Graal SDK
JVM Substrate
22 Part of
 Runtime -> Buildtime
 Verzicht auf Reflection so gut es geht
 Recorded Bytecode
 Kein Config Parsen zur Laufzeit
 Metadata Processing (Annotations, Getter & Setter)
 Aufrufe vorbereiten (Proxy, Interfaces, …)
 Unnötige Klassen werden nicht geladen
23 Part of
GraalVM is a Java VM and JDK based on
HotSpot/OpenJDK, implemented in Java. It supports
additional programming languages and execution
modes, like ahead-of-time compilation of Java
applications for fast startup and low memory footprint.
GraalVM
https://en.wikipedia.org/wiki/GraalVM
24 Part of
 Edition
 GraalVM CE (OpenSource, GPLv2 License)
 GraalVM EE
 Production Ready seit Mai 2019 (Version 19.0)
 Unterstützt Linux und MacOS (an Windows wird gearbeitet)
 Contributors
 Industrie
 Forschung (Ausschnitt)
Johannes Kepler University Linz, TU Berlin, University of Edinburgh, TU Dortmund, University of Lugano
 https://www.graalvm.org/community/contributors/
GraalVM
!
25 Part of
 AoT – Compiler (Ahead of Time)
 Closed World Assumption
 Output: Native Executable
 Kein Bytecode mehr!
 Analyse, welche Klassen erreicht werden
können
 Vorsicht vor Reflection!
 Programm wird während Build-Prozess
ausgeführt
 Image Heap
 Static Initializer
Native Image
26 Part of
 Dynamic Class Loading nicht möglich
 Reflection eingeschränkt möglich
 Dynamic Proxy eingeschränkt möglich
 JNI & Unsafe Memory Access „mostly
supported“
 JMX nicht möglich
 https://github.com/oracle/graal/blob/master/s
ubstratevm/LIMITATIONS.md
Limitations Native Image
27 Part of
 Native Image: Optimierung RAM & Boot-Time
 Long running processes?
 JIT nur im JVM Mode
 Performance bzgl.
 Durchsatz?
 Antwortzeiten?
 Skalierung?
Native Image vs. JVM Mode
28 Part of
https://quarkus.io/blog/runtime-performance/
Durchsatz
29 Part of
https://quarkus.io/blog/runtime-performance/
Antwortzeiten – Durchschnitt
30 Part of
 Für Migrationsprojekte
 u.a. kein EJB und JMS support
 Einschränkung der Libraries! (siehe Limitations)
 Buildprozess (Native Image)
 Infrastruktur muss während des Builds vorhanden sein
 Benötigt viel Arbeitsspeicher
 Benötigt Zeit
Zu beachten
31 Part of
32 Part of
Microprofile
Konkurrenz zu Quarkus
GraalVM
Quarkus Helidon MP Helidon SE Micronaut Spring Boot
33 Part of
Konkurrenz zu Quarkus
https://www.graalvm.org/docs/why-graal/
34 Part of
Konkurrenz zu Quarkus
https://www.graalvm.org/docs/why-graal/
35 Part of
 Just In Time (JIT) – Compiler benötigen CPU-Zyklen und
Speicher
 Greifen v.a. bei langlaufenden Prozessen
JIT-Compiler
App C
JIT
App C
JIT
App C
JIT
36 Part of
Konkurrenz zu GraalVM: JITaaS by OpenJ9
App C
JIT
App C
JIT
App C
JIT
JIT
JIT as a Service
https://github.com/eclipse/openj9/tree/jitaas
37 Part of
Software Engineering ist eine Kunst.
Sie erfordert die Tugenden eines Ingenieurs.

Weitere ähnliche Inhalte

PDF
Eine Stunde was mit Api First!
PDF
Deployment 2.0
PDF
Technische Gründe für schlechte Entwicklungsperformance
PDF
Quarkus Quickstart
PDF
Compilers Everywhere
PPT
Entwicklungsprozess und Arbeit mit Symfony2 in der fotocommunity GmbH
PDF
Jenkins Acceleration
PDF
Making the internet faster HTTP/3 und QUIC
Eine Stunde was mit Api First!
Deployment 2.0
Technische Gründe für schlechte Entwicklungsperformance
Quarkus Quickstart
Compilers Everywhere
Entwicklungsprozess und Arbeit mit Symfony2 in der fotocommunity GmbH
Jenkins Acceleration
Making the internet faster HTTP/3 und QUIC

Was ist angesagt? (14)

PPTX
Continuous Delivery
PDF
OpenShift-Build-Pipelines: Build ► Test ► Run!
PPTX
Punkt.de – Layout-Testing: was geht, was bringt´s, wer braucht´s?
PDF
Title is loading ... Cache is cold.
PDF
Kontinuierliches (Nicht)-Funktionales Testen von Microservices auf K8s
PDF
Continuous Testing: Integration- und UI-Testing mit OpenShift-Build-Pipelines
PDF
Kubernetes ist so viel mehr als ein Container Orchestrierer
PDF
Magento 2 Zertifizierung - Wissenswertes und ein paar Tipps
PPTX
Source2Image - Vom Code zum fertigen Image mit einer Build-Chain basierend au...
PDF
Was ist Docker ?
PDF
Deployment von Entwicklungsumgebungen eines TYPO3-Intranets mit Vagrant
PDF
Cloud Native und Java EE: Freund oder Feind?
PDF
Ant Maven
PDF
Continuous Delivery für Cloud-native Anwendungen auf Cloud-nativer Infrastruktur
Continuous Delivery
OpenShift-Build-Pipelines: Build ► Test ► Run!
Punkt.de – Layout-Testing: was geht, was bringt´s, wer braucht´s?
Title is loading ... Cache is cold.
Kontinuierliches (Nicht)-Funktionales Testen von Microservices auf K8s
Continuous Testing: Integration- und UI-Testing mit OpenShift-Build-Pipelines
Kubernetes ist so viel mehr als ein Container Orchestrierer
Magento 2 Zertifizierung - Wissenswertes und ein paar Tipps
Source2Image - Vom Code zum fertigen Image mit einer Build-Chain basierend au...
Was ist Docker ?
Deployment von Entwicklungsumgebungen eines TYPO3-Intranets mit Vagrant
Cloud Native und Java EE: Freund oder Feind?
Ant Maven
Continuous Delivery für Cloud-native Anwendungen auf Cloud-nativer Infrastruktur
Anzeige

Ähnlich wie Quarkus, GraalVM und co. Java in der Cloud-Native Welt (20)

PDF
Cloud-native and Enterprise Java? Hold my beer!
PPTX
Vagrant, Puppet, Docker für Entwickler und Architekten
PDF
Supersonic Java für die Cloud: Quarkus
ODP
Jalimo Slides Linuxtag2007
PDF
Java Flight Recorder Javamagazin May 2017
PDF
Vortragsreihe Dortmund: Unified Development Environments
PPTX
130605 buildfrei skalieren_fuer_bigdata
PPTX
Vaadin - Yet another Java Web Framework? (Google DevFest Karlsruhe 2012)
PDF
JEE und Micro – kein Widerspruch!
PDF
Best Practices für TDD in JavaScript
PDF
Steinzeit war gestern! Wege der Cloud-nativen Evolution.
PDF
Java EE Microservices ohne Server
PDF
Dataservices - Data Processing mit Microservices
PPTX
Dev ops testautomatisierer bei Technosoft
PDF
Chaos Kata Fitnesstraining für DevOps Teams
PDF
JAX 2015 - Continuous Integration mit Java & Javascript
PPT
Introduction to JEE
PDF
Docker Workshop Experten Forum Stuttgart 2015, Agile Methoden GmbH
PPTX
Automatischer Build mit Maven - OPITZ CONSULTING - Stefan Scheidt
PDF
Klappe auf! Was macht die JVM denn da? [Ger]
Cloud-native and Enterprise Java? Hold my beer!
Vagrant, Puppet, Docker für Entwickler und Architekten
Supersonic Java für die Cloud: Quarkus
Jalimo Slides Linuxtag2007
Java Flight Recorder Javamagazin May 2017
Vortragsreihe Dortmund: Unified Development Environments
130605 buildfrei skalieren_fuer_bigdata
Vaadin - Yet another Java Web Framework? (Google DevFest Karlsruhe 2012)
JEE und Micro – kein Widerspruch!
Best Practices für TDD in JavaScript
Steinzeit war gestern! Wege der Cloud-nativen Evolution.
Java EE Microservices ohne Server
Dataservices - Data Processing mit Microservices
Dev ops testautomatisierer bei Technosoft
Chaos Kata Fitnesstraining für DevOps Teams
JAX 2015 - Continuous Integration mit Java & Javascript
Introduction to JEE
Docker Workshop Experten Forum Stuttgart 2015, Agile Methoden GmbH
Automatischer Build mit Maven - OPITZ CONSULTING - Stefan Scheidt
Klappe auf! Was macht die JVM denn da? [Ger]
Anzeige

Quarkus, GraalVM und co. Java in der Cloud-Native Welt

  • 1. 1 Part of Make Java Great Again Quarkus, GraalVM und co Michael Frembs, Senior Consultant API & Cloud native – München, 25. Juli 2019
  • 4. 4 Part of  WLP 19.0.0.6 WebProfile  ~ 5s  Wildfly 17.0.1 Servlet-Only  ~ 3s  Spring Boot 2.1.6.RELEASE mit Spring Web Starter  ~ 3s  + WarmUp HotSpot-Engine Startzeit
  • 5. 5 Part of  WLP 19.0.0.6 WebProfile  verwendet ca. 220 MB  Wildfly 17.0.1 Servlet-Only  verwendet ca. 180 MB  Spring Boot 2.1.6.RELEASE mit Spring Web Starter  verwendet ca. 230 MB Arbeitsspeicher
  • 6. 6 Part of Ist das ein Problem? App A App B App C App A App B App C App A App B App C App B App C App C
  • 7. 7 Part of Ist das ein Problem? App A App A1 App A2 App A3
  • 8. 8 Part of Ist das ein Problem? https://cloud.google.com/compute/pricing
  • 9. 9 Part of Ist das ein Problem? https://cloud.ibm.com/kubernetes/catalog/cluster
  • 10. 10 Part of Ist das ein Problem? https://run.pivotal.io/pricing/
  • 11. 11 Part of  Wohin geht die Zukunft?  Function as a Service / Serverless  IoT  Long running processes?  Cattle vs. Pets  Automatische Skalierung Ist das ein Problem?
  • 13. 13 Part of  Open Source Cloud Native, Container first framework for Java  Apache License v2.0  Ziel: Minimaler Footprint  Setzt auf Standards (Microprofile) und Frameworks, die sich bereits bewiesen haben  Baut auf GraalVM auf  Est. März 2019  https://quarkus.io https://github.com/quarkusio/quarkus Quarkus !
  • 14. 14 Part of The goal of Quarkus is to make Java a leading platform in Kubernetes and serverless environments while offering developers a unified reactive and imperative programming model to optimally address a wider range of distributed application architectures. https://developers.redhat.com/blog/2019/03/07/quarkus-next-generation-kubernetes-native-java-framework/ Jason Greene Quarkus Co-Founder, Distinguished Engineer and Manager, Red Hat
  • 15. 15 Part of Native Image JVM Mode Quarkus: JVM Mode vs. Native Image Todo-Service todo-runner.jar todo-runner SubstrateVM
  • 17. 17 Part of Quarkus – Startzeit und Speicherverbrauch (eigene Angabe) https://quarkus.io/
  • 18. 18 Part of 0 1 2 3 4 5 6 7 8 Startzeit [s] Liberty Quarkus JVM Quarkus Native Startzeit  Ausführung inkl. Starten eines Docker-Containers  Aufruf mit Zugriff auf die Datenbank  2 fache Ausführung, Mittelwert  Zeit bis Beantwortung des 1. Requests  Messung analog zu https://quarkus.io/guides/performance- measure#how-do-we-measure-startup-time
  • 19. 19 Part of 0 20 40 60 80 100 120 140 160 Memory Usage [mb] Liberty Quarkus JVM Quarkus Native RAM-Verbrauch  Anwendungen in Docker-Container gestartet  Mind. 1 Request pro Anwendung (inkl. Zugriff auf Datenbank)  docker stats -a
  • 20. 20 Part of 0 50 100 150 200 250 300 350 400 450 Docker-Image- Size [mb] Liberty Quarkus JVM Quarkus Native Docker-Image-Size  Für WLP wurde das offizielle Image genommen  https://hub.docker.com/_/websphere-liberty/  Kernel  Für Quarkus wurden die mitgelieferten Dockerfiles verwendet  Es wurde nicht weiter optimiert
  • 21. 21 Part of Quarkus Module Quarkus Extensions Quarkus Core Jandex Gizmo Graal SDK JVM Substrate
  • 22. 22 Part of  Runtime -> Buildtime  Verzicht auf Reflection so gut es geht  Recorded Bytecode  Kein Config Parsen zur Laufzeit  Metadata Processing (Annotations, Getter & Setter)  Aufrufe vorbereiten (Proxy, Interfaces, …)  Unnötige Klassen werden nicht geladen
  • 23. 23 Part of GraalVM is a Java VM and JDK based on HotSpot/OpenJDK, implemented in Java. It supports additional programming languages and execution modes, like ahead-of-time compilation of Java applications for fast startup and low memory footprint. GraalVM https://en.wikipedia.org/wiki/GraalVM
  • 24. 24 Part of  Edition  GraalVM CE (OpenSource, GPLv2 License)  GraalVM EE  Production Ready seit Mai 2019 (Version 19.0)  Unterstützt Linux und MacOS (an Windows wird gearbeitet)  Contributors  Industrie  Forschung (Ausschnitt) Johannes Kepler University Linz, TU Berlin, University of Edinburgh, TU Dortmund, University of Lugano  https://www.graalvm.org/community/contributors/ GraalVM !
  • 25. 25 Part of  AoT – Compiler (Ahead of Time)  Closed World Assumption  Output: Native Executable  Kein Bytecode mehr!  Analyse, welche Klassen erreicht werden können  Vorsicht vor Reflection!  Programm wird während Build-Prozess ausgeführt  Image Heap  Static Initializer Native Image
  • 26. 26 Part of  Dynamic Class Loading nicht möglich  Reflection eingeschränkt möglich  Dynamic Proxy eingeschränkt möglich  JNI & Unsafe Memory Access „mostly supported“  JMX nicht möglich  https://github.com/oracle/graal/blob/master/s ubstratevm/LIMITATIONS.md Limitations Native Image
  • 27. 27 Part of  Native Image: Optimierung RAM & Boot-Time  Long running processes?  JIT nur im JVM Mode  Performance bzgl.  Durchsatz?  Antwortzeiten?  Skalierung? Native Image vs. JVM Mode
  • 30. 30 Part of  Für Migrationsprojekte  u.a. kein EJB und JMS support  Einschränkung der Libraries! (siehe Limitations)  Buildprozess (Native Image)  Infrastruktur muss während des Builds vorhanden sein  Benötigt viel Arbeitsspeicher  Benötigt Zeit Zu beachten
  • 32. 32 Part of Microprofile Konkurrenz zu Quarkus GraalVM Quarkus Helidon MP Helidon SE Micronaut Spring Boot
  • 33. 33 Part of Konkurrenz zu Quarkus https://www.graalvm.org/docs/why-graal/
  • 34. 34 Part of Konkurrenz zu Quarkus https://www.graalvm.org/docs/why-graal/
  • 35. 35 Part of  Just In Time (JIT) – Compiler benötigen CPU-Zyklen und Speicher  Greifen v.a. bei langlaufenden Prozessen JIT-Compiler App C JIT App C JIT App C JIT
  • 36. 36 Part of Konkurrenz zu GraalVM: JITaaS by OpenJ9 App C JIT App C JIT App C JIT JIT JIT as a Service https://github.com/eclipse/openj9/tree/jitaas
  • 37. 37 Part of Software Engineering ist eine Kunst. Sie erfordert die Tugenden eines Ingenieurs.

Hinweis der Redaktion

  • #5: Fokus Java bisher: Long running process.
  • #7: 2 tWAS Instanzen > Jede App hat eigenen Server
  • #8: Monolith > Microservice
  • #12: Story Franzl: Horizontal Auto Scaler mit RAM. Sofort waren alle 10 Instanzen da, weil falsch konfiguriert… … zeigt, dass es gut ist, wenn die Anwendung wenig RAM verbraucht, aber war im Grunde eine Fehlkonfiguration… kA ob das Beispiel passend ist (wahrscheinlich eher nicht)
  • #17: Demogott anbeten! Wie sieht die Anwendung aus Wie baut man die Anwendung Dev-Mode Native Image bauen
  • #22: Extension = Runtime & Buildtime The compiler depends on a JDK that supports a compatible version of JVMCI (JVM Compiler Interface).
  • #26: Beispiel mit Datum in static initializer: buuuuh blöd. Dafür kommt das native image aber mit reflection im static initializer klar -> logisch, da wird’s noch in der jvm ausgeführt The native executable contains not just code, but also an initial heap that serves as the starting point of the Java heap at run time. We call this initial heap the “image heap”. The image heap allows us to skip class initialization at run time, which is crucial for fast startup. While a traditional Java VM needs to run the class initializers of many core JDK classes before the main method of your application starts running, the native executable calls your main method quite directly. https://medium.com/graalvm/understanding-class-initialization-in-graalvm-native-image-generation-d765b7e4d6ed