About Me2020/03/04  · Quarkus + JVM (via OpenJDK) 145 MB Traditional Cloud-Native Stack 209 MB 7...

Post on 24-Sep-2020

1 views 0 download

Transcript of About Me2020/03/04  · Quarkus + JVM (via OpenJDK) 145 MB Traditional Cloud-Native Stack 209 MB 7...

1

2

About Me

Stuart Douglas● Senior Principal Engineer at Red Hat● Quarkus Co-founder● Servlet Specification Co-lead● Founder of the Undertow Project● Core Contributor to WildFly

3

4

A cohesive platform for optimized developer joy:

Benefit No. 1: Developer Joy

5

Benefit No. 2: Supersonic Subatomic Java

Quarkus + Native(via GraalVM)

12 MB

Quarkus + JVM(via OpenJDK)

73 MB

Traditional Cloud-Native Stack

136 MB

6

Benefit No. 2: Supersonic Subatomic Java

Quarkus + Native(via GraalVM)

28 MB

Quarkus + JVM(via OpenJDK)

145 MB

Traditional Cloud-Native Stack

209 MB

7

Benefit No. 2: Supersonic Subatomic Java

Quarkus + Native (via GraalVM) 0.016 Seconds

Quarkus + JVM (via OpenJDK) 0.943 Seconds

Quarkus + Native (via GraalVM) 0.042 Seconds

Quarkus + JVM (via OpenJDK) 2.033 Seconds

Traditional Cloud-Native Stack 9.5 Seconds

Traditional Cloud-Native Stack 4.3 Seconds

8

Benefit No. 3: Unifies Imperative and Reactive

●●●

@InjectSayService say;

@GET@Produces(MediaType.TEXT_PLAIN)public String hello() {

return say.hello();}

@Inject @Channel(”kafka”)Publisher<String> reactiveSay;

@GET@Produces(MediaType.SERVER_SENT_EVENTS)public Publisher<String> stream() {

return reactiveSay;}

9

Benefit No. 4: Best of Breed Frameworks & Standards

10

Developer Joy

Quarkus Benefits

Supersonic Subatomic Java

Unifies

imperative and reactive

Best of breed

libraries and standards

11

12

●●●

MONOLITH

F FFFFFFFFF

F FFFFFFFFF

F FFFFFFFFF

F FFFFFFFFF

F FFFFFFFFF

F FFFFFFFFF

F FFFFFFFFF

F FFFFFFFFF

F FFFFFFFFF

F FFFFFFFFF

F FFFFFFFFF

F FFFFFFFFF

F FFFFFFFFF

F FFFFFFFFF

F FFFFFFFFF

F FFFFFFFFF

F FFFFFFFFF

F FFFFFFFFF

13

Enterprise Java was Designed for 3-Tier Architecture

14

How Application Services Deployed Java Apps

15

Microservices Changed How We Deploy Apps

●○

●○

16

The hidden truth about Java + containers

RSS

17

The hidden truth about Java + containers

18

The hidden truth about Java + containers

CONTAINER ORCHESTRATION

NodeNode

Traditional Cloud-Native Java Stack

Traditional Cloud-Native Java Stack

Traditional Cloud-Native Java Stack

Traditional Cloud-Native Java Stack

Node

NodeJS

NodeJS

NodeJS

NodeJS

NodeJS

NodeJS

NodeJS

Go Go Go

Go Go Go

Go Go Go

Go Go Go

Go Go Go

Go Go Go

Go Go GoNode

Quarkus

Quarkus

Quarkus

Quarkus

Quarkus

Quarkus

Quarkus

Quarkus

Quarkus

Quarkus

Quarkus

Quarkus

Quarkus

Quarkus

Standards

Java on cloud native: a Red Hat journey

● Java EE streamlining● Eclipse MicroProfile

Runtimes● WildFly on OpenShift

Hardware architectures

● Raspberry Pi and Plug Computer● Android

Ahead of time compilation

● Lead gcj● Looked at Dalvik, Avian, Excelsior JET

OpenJDK

● Container ergonomics● JVM metadata reduction

19

@@</>

Build time (maven, gradle…)

How does a framework start?

@@</>

Load config file from file systemParse it

How does a framework start?

How does a framework start?

@@</>

Classpath scanning to findannotated classesAttempt to load class to enable/disable features

How does a framework start?

@@</>

Build its model of the world.

How does a framework start?

@@</>

Start the management (thread, pool…)

@@</>

The Quarkus way

@@</>

@@</>

The Quarkus way - Closed-World Assumption

Limited variability

@@</>

The Quarkus way - Benefits

No FS access at runtime

No need for a parser at runtime

No scanning at runtime

Less reflection and classloading

at runtime

Optimized configurationLess reflection

(proxy generation)

Prepared initialization

(ready to serve)

29

JDK JIT - HotSpot AOTC - GraalVM Native Image

30

Full stack

Conclusion

Massive productivity wins

32

JVM CI

Sulong (LLVM)

Truffle

Graal Compiler

Substrate VM

Java HotSpot VM

33

AOTC - GraalVM native image - Dead code elimination

34

Not supported

The Dark Side

●●●●●

OK with caveats in usage

●●●●●●

35

Not supported

The Dark Side

●●●●●

OK with caveats in usage

●●●●●●

36

JIT - OpenJDK HotSpot

When to use which VM with Quarkus

High memory density requirementsHigh request/s/MBFast startup time

Best raw performance (CPU)Best garbage collectorsHigher heap size usage

Known monitoring toolsCompile Once, Run anywhereLibraries that only works in standard JDK

AOT - GraalVM native image

Highest memory density requirementsHighest request/s/MB

for low heap size usagesFaster startup time

10s of ms for Serverless

37

Drives the gathering of metadata needed by GraalVM

GraalVM specific benefits

●●●

Minimize dependencies

Help dead code elimination

100% of the ecosystem supported on GraalVM

38

Add your own dependency

Can I add my dependencies?

● Works on the JVM (OpenJDK)● May work on AOT (GraalVM)

Write your own extension

● Like add your dependency plus…● Build time startup and memory

improvements● Better dead code elimination● Developer Joy

YES

39

40