SlideShare ist ein Scribd-Unternehmen logo
1 von 90
Cloud Native Java
with OpenJ9:
Fast, Lean and
Definitely Mean
About me
Steve Poole
IBM Lead Engineer / Developer advocate
Making Java Real Since Version 0.9
Open Source Advocate
DevOps Practitioner (whatever that means!)
Driving Change
@spoole167
http://www.eclipse.org/openj9
https://github.com/eclipse/openj9
Dual License:
Eclipse Public License v2.0
Apache 2.0
Users and contributors very welcome
https://github.com/eclipse/openj9/blob/master/CONTRIBUTING.md
Eclipse OpenJ9
Created Sept 2017
@spoole167
Outline
• This talk is about a JVM but its
also about evolution, new
environments, new economics
and new opportunities
@spoole167
Evolution
@spoole167
This is a
manatee
Lives in warm shallow waters .
Has no natural predators
Sleeps 50% of the day
Moves at 3 MPH
They may look like they
have blubber but its
actually stomach and
intestines..
@spoole167
In a stable environment
creatures evolve to an
optimal shape and
behavior.
The best economic fit.
The most reward for the
least effort.
@spoole167
The best shape for a
manatee is round
@spoole167
Staying in the same place
can make you over fit
• The manatee will die if the temperature gets to
cold.
• They need water at least 18 degrees C
• Their environment is surrounded by cold water
so moving out will kill them
• Staying where they are are will eventually lead
to extinction if they don’t evolve
• But evolution comes from new challenges.
• If their environment changes too fast it will kill.
@spoole167
What’s that got to do with the JVM?
@spoole167
For a very long
time Java and the
JVM have had one
evolutionary
pressure
@spoole167
Maximize the
opportunities
offered by Moore’s
Law
Forever…
@spoole167
Java has tuned itself to this pressure
@spoole167
Time
Throughput
/ memory
use
Traditional profile
@spoole167
Java has tuned itself
to this need
With great names like
Java SE 5 ‘tiger’
Java SE 6 ‘mustang’
Java SE 7 ‘dolphin’
We see Java as strong like the
tiger, with stamina like the
mustang and fast like the dolphin
@spoole167
Even when moores law
broke
• The JVM didn’t have to do much – it
already had a good multi-cpu story.
• But Java needed to change - and we
added streams and lambdas..
• Not as quick to deliver as we’d like
• Just about made it.
• Our Java survived
So far our Java animals have
given us great performance
For long running, multi-core
applications
Exactly what we needed
Exactly what the economics
required.
@spoole167
So far our Java animals have
given us great performance
From the smallest devices to the
largest
As well as real-time and soft-real-time
An ecosystem of JVMs
@spoole167
But things have
changed.
A new race is here
new economics
new environments
@spoole167
We got cloud
@spoole167
What ‘Cloud’
promises
a virtual, dynamic environment
which maximizes use, is infinitely
scalable, always available and
needs minimal upfront
investment or commitment
Take your code – host it on someone else's
machine and pay only for the resource you
use for the time you use it
AND be able to do that very quickly and
repeatedly in parallel@spoole167
https://www.flickr.com/photos/vuhung/
“Compute on demand” – it’s what we’ve always wanted
Cloud Economics
We really are getting closer all the time to
‘Compute on Tap’
https://www.flickr.com/photos/leunix/
Cloud Economics
But with taps come meters…
https://www.flickr.com/photos/leunix/ https://www.flickr.com/photos/beigephotos/
Cloud computing:
compute == money
Money changes everything
With a measureable and direct relationship
between $£€¥ and CPU/RAM, disk etc the
financial success or failure of a project is even
easier to see
And that means…
Even more focus on value for money.
@spoole167
compute == money
$ == GB/hr
-Xmx: $100@spoole167
Time
demand
Traditional profile
@spoole167
Demand
time
@spoole167
Demand
time
How does your application respond to demand?
@spoole167
Demand
time
One big server running all the time?
@spoole167
Demand
time
One big server running all the time?Look at all that wasted money!
@spoole167
Demand
Smaller compute units are better
@spoole167
Demand
time
Smaller compute units are better
@spoole167
Cloud demands:
• Small runtime memory footprint
• Small deployment sizes
• Fast starting applications
• No resource usage when idle
@spoole167
What does that mean for the JVM and
for Java applications?
@spoole167
Simply
Java applications are going to be running in a remote,
constrained and metered environment
There will be precise limits on how much disk, CPU, RAM,
Bandwidth an application can use and for how long
Whether your application is large or small, granular or
monolithic. Someone will be paying for each unit used
That person will want to get the most out of that investment
Your application is going on a diet
The JVM needs to change
ttps://www.flickr.com/photos/rvoegtli/
@spoole167
Let’s put that differently
•
@spoole167
Demand
time
Smaller compute units are better
@spoole167
Time
Throughput
Traditional profile
@spoole167
Time
Throughput
Lag Over-Peek usage
Doesn’t fit new model
Costs $ Costs
more $
@spoole167
Time
Throughput
More like this please
@spoole167
What does this mean to Cloud Java developers?
• Changing –Xmx directly effects cost!
– Very easy for businesses to understand
• Net effect: You’ll be tuning your application to fit into specific RAM sizes
– Smaller than you use today
• You need to understand where memory is being used.
– You’ll be picking components based on memory footprint
• Increased memory usage for 1 service increases the bill by the number of
concurrent instances!
@spoole167
Someone
will be
looking at
your leaky
app
@spoole167
In the Cloud footprint is
king
Application footprint is very
important
Cloud users pay for resources
For Cloud providers: higher app
density means lower
operational costs
@spoole167
Providers : two opposing trends
1: Virtualization: more big machines partitioned into many smaller VMs
Opportunities to share across VMs increased
os os os
os
@spoole167
Providers : two opposing trends
2: Microservices / containers / serverless cause increased memory usage
through less opportunities for sharing
JVM
OS
App server
application application
JVM
App server
application application
application
App server
JVM
application
App server
JVM
OS
@spoole167
Providers
need new ways of
reducing memory
usage
1
need to reduce tick-
over costs so that
CPU time only gets
used for running
applications
2
Need runtimes that
are ready to use as
quickly as possible
3
@spoole167
The challenge
• Hotspot needs to evolve in
different ways
• Along paths that are difficult to
take
• But, like the manatee, need to
be followed to keep Java alive
and vital
@spoole167
How does OpenJ9 Help?
@spoole167
http://www.eclipse.org/openj9
https://github.com/eclipse/openj9
Dual License:
Eclipse Public License v2.0
Apache 2.0
Users and contributors very welcome
https://github.com/eclipse/openj9/blob/master/CONTRIBUTING.md
Eclipse OpenJ9
Created Sept 2017
@spoole167
Java ME Inside!
@spoole167
Java ME requirements
 Small footprint
–On disk and runtime.
–Very limited RAM, usually more ROM
 Fast startup
–Everybody wants their games to start quickly
 Quick / immediate rampup
–Your game should not play better the longer you
play
@spoole167
Java Cloud requirements
 Small footprint
–Improves density for providers
–Improves cost for applications
 Fast startup
–Faster scaling for increased demand
 Quick / immediate rampup
–GB/hr is key, if you run for less time you pay less
money
@spoole167
OpenJ9 may
may have its
roots in
small devices..
@spoole167
But it runs just as well on the largest
Key elements
• Designed for scaling from the smallest to the largest
• Comes with several custom garbage collectors (even a soft-real time
one)
• Has a class sharing approach that allows sharing of state and constant
data in
@spoole167
OpenJ9 Shared Classes can work at all levels
JVM
OS
App server
application application
JVM
App server
application application
application
App server
JVM
application
App server
JVM
OS
@spoole167
OpenJ9 Shared Classes can work at all levels
JVM
OS
App server
application application
JVM
App server
application application
application
App server
JVM
application
App server
JVM
OS
@spoole167
Can help you with traditional workloads And with new containers etc
Shared Classes cache
-Xshareclasses
-enables the share classes cache
-Xscmx50M
- sets size of the cache
@spoole167
ShareClasses cache
Classfile ROMClass J9RAMClass
@spoole167
ShareClasses cache
Classfile ROMClass J9RAMClass
@spoole167
This isn’t the greatest format for running, compiling
or even caching
ShareClasses cache
Classfile ROMClass J9RAMClass
@spoole167
So when loading J9 splits it into two
parts
The read only part
Position independent The stateful part
ShareClasses: ROM pays off
JVM 1 JVM 2 JVM 3
@spoole167
Three JVMs running the same code – on the same machine
ShareClasses: ROM pays off
JVM 1 JVM 2 JVM 3
@spoole167
All the ROM classes are shared – position independent, non stateful
ShareClasses: ROM pays off
JVM 1 JVM 2 JVM 3
Shared Classes
Cache
@spoole167
Giving faster startup, smaller footprint
ShareClasses: ROM pays off
JVM 1 JVM 2 JVM 3
Shared Classes
Cache
@spoole167
And J9 can share the rom classes across any boundary – VM or Container
ShareClasses: ROM pays off
JVM 1 JVM 2 JVM 3
Shared Classes
Cache
@spoole167
Sharing readonly data this way improves startup and footprint
Up to 20% footprint just by enabling shared classes
“Dynamic” AOT through ShareClasses
Shared Classes
Cache
AOTROM Classes
$ java –Xshareclasses ...
“And J9 can share JITed code too
“Dynamic” AOT through ShareClasses
Shared Classes
Cache
AOTROM Classes
$ java –Xshareclasses ...
“And J9 can share JITed code too
Giving you 10-30% startup performance
ShareClasses and AOT
 Distinction between ‘cold’ and ‘warm’ runs
 Dynamic AOT compilation
–Relocatable format
–AOT loads are ~100 times faster than JIT compilations
–More generic code  slightly less optimized
 Generate AOT code only during start-up
 Recompilation helps bridge the gap
@spoole167
More tuning options
 -Xquickstart
–Designed for the fastest start-up
–Ideal for short-lived tasks
–May limit peak throughput
 -Xtune:virtualized
–Tuning for containers
–Enables VM idle management
–Improves start-up and ramp-up. Trade-off of small
throughput loss
Want to see
what that all
means for Java?
Results
Hotspot OpenJ9 OpenJ9 -Xshareclasses -Xquickstart
Hotspot OpenJ9 OpenJ9 -Xshareclasses -Xquickstart
Startup time is 30% faster with OpenJ9 –Xshareclasses -Xquickstart
@spoole167
Results
Footprint is 60% smaller with OpenJ9
Hotspot OpenJ9 OpenJ9 -Xshareclasses -Xquickstart
Hotspot OpenJ9 OpenJ9 -Xshareclasses -Xquickstart
@spoole167
Results
OpenJ9 triggers ~55% fewer wakeups
 OpenJDK9 with HotSpot – 0.168% CPU  OpenJDK9 with OpenJ9 – 0.111% CPU
 Summary: 84.7 wakeups/second, 0.0 GPU
ops/seconds, 0.0 VFS ops/sec and 0.3% CPU use.
 Usage Events/s Category Description
 0.9 ms/s 44.2 Process /sdks/OpenJDK9-
x64_Linux_20172509/jdk-9+181/bin/java
 119.5 µs/s 20.0 Process [xfsaild/dm-1]
 138.6 µs/s 7.4 Timer tick_sched_timer
 10.5 µs/s 1.6 Process [rcu_sched]
 190.4 µs/s 1.5 Timer hrtimer_wakeup
 Summary: 38.5 wakeups/second, 0.1 GPU ops/seconds,
0.0 VFS ops/sec and 0.2% CPU use
 Usage Events/s Category Description
 681.2 µs/s 19.2 Process /sdks/OpenJDK9-
OPENJ9_x64_Linux_20172509/jdk-9+181/bin/java
 58.3 µs/s 5.2 Timer tick_sched_timer
 21.9 µs/s 3.6 Process [rcu_sched]
 39.3 µs/s 2.0 Timer hrtimer_wakeup
 157.1 µs/s 1.0 kWork ixgbe_service_task
@spoole167
Time
Throughput
More like this please
@spoole167
Time
Real data
OpenJDK 9
with Hotspot
@spoole167
Time
Real data
OpenJDK 9
with Hotspot
OpenJDK 9
with OpenJ9
@spoole167
Time
Real data
OpenJDK 9
with Hotspot
OpenJDK 9
with OpenJ9
OpenJDK 9
with OpenJ9
+ AOT
@spoole167
Open J9
• IBM has been developing J9 since
Java began
• J9 was born into a restless world
• not static like the manatee , not
focused on speed like the
dolphin or stamina like the
mustang.
• This jvm needed to be able to do
everything – be all these
creatures.
@spoole167
Open J9
Designed from the start to span all the
operating systems needed by IBM products
This JVM can go from small to large
Can handle constrained environments or
memory rich ones
Is used by the largest enterprises on the
planet
If any JVM can be said to be at the heart of
the enterprise – its this one.
@spoole167
Open J9 is a
new animal
@spoole167
Using OpenJ9 is easy
https://adoptopenjdk.net/?variant=openjdk8-openj9@spoole167
https://hub.docker.com/r/adoptopenjdk/@spoole167
IBM donated J9 to Eclipse
because we believe it’s the best
way to move Java forward
• It offers a new place to start
• As the future emerges we can see that Java
needs to handle new technologies, new
hardware.
• Whether GPUs or Neuromorphic Processors
or even ultimate prize of Quantum
computers: Java must adapt.
• We can’t do it on our own. We have to do it
together
@spoole167
Having a choice allows
different roads to be
followed
• Different places
found
• Different friends
made
@spoole167
Open J9: a
different
beast
@spoole167
adoptopenjdk.net
Don’t just
take my word
for it
@spoole167
adoptopenjdk.net
Thank you
@spoole167
adoptopenjdk.net

Weitere ähnliche Inhalte

Ähnlich wie Dev Days Vilnius 2018 : Cloud Native Java with OpenJ9- Fast, Lean and definitely Mean

Overview of PaaS: Java experience
Overview of PaaS: Java experienceOverview of PaaS: Java experience
Overview of PaaS: Java experience
Igor Anishchenko
 

Ähnlich wie Dev Days Vilnius 2018 : Cloud Native Java with OpenJ9- Fast, Lean and definitely Mean (20)

Eclipse OpenJ9 - SpringOne 2018 Lightning talk
Eclipse OpenJ9 - SpringOne 2018 Lightning talkEclipse OpenJ9 - SpringOne 2018 Lightning talk
Eclipse OpenJ9 - SpringOne 2018 Lightning talk
 
HPC Storage and IO Trends and Workflows
HPC Storage and IO Trends and WorkflowsHPC Storage and IO Trends and Workflows
HPC Storage and IO Trends and Workflows
 
Follow these reasons to know java’s importance
Follow these reasons to know java’s importanceFollow these reasons to know java’s importance
Follow these reasons to know java’s importance
 
Overview of PaaS: Java experience
Overview of PaaS: Java experienceOverview of PaaS: Java experience
Overview of PaaS: Java experience
 
Overview of PaaS: Java experience
Overview of PaaS: Java experienceOverview of PaaS: Java experience
Overview of PaaS: Java experience
 
Java in the Age of Containers and Serverless
Java in the Age of Containers and ServerlessJava in the Age of Containers and Serverless
Java in the Age of Containers and Serverless
 
OOPs, OOMs, oh my! Containerizing JVM apps
OOPs, OOMs, oh my! Containerizing JVM appsOOPs, OOMs, oh my! Containerizing JVM apps
OOPs, OOMs, oh my! Containerizing JVM apps
 
KubeCon EU 2016: A lightweight deployment system for appops
KubeCon EU 2016: A lightweight deployment system for appopsKubeCon EU 2016: A lightweight deployment system for appops
KubeCon EU 2016: A lightweight deployment system for appops
 
What's the "right" PHP Framework?
What's the "right" PHP Framework?What's the "right" PHP Framework?
What's the "right" PHP Framework?
 
Dean4j@Njug5
Dean4j@Njug5Dean4j@Njug5
Dean4j@Njug5
 
Are you ready for cloud-native java JavaCro2019
Are you ready for cloud-native java JavaCro2019Are you ready for cloud-native java JavaCro2019
Are you ready for cloud-native java JavaCro2019
 
Making Apache Camel work for you
Making Apache Camel work for you Making Apache Camel work for you
Making Apache Camel work for you
 
12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQL12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQL
 
Simple tweaks to get the most out of your jvm
Simple tweaks to get the most out of your jvmSimple tweaks to get the most out of your jvm
Simple tweaks to get the most out of your jvm
 
Simple tweaks to get the most out of your JVM
Simple tweaks to get the most out of your JVMSimple tweaks to get the most out of your JVM
Simple tweaks to get the most out of your JVM
 
The brave new world of Java
The brave new world of JavaThe brave new world of Java
The brave new world of Java
 
EMC World 2016 - code.13 State of the Container Ecosystem with Persistent App...
EMC World 2016 - code.13 State of the Container Ecosystem with Persistent App...EMC World 2016 - code.13 State of the Container Ecosystem with Persistent App...
EMC World 2016 - code.13 State of the Container Ecosystem with Persistent App...
 
Java in the age of containers - JUG Frankfurt/M
Java in the age of containers - JUG Frankfurt/MJava in the age of containers - JUG Frankfurt/M
Java in the age of containers - JUG Frankfurt/M
 
Scaling with Symfony - PHP UK
Scaling with Symfony - PHP UKScaling with Symfony - PHP UK
Scaling with Symfony - PHP UK
 
Modern Container Orchestration (Without Breaking the Bank)
Modern Container Orchestration (Without Breaking the Bank)Modern Container Orchestration (Without Breaking the Bank)
Modern Container Orchestration (Without Breaking the Bank)
 

Mehr von Steve Poole

Mehr von Steve Poole (20)

Key Takeaways for Java Developers from the State of the Software Supply Chain...
Key Takeaways for Java Developers from the State of the Software Supply Chain...Key Takeaways for Java Developers from the State of the Software Supply Chain...
Key Takeaways for Java Developers from the State of the Software Supply Chain...
 
THRIVING IN THE GEN AI ERA: NAVIGATING CHANGE IN TECH
THRIVING IN THE GEN AI ERA: NAVIGATING CHANGE IN TECHTHRIVING IN THE GEN AI ERA: NAVIGATING CHANGE IN TECH
THRIVING IN THE GEN AI ERA: NAVIGATING CHANGE IN TECH
 
Maven Central++ What's happening at the core of the Java supply chain
Maven Central++ What's happening at the core of the Java supply chainMaven Central++ What's happening at the core of the Java supply chain
Maven Central++ What's happening at the core of the Java supply chain
 
GIDS-2023 A New Hope for 2023? What Developers Must Learn Next
GIDS-2023 A New Hope for 2023? What Developers Must Learn NextGIDS-2023 A New Hope for 2023? What Developers Must Learn Next
GIDS-2023 A New Hope for 2023? What Developers Must Learn Next
 
A new hope for 2023? What developers must learn next
A new hope for 2023? What developers must learn nextA new hope for 2023? What developers must learn next
A new hope for 2023? What developers must learn next
 
Stop Security by Sleight Of Hand.pptx
Stop Security by Sleight Of Hand.pptxStop Security by Sleight Of Hand.pptx
Stop Security by Sleight Of Hand.pptx
 
Superman or Ironman - can everyone be a 10x developer?
Superman or Ironman - can everyone be a 10x developer?Superman or Ironman - can everyone be a 10x developer?
Superman or Ironman - can everyone be a 10x developer?
 
The Secret Life of Maven Central
The Secret Life of Maven CentralThe Secret Life of Maven Central
The Secret Life of Maven Central
 
The Secret Life of Maven Central.pptx
The Secret Life of Maven Central.pptxThe Secret Life of Maven Central.pptx
The Secret Life of Maven Central.pptx
 
Devoxx France 2022: Game Over or Game Changing? Why Software Development May ...
Devoxx France 2022: Game Over or Game Changing? Why Software Development May ...Devoxx France 2022: Game Over or Game Changing? Why Software Development May ...
Devoxx France 2022: Game Over or Game Changing? Why Software Development May ...
 
Log4Shell - Armageddon or Opportunity.pptx
Log4Shell - Armageddon or Opportunity.pptxLog4Shell - Armageddon or Opportunity.pptx
Log4Shell - Armageddon or Opportunity.pptx
 
DevnexusRansomeware.pptx
DevnexusRansomeware.pptxDevnexusRansomeware.pptx
DevnexusRansomeware.pptx
 
Game Over or Game Changing? Why Software Development May Never be the same again
Game Over or Game Changing? Why Software Development May Never be the same againGame Over or Game Changing? Why Software Development May Never be the same again
Game Over or Game Changing? Why Software Development May Never be the same again
 
Cybercrime and the developer 2021 style
Cybercrime and the developer 2021 styleCybercrime and the developer 2021 style
Cybercrime and the developer 2021 style
 
Agile Islands 2020 - Dashboards and Culture
Agile Islands 2020 - Dashboards and CultureAgile Islands 2020 - Dashboards and Culture
Agile Islands 2020 - Dashboards and Culture
 
LJC Speaker Clnic June 2020
LJC Speaker Clnic June 2020LJC Speaker Clnic June 2020
LJC Speaker Clnic June 2020
 
Agile Tour London 2018: DASHBOARDS AND CULTURE – HOW OPENNESS CHANGES YOUR BE...
Agile Tour London 2018: DASHBOARDS AND CULTURE – HOW OPENNESS CHANGES YOUR BE...Agile Tour London 2018: DASHBOARDS AND CULTURE – HOW OPENNESS CHANGES YOUR BE...
Agile Tour London 2018: DASHBOARDS AND CULTURE – HOW OPENNESS CHANGES YOUR BE...
 
Beyond the Pi: What’s Next for the Hacker in All of Us?
Beyond the Pi: What’s Next for the Hacker in All of Us?Beyond the Pi: What’s Next for the Hacker in All of Us?
Beyond the Pi: What’s Next for the Hacker in All of Us?
 
A Modern Fairy Tale: Java Serialization
A Modern Fairy Tale: Java Serialization A Modern Fairy Tale: Java Serialization
A Modern Fairy Tale: Java Serialization
 
SkillsMatter June 2018: Java in the 21st Century: Are You Thinking Far Enough...
SkillsMatter June 2018: Java in the 21st Century: Are You Thinking Far Enough...SkillsMatter June 2018: Java in the 21st Century: Are You Thinking Far Enough...
SkillsMatter June 2018: Java in the 21st Century: Are You Thinking Far Enough...
 

Kürzlich hochgeladen

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 

Kürzlich hochgeladen (20)

W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 

Dev Days Vilnius 2018 : Cloud Native Java with OpenJ9- Fast, Lean and definitely Mean

  • 1. Cloud Native Java with OpenJ9: Fast, Lean and Definitely Mean
  • 2. About me Steve Poole IBM Lead Engineer / Developer advocate Making Java Real Since Version 0.9 Open Source Advocate DevOps Practitioner (whatever that means!) Driving Change @spoole167
  • 3. http://www.eclipse.org/openj9 https://github.com/eclipse/openj9 Dual License: Eclipse Public License v2.0 Apache 2.0 Users and contributors very welcome https://github.com/eclipse/openj9/blob/master/CONTRIBUTING.md Eclipse OpenJ9 Created Sept 2017 @spoole167
  • 4. Outline • This talk is about a JVM but its also about evolution, new environments, new economics and new opportunities @spoole167
  • 6. This is a manatee Lives in warm shallow waters . Has no natural predators Sleeps 50% of the day Moves at 3 MPH They may look like they have blubber but its actually stomach and intestines.. @spoole167
  • 7. In a stable environment creatures evolve to an optimal shape and behavior. The best economic fit. The most reward for the least effort. @spoole167
  • 8. The best shape for a manatee is round @spoole167
  • 9. Staying in the same place can make you over fit • The manatee will die if the temperature gets to cold. • They need water at least 18 degrees C • Their environment is surrounded by cold water so moving out will kill them • Staying where they are are will eventually lead to extinction if they don’t evolve • But evolution comes from new challenges. • If their environment changes too fast it will kill. @spoole167
  • 10. What’s that got to do with the JVM? @spoole167
  • 11. For a very long time Java and the JVM have had one evolutionary pressure @spoole167
  • 12. Maximize the opportunities offered by Moore’s Law Forever… @spoole167
  • 13. Java has tuned itself to this pressure @spoole167
  • 15. Java has tuned itself to this need With great names like Java SE 5 ‘tiger’ Java SE 6 ‘mustang’ Java SE 7 ‘dolphin’ We see Java as strong like the tiger, with stamina like the mustang and fast like the dolphin @spoole167
  • 16. Even when moores law broke • The JVM didn’t have to do much – it already had a good multi-cpu story. • But Java needed to change - and we added streams and lambdas.. • Not as quick to deliver as we’d like • Just about made it. • Our Java survived
  • 17. So far our Java animals have given us great performance For long running, multi-core applications Exactly what we needed Exactly what the economics required. @spoole167
  • 18. So far our Java animals have given us great performance From the smallest devices to the largest As well as real-time and soft-real-time An ecosystem of JVMs @spoole167
  • 19. But things have changed. A new race is here new economics new environments @spoole167
  • 21. What ‘Cloud’ promises a virtual, dynamic environment which maximizes use, is infinitely scalable, always available and needs minimal upfront investment or commitment Take your code – host it on someone else's machine and pay only for the resource you use for the time you use it AND be able to do that very quickly and repeatedly in parallel@spoole167
  • 22. https://www.flickr.com/photos/vuhung/ “Compute on demand” – it’s what we’ve always wanted
  • 23. Cloud Economics We really are getting closer all the time to ‘Compute on Tap’ https://www.flickr.com/photos/leunix/
  • 24. Cloud Economics But with taps come meters… https://www.flickr.com/photos/leunix/ https://www.flickr.com/photos/beigephotos/
  • 25. Cloud computing: compute == money Money changes everything With a measureable and direct relationship between $£€¥ and CPU/RAM, disk etc the financial success or failure of a project is even easier to see And that means… Even more focus on value for money. @spoole167
  • 26. compute == money $ == GB/hr -Xmx: $100@spoole167
  • 29. Demand time How does your application respond to demand? @spoole167
  • 30. Demand time One big server running all the time? @spoole167
  • 31. Demand time One big server running all the time?Look at all that wasted money! @spoole167
  • 32. Demand Smaller compute units are better @spoole167
  • 33. Demand time Smaller compute units are better @spoole167
  • 34. Cloud demands: • Small runtime memory footprint • Small deployment sizes • Fast starting applications • No resource usage when idle @spoole167
  • 35. What does that mean for the JVM and for Java applications? @spoole167
  • 36. Simply Java applications are going to be running in a remote, constrained and metered environment There will be precise limits on how much disk, CPU, RAM, Bandwidth an application can use and for how long Whether your application is large or small, granular or monolithic. Someone will be paying for each unit used That person will want to get the most out of that investment Your application is going on a diet The JVM needs to change ttps://www.flickr.com/photos/rvoegtli/ @spoole167
  • 37. Let’s put that differently • @spoole167
  • 38. Demand time Smaller compute units are better @spoole167
  • 40. Time Throughput Lag Over-Peek usage Doesn’t fit new model Costs $ Costs more $ @spoole167
  • 41. Time Throughput More like this please @spoole167
  • 42. What does this mean to Cloud Java developers? • Changing –Xmx directly effects cost! – Very easy for businesses to understand • Net effect: You’ll be tuning your application to fit into specific RAM sizes – Smaller than you use today • You need to understand where memory is being used. – You’ll be picking components based on memory footprint • Increased memory usage for 1 service increases the bill by the number of concurrent instances! @spoole167
  • 43. Someone will be looking at your leaky app @spoole167
  • 44. In the Cloud footprint is king Application footprint is very important Cloud users pay for resources For Cloud providers: higher app density means lower operational costs @spoole167
  • 45. Providers : two opposing trends 1: Virtualization: more big machines partitioned into many smaller VMs Opportunities to share across VMs increased os os os os @spoole167
  • 46. Providers : two opposing trends 2: Microservices / containers / serverless cause increased memory usage through less opportunities for sharing JVM OS App server application application JVM App server application application application App server JVM application App server JVM OS @spoole167
  • 47. Providers need new ways of reducing memory usage 1 need to reduce tick- over costs so that CPU time only gets used for running applications 2 Need runtimes that are ready to use as quickly as possible 3 @spoole167
  • 48. The challenge • Hotspot needs to evolve in different ways • Along paths that are difficult to take • But, like the manatee, need to be followed to keep Java alive and vital @spoole167
  • 49. How does OpenJ9 Help? @spoole167
  • 50. http://www.eclipse.org/openj9 https://github.com/eclipse/openj9 Dual License: Eclipse Public License v2.0 Apache 2.0 Users and contributors very welcome https://github.com/eclipse/openj9/blob/master/CONTRIBUTING.md Eclipse OpenJ9 Created Sept 2017 @spoole167
  • 52. Java ME requirements  Small footprint –On disk and runtime. –Very limited RAM, usually more ROM  Fast startup –Everybody wants their games to start quickly  Quick / immediate rampup –Your game should not play better the longer you play @spoole167
  • 53. Java Cloud requirements  Small footprint –Improves density for providers –Improves cost for applications  Fast startup –Faster scaling for increased demand  Quick / immediate rampup –GB/hr is key, if you run for less time you pay less money @spoole167
  • 54. OpenJ9 may may have its roots in small devices.. @spoole167
  • 55. But it runs just as well on the largest
  • 56. Key elements • Designed for scaling from the smallest to the largest • Comes with several custom garbage collectors (even a soft-real time one) • Has a class sharing approach that allows sharing of state and constant data in @spoole167
  • 57. OpenJ9 Shared Classes can work at all levels JVM OS App server application application JVM App server application application application App server JVM application App server JVM OS @spoole167
  • 58. OpenJ9 Shared Classes can work at all levels JVM OS App server application application JVM App server application application application App server JVM application App server JVM OS @spoole167 Can help you with traditional workloads And with new containers etc
  • 59. Shared Classes cache -Xshareclasses -enables the share classes cache -Xscmx50M - sets size of the cache @spoole167
  • 60. ShareClasses cache Classfile ROMClass J9RAMClass @spoole167
  • 61. ShareClasses cache Classfile ROMClass J9RAMClass @spoole167 This isn’t the greatest format for running, compiling or even caching
  • 62. ShareClasses cache Classfile ROMClass J9RAMClass @spoole167 So when loading J9 splits it into two parts The read only part Position independent The stateful part
  • 63. ShareClasses: ROM pays off JVM 1 JVM 2 JVM 3 @spoole167 Three JVMs running the same code – on the same machine
  • 64. ShareClasses: ROM pays off JVM 1 JVM 2 JVM 3 @spoole167 All the ROM classes are shared – position independent, non stateful
  • 65. ShareClasses: ROM pays off JVM 1 JVM 2 JVM 3 Shared Classes Cache @spoole167 Giving faster startup, smaller footprint
  • 66. ShareClasses: ROM pays off JVM 1 JVM 2 JVM 3 Shared Classes Cache @spoole167 And J9 can share the rom classes across any boundary – VM or Container
  • 67. ShareClasses: ROM pays off JVM 1 JVM 2 JVM 3 Shared Classes Cache @spoole167 Sharing readonly data this way improves startup and footprint Up to 20% footprint just by enabling shared classes
  • 68. “Dynamic” AOT through ShareClasses Shared Classes Cache AOTROM Classes $ java –Xshareclasses ... “And J9 can share JITed code too
  • 69. “Dynamic” AOT through ShareClasses Shared Classes Cache AOTROM Classes $ java –Xshareclasses ... “And J9 can share JITed code too Giving you 10-30% startup performance
  • 70. ShareClasses and AOT  Distinction between ‘cold’ and ‘warm’ runs  Dynamic AOT compilation –Relocatable format –AOT loads are ~100 times faster than JIT compilations –More generic code  slightly less optimized  Generate AOT code only during start-up  Recompilation helps bridge the gap @spoole167
  • 71. More tuning options  -Xquickstart –Designed for the fastest start-up –Ideal for short-lived tasks –May limit peak throughput  -Xtune:virtualized –Tuning for containers –Enables VM idle management –Improves start-up and ramp-up. Trade-off of small throughput loss
  • 72. Want to see what that all means for Java?
  • 73. Results Hotspot OpenJ9 OpenJ9 -Xshareclasses -Xquickstart Hotspot OpenJ9 OpenJ9 -Xshareclasses -Xquickstart Startup time is 30% faster with OpenJ9 –Xshareclasses -Xquickstart @spoole167
  • 74. Results Footprint is 60% smaller with OpenJ9 Hotspot OpenJ9 OpenJ9 -Xshareclasses -Xquickstart Hotspot OpenJ9 OpenJ9 -Xshareclasses -Xquickstart @spoole167
  • 75. Results OpenJ9 triggers ~55% fewer wakeups  OpenJDK9 with HotSpot – 0.168% CPU  OpenJDK9 with OpenJ9 – 0.111% CPU  Summary: 84.7 wakeups/second, 0.0 GPU ops/seconds, 0.0 VFS ops/sec and 0.3% CPU use.  Usage Events/s Category Description  0.9 ms/s 44.2 Process /sdks/OpenJDK9- x64_Linux_20172509/jdk-9+181/bin/java  119.5 µs/s 20.0 Process [xfsaild/dm-1]  138.6 µs/s 7.4 Timer tick_sched_timer  10.5 µs/s 1.6 Process [rcu_sched]  190.4 µs/s 1.5 Timer hrtimer_wakeup  Summary: 38.5 wakeups/second, 0.1 GPU ops/seconds, 0.0 VFS ops/sec and 0.2% CPU use  Usage Events/s Category Description  681.2 µs/s 19.2 Process /sdks/OpenJDK9- OPENJ9_x64_Linux_20172509/jdk-9+181/bin/java  58.3 µs/s 5.2 Timer tick_sched_timer  21.9 µs/s 3.6 Process [rcu_sched]  39.3 µs/s 2.0 Timer hrtimer_wakeup  157.1 µs/s 1.0 kWork ixgbe_service_task @spoole167
  • 76. Time Throughput More like this please @spoole167
  • 77. Time Real data OpenJDK 9 with Hotspot @spoole167
  • 78. Time Real data OpenJDK 9 with Hotspot OpenJDK 9 with OpenJ9 @spoole167
  • 79. Time Real data OpenJDK 9 with Hotspot OpenJDK 9 with OpenJ9 OpenJDK 9 with OpenJ9 + AOT @spoole167
  • 80. Open J9 • IBM has been developing J9 since Java began • J9 was born into a restless world • not static like the manatee , not focused on speed like the dolphin or stamina like the mustang. • This jvm needed to be able to do everything – be all these creatures. @spoole167
  • 81. Open J9 Designed from the start to span all the operating systems needed by IBM products This JVM can go from small to large Can handle constrained environments or memory rich ones Is used by the largest enterprises on the planet If any JVM can be said to be at the heart of the enterprise – its this one. @spoole167
  • 82. Open J9 is a new animal @spoole167
  • 86. IBM donated J9 to Eclipse because we believe it’s the best way to move Java forward • It offers a new place to start • As the future emerges we can see that Java needs to handle new technologies, new hardware. • Whether GPUs or Neuromorphic Processors or even ultimate prize of Quantum computers: Java must adapt. • We can’t do it on our own. We have to do it together @spoole167
  • 87. Having a choice allows different roads to be followed • Different places found • Different friends made @spoole167
  • 89. Don’t just take my word for it @spoole167 adoptopenjdk.net

Hinweis der Redaktion

  1. Make a big deal about the license Very open, very easy for anyone and everyone to contribute. Operating at the Eclipse Foundation means operating under a set of rules that ensures the project is open, accessible to all, and not controlled by any single company. This is one of the first projects under the EPLv2 which is really cool Additionally, EPLv2 has secondary licenses that make it compatible with the GPL Mention this is a JVM
  2. Make a big deal about the license Very open, very easy for anyone and everyone to contribute. Operating at the Eclipse Foundation means operating under a set of rules that ensures the project is open, accessible to all, and not controlled by any single company. This is one of the first projects under the EPLv2 which is really cool Additionally, EPLv2 has secondary licenses that make it compatible with the GPL Mention this is a JVM
  3. It needed to find ways to save footprint by sharing data between each VM…. And once you have a shared area, you open up more possibilities.
  4. I’ve given other talks on why OpenJ9 does this conversion But the reader digest condensed version is that the classfile is bad format to interpret We change it into a better format (ROMClass) and a cache for the resolve values / live pointers (RAMClass) ROM is write once to create Position independent The symbolic data from the class file with the unnecessary parts thrown away
  5. I’ve given other talks on why OpenJ9 does this conversion But the reader digest condensed version is that the classfile is bad format to interpret We change it into a better format (ROMClass) and a cache for the resolve values / live pointers (RAMClass) ROM is write once to create Position independent The symbolic data from the class file with the unnecessary parts thrown away
  6. I’ve given other talks on why OpenJ9 does this conversion But the reader digest condensed version is that the classfile is bad format to interpret We change it into a better format (ROMClass) and a cache for the resolve values / live pointers (RAMClass) ROM is write once to create Position independent The symbolic data from the class file with the unnecessary parts thrown away
  7. Let’s say I have three JVMs, all running the same code, on the same machine Maybe it’s a service where I’m running multiple instances In each of them, when classes are loaded, they get converted into ROMClasses and RAMClasses Three things to note: This conversion takes time It always produces the same result for the ROMClass 3) Because this is ROM, it doesn’t use pointers (so it’s position independent) and can be shared.
  8. Three things to note: This conversion takes time It always produces the same result for the ROMClass 3) Because this is ROM, it doesn’t use pointers (so it’s position independent) and can be shared.
  9. Each of the JVMs shares the ROMClasses in the SharedClasses Cache. They check the cache for a ROMClass before they create the class themselves. Certain heuristics are used to ensure that the class is the “same”. If the heuristics fail, we do a comparison with the new class to see if the cached one can be used. The goal is always to use the cache if the class is the same. The reason for doing this is twofold: Startup performance improvements Footprint improvements. Up to 20% improvements by sharing the read only data This really just returns us to the world of C where executable code in shared libaries is shared between processes. Now bytecode can be too.
  10. Each of the JVMs shares the ROMClasses in the SharedClasses Cache. They check the cache for a ROMClass before they create the class themselves. Certain heuristics are used to ensure that the class is the “same”. If the heuristics fail, we do a comparison with the new class to see if the cached one can be used. The goal is always to use the cache if the class is the same. The reason for doing this is twofold: Startup performance improvements Footprint improvements. Up to 20% improvements by sharing the read only data This really just returns us to the world of C where executable code in shared libaries is shared between processes. Now bytecode can be too.
  11. Each of the JVMs shares the ROMClasses in the SharedClasses Cache. They check the cache for a ROMClass before they create the class themselves. Certain heuristics are used to ensure that the class is the “same”. If the heuristics fail, we do a comparison with the new class to see if the cached one can be used. The goal is always to use the cache if the class is the same. The reason for doing this is twofold: Startup performance improvements Footprint improvements. Up to 20% improvements by sharing the read only data This really just returns us to the world of C where executable code in shared libaries is shared between processes. Now bytecode can be too.
  12. OpenJ9 already has AOT. Reduces startup time by caching “ready to run” previously JITed code (Dynamic AOT) Dynamic AOT - reuse JIT code from multiple JVMs improve startup time 10-30 % Compile once, run manywhere Think of this as a dynamic load library created at runtime Jlink provides an opportunity to extend what we do with our AOT
  13. OpenJ9 already has AOT. Reduces startup time by caching “ready to run” previously JITed code (Dynamic AOT) Dynamic AOT - reuse JIT code from multiple JVMs improve startup time 10-30 % Compile once, run manywhere Think of this as a dynamic load library created at runtime Jlink provides an opportunity to extend what we do with our AOT
  14. Are you aware of AdoptOpenJDK? London JUG created “No one competes on build farms” – common infrastructure for all JDK builders A place to get certified builds, of known good quality. Test suites JCKs Tracking the OpenJDK patch levels (Security fixes) And most importantly, they provide binaries for Eclipse OpenJ9 And OpenJ9 was the first set of binaries to have passed certification there.