SlideShare a Scribd company logo
Michael Dawson
October 2015
Leveraging Java Optimizations
to Improve Density in Cloud
Environments
About Michael Dawson
Loves the web and building software
2
Senior Software Developer @ IBM
23 years development experience
11 years in runtime development
Contact me:
Michael_dawson@ca.ibm.com
Twitter: @mhdawson1
https://www.linkedin.com/pub/michael-dawson/2/128/605
3
• Motivation
• Shared Classes
• Cloud Environments
• Docker
• Cloud Foundry
• Leveraging SC in Cloud
Agenda
4
• Startup affects customers
•- Restart
•- Scale out
• Footprint affects cost
• Lots of small apps
Motivation
IBM SDK for Java
java -Xshareclasses:name=myHelloApp -jar
5
Shared Classes
No -Xshareclasses -Xshareclasses(1st run) -Xshareclasses
0
200
400
600
800
1000
1200
1400
1600
Java 70 Tomcat Startup
Linux x86_64
Time(ms)
Faster Startup Smaller Footprint
6
Shared Classes
• What
• Read only part of Class
• Class File Bytes
• String De-duplication
• Jit Data (AOT)
• Class Debug Data (separate)
• How
• SysV Shared Memory (e.g. on z/OS)
• POSIX mmap (e.g. on Linux and AIX)
• CreateFileMapping (e.g. on Windows)
7
Shared Classes – Faster Startup
• Classloading Time
• Read from disk
• Parse
• Create in-memory representation
• JIT artifacts
• Methods initially run interpreted
• 1000’s of methods are JIT compiled
• Start-up methods same run to run
• Why compile over and over ?
• Metadata to guide compilation
8
Shared Classes – Lower Footprint
Heap
Object Instances
(e.g. tmp)
JIT
Code & Data Cache
Shared Class Data
Byte Codes
(e.g. MyObject)
JVM Process Memory
Heap
Object Instances
(e.g. tmp)
JIT
Code & Data Cache
Shared Class Data
Byte Codes
(e.g. MyObject)
JVM Process Memory
Shared Class Data
Byte Codes
(e.g. MyObject)
9
Cloud Environments
Bare Metal
Virtual Machines
Docker
PaaS
10
Cloud Environments – Bare Metal
Multiple Apps Common
Shared storage and memory
Shared Classes works by default
A
P
P
1
A
P
P
N
Faster Startup
Lower Footprint
11
Cloud Environments – Virtual Machine
Smaller deployment units (+)
Memory not shared across VMs
Storage not shared across VMs
A
P
P
1
A
P
P
N
VM1 VMn
Shared Classes – Reduced Effectiveness
Faster Startup
Lower Footprint
12
Cloud Environments - Docker
Base OS
(ex Ubuntu 14)
Middleware
Application
Application
https://hub.docker.com/_/websphere-liberty/
https://hub.docker.com/_/ubuntu/
A
P
P
1
A
P
P
N
CONT1 CONTn
Middleware
Base OS
Images
Application
State1 Staten
Containers
13
Cloud Environments – Docker Demo
Docker images
Docker ps
Start/stop show state not preserved
14
Cloud Environments – Docker
Even smaller deployment units (++)
Memory not shared across VMs
Storage not persistent
A
P
P
1
A
P
P
N
CONT1 CONTn
Shared Classes – Reduced Effectiveness
Faster Startup
Lower Footprint
15
Cloud Environments – PaaS – Cloud Foundry
Staging -> buildpack creates Droplet
Start or Scale
Droplet to DEA, Extract Droplet
Warden with droplet contents
Droplet size affects push/startup times
16
Cloud Environments – Cloud Foundry
17
Cloud Environments – PaaS
Even smaller deployment units (+++)
Memory not shared across VMs
Storage not persistent
A
P
P
1
A
P
P
N
Warden1
Shared Classes – Reduced Effectiveness
Faster Startup
Lower Footprint
WardenN
18
Cloud Environments – What’s different
Persistent
Storage
Shared
Storage
Shared
Memory
Bare Metal X X X
Virtual
Machines
X
Docker
PaaS
19
Cloud Environments – What can we do ?
Start-up
Persistent Storage ->Generate Dynamically
Add cache sharing mechanism
Shared storage
Cache server
Bundle pre-built cache
Populate through warm up
Extra disk footprint
20
Cloud Environments – What can we do ?
Footprint
Transparent Page sharing at OS
Bundled pre-built cache
Cache sharing mechanism
Guided build
Share Memory across containers/wardens
V
i
r
t
1
V
i
r
t
2
V
i
r
t
N
p
h
y
s
21
Cloud Environments – Virtual Machines
 Persistent storage – Startup benefit by default
 Memory - build Cache to Enable sharing through TPS
Pre-created, bundled or cache server
Guide creation to end up with same result
 To read more:
http://www.computer.org/csdl/proceedings/ispass/2013/5
776/00/06557144.pdf
22
Cloud Environments - Docker
Startup – shared cache pre-built (read-only)
Footprint – Share memory across container !
Shared Cache disk file from shared layer
Memory mapping results in shared memory
Validated through lsof and /proc/pid/smaps
23
Cloud Environments - Docker
A
P
P
1
A
P
P
N
CONT1 CONTn
Liberty, JVM, Cache
Base OS
Application
State1 Staten
In Memory cache !!
 Middleware Image with:
 JVM
 Liberty
 Pre-built Shared
Cache
 Cache Read-only
 File system back end
with right properties (ex
aufs)
24
1 2 3 4 5 6 7 8 9 10
0
200
400
600
800
1000
1200
1400
Used Memory
(PSS)
Share
NoShare
NoShareNoCache
Cloud Environments – Docker
1 2 3 4 5 6 7 8 9 10
0
5
10
15
20
25
Startup Times
Share
NoShare
NoShareNoCache
Share: Shared cache pre-created and including in base layer –
-Xshareclasses:cacheDir=/usr/lib/liberty-java/caches,name=cache1,enableBCI
NoShare: cached created dynamically -Xshareclasses
NoShareNoCache: No cache -Xshareclasses:none
Faster Startup
Lower Footprint
25
Cloud Environments – Cloud Foundry
 Experimented with 2 optimizations so far
 Share memory across wardens
 Requires changes to CF installation
 Cache server
 Joint work with CAS Atlantic
http://www.unb.ca/research/casatlantic/index.html
 Panagiotis Patros, Kenneth Kent
26
Cloud Environments – Cloud Foundry – Share Memory
 JVM, Liberty Cashed installed on DEA
 Mapping options
 Same File available in all Wardens
 Memory map of same file -> shared memory across Wardens
 R/O due to security concerns
- src_path: /var/vcap/packages/ibmjvm64
dst_path: /tmp/jvms/ibmjvm64
mode: ro
src_path: /var/vcap/packages/ibmClassCaches
dst_path: /tmp/jvms/ibmClassCaches
mode: ro
- src_path: /var/vcap/packages/liberty
dst_path: /tmp/liberty
mode: ro
27
Cloud Environments – Cloud Foundry – Share Memory
0
2
4
6
8
10
12
14
16
18
20
No Sharing Sharing Libraries Sharing Libraries and
Cache
Start times (seconds)
0
20
40
60
80
100
120
140
160
180
200
No Sharing Sharing Libraries Sharing Libraries and
Cache
Resident Set Size (MB)
Faster Startup
Lower Footprint
28
 Deployed as Bluemix App
 No changes to CF Infrastructure
 Cache Created Dynamically
 Zeroth instance creates cache
 Restage after cache creation
 Cache bundled into droplet
 Avoids “pull time”
 Avoids manual cache creation
 Extended to other artifacts (JSP precompile)
Cloud Environments – Cloud Foundry – Cache Server
The DCAS technique brings the second (scaled) instance up faster
DCAS speedup over default is 1.37: around 3 seconds faster
Request to restart at 120s
Restarts happen when a new service is installed
DCAS brings up the server online faster
The DCAS technique brings the second (restarted) instance up faster
DCAS speedup over default is again 1.37: around 4 seconds faster
33
Questions
Copyrights and Trademarks
© IBM Corporation 2015. All Rights Reserved
IBM, the IBM logo, ibm.com are trademarks or registered
trademarks of International Business Machines Corp.,
registered in many jurisdictions worldwide. Other product and
service names might be trademarks of IBM or other companies.
A current list of IBM trademarks is available on the Web at
“Copyright and trademark information” at
www.ibm.com/legal/copytrade.shtml
Node.js is an official trademark of Joyent. IBM SDK for Node.js is not formally
related to or endorsed by the official Joyent Node.js open source or
commercial project.
Java, JavaScript and all Java-based trademarks and logos are trademarks or
registered trademarks of Oracle and/or its affiliates.

More Related Content

What's hot

Introduction to automated environment management with Docker Containers - for...
Introduction to automated environment management with Docker Containers - for...Introduction to automated environment management with Docker Containers - for...
Introduction to automated environment management with Docker Containers - for...
Lucas Jellema
 
CloudStack Day Japan 2015 - Hypervisor Selection in CloudStack 4.5
CloudStack Day Japan 2015 - Hypervisor Selection in CloudStack 4.5CloudStack Day Japan 2015 - Hypervisor Selection in CloudStack 4.5
CloudStack Day Japan 2015 - Hypervisor Selection in CloudStack 4.5
Tim Mackey
 
Server 2016 sneak peek
Server 2016 sneak peekServer 2016 sneak peek
Server 2016 sneak peek
Michael Rüefli
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
Hiroki Endo
 
Advanced Docker Developer Workflows on MacOS X and Windows
Advanced Docker Developer Workflows on MacOS X and WindowsAdvanced Docker Developer Workflows on MacOS X and Windows
Advanced Docker Developer Workflows on MacOS X and Windows
Anil Madhavapeddy
 
Oscon 2012 : From Datacenter to the Cloud - Featuring Xen and XCP
Oscon 2012 : From Datacenter to the Cloud - Featuring Xen and XCPOscon 2012 : From Datacenter to the Cloud - Featuring Xen and XCP
Oscon 2012 : From Datacenter to the Cloud - Featuring Xen and XCP
The Linux Foundation
 
Xen @ Google, 2011
Xen @ Google, 2011Xen @ Google, 2011
Xen @ Google, 2011
The Linux Foundation
 
Docker on Power Systems
Docker on Power SystemsDocker on Power Systems
Docker on Power Systems
Cesar Maciel
 
3 Dia Livre - Implementando Nuvens Privadas com XCP 1.1
3 Dia Livre - Implementando Nuvens Privadas com XCP 1.13 Dia Livre - Implementando Nuvens Privadas com XCP 1.1
3 Dia Livre - Implementando Nuvens Privadas com XCP 1.1
Lorscheider Santiago
 
Xen ATG case study
Xen ATG case studyXen ATG case study
Xen ATG case study
The Linux Foundation
 
Palestra Técnica do CISL - Xen Cloud Platform - Implementando Nuvens Privadas...
Palestra Técnica do CISL - Xen Cloud Platform - Implementando Nuvens Privadas...Palestra Técnica do CISL - Xen Cloud Platform - Implementando Nuvens Privadas...
Palestra Técnica do CISL - Xen Cloud Platform - Implementando Nuvens Privadas...
Lorscheider Santiago
 
Performance Benchmarking of Clouds Evaluating OpenStack
Performance Benchmarking of Clouds                Evaluating OpenStackPerformance Benchmarking of Clouds                Evaluating OpenStack
Performance Benchmarking of Clouds Evaluating OpenStack
Pradeep Kumar
 
Introduction to the xen cloud platform - xcp
Introduction to the xen cloud platform - xcpIntroduction to the xen cloud platform - xcp
Introduction to the xen cloud platform - xcp
Lorscheider Santiago
 
BSDcon Asia 2015: Xen on FreeBSD
BSDcon Asia 2015: Xen on FreeBSDBSDcon Asia 2015: Xen on FreeBSD
BSDcon Asia 2015: Xen on FreeBSD
The Linux Foundation
 
BACD July 2012 : The Xen Cloud Platform
BACD July 2012 : The Xen Cloud Platform BACD July 2012 : The Xen Cloud Platform
BACD July 2012 : The Xen Cloud Platform
The Linux Foundation
 
Ceph, Xen, and CloudStack: Semper Melior-XPUS13 McGarry
Ceph, Xen, and CloudStack: Semper Melior-XPUS13 McGarryCeph, Xen, and CloudStack: Semper Melior-XPUS13 McGarry
Ceph, Xen, and CloudStack: Semper Melior-XPUS13 McGarry
The Linux Foundation
 
Docker Architecture (v1.3)
Docker Architecture (v1.3)Docker Architecture (v1.3)
Docker Architecture (v1.3)
rajdeep
 
Cloud Computing Hypervisors and Comparison Xen KVM
Cloud Computing Hypervisors and Comparison Xen KVM Cloud Computing Hypervisors and Comparison Xen KVM
Cloud Computing Hypervisors and Comparison Xen KVM
cloudresearcher
 
S4 xen hypervisor_20080622
S4 xen hypervisor_20080622S4 xen hypervisor_20080622
S4 xen hypervisor_20080622
Todd Deshane
 

What's hot (20)

Introduction to automated environment management with Docker Containers - for...
Introduction to automated environment management with Docker Containers - for...Introduction to automated environment management with Docker Containers - for...
Introduction to automated environment management with Docker Containers - for...
 
CloudStack Day Japan 2015 - Hypervisor Selection in CloudStack 4.5
CloudStack Day Japan 2015 - Hypervisor Selection in CloudStack 4.5CloudStack Day Japan 2015 - Hypervisor Selection in CloudStack 4.5
CloudStack Day Japan 2015 - Hypervisor Selection in CloudStack 4.5
 
Server 2016 sneak peek
Server 2016 sneak peekServer 2016 sneak peek
Server 2016 sneak peek
 
Xen time machine
Xen time machineXen time machine
Xen time machine
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Advanced Docker Developer Workflows on MacOS X and Windows
Advanced Docker Developer Workflows on MacOS X and WindowsAdvanced Docker Developer Workflows on MacOS X and Windows
Advanced Docker Developer Workflows on MacOS X and Windows
 
Oscon 2012 : From Datacenter to the Cloud - Featuring Xen and XCP
Oscon 2012 : From Datacenter to the Cloud - Featuring Xen and XCPOscon 2012 : From Datacenter to the Cloud - Featuring Xen and XCP
Oscon 2012 : From Datacenter to the Cloud - Featuring Xen and XCP
 
Xen @ Google, 2011
Xen @ Google, 2011Xen @ Google, 2011
Xen @ Google, 2011
 
Docker on Power Systems
Docker on Power SystemsDocker on Power Systems
Docker on Power Systems
 
3 Dia Livre - Implementando Nuvens Privadas com XCP 1.1
3 Dia Livre - Implementando Nuvens Privadas com XCP 1.13 Dia Livre - Implementando Nuvens Privadas com XCP 1.1
3 Dia Livre - Implementando Nuvens Privadas com XCP 1.1
 
Xen ATG case study
Xen ATG case studyXen ATG case study
Xen ATG case study
 
Palestra Técnica do CISL - Xen Cloud Platform - Implementando Nuvens Privadas...
Palestra Técnica do CISL - Xen Cloud Platform - Implementando Nuvens Privadas...Palestra Técnica do CISL - Xen Cloud Platform - Implementando Nuvens Privadas...
Palestra Técnica do CISL - Xen Cloud Platform - Implementando Nuvens Privadas...
 
Performance Benchmarking of Clouds Evaluating OpenStack
Performance Benchmarking of Clouds                Evaluating OpenStackPerformance Benchmarking of Clouds                Evaluating OpenStack
Performance Benchmarking of Clouds Evaluating OpenStack
 
Introduction to the xen cloud platform - xcp
Introduction to the xen cloud platform - xcpIntroduction to the xen cloud platform - xcp
Introduction to the xen cloud platform - xcp
 
BSDcon Asia 2015: Xen on FreeBSD
BSDcon Asia 2015: Xen on FreeBSDBSDcon Asia 2015: Xen on FreeBSD
BSDcon Asia 2015: Xen on FreeBSD
 
BACD July 2012 : The Xen Cloud Platform
BACD July 2012 : The Xen Cloud Platform BACD July 2012 : The Xen Cloud Platform
BACD July 2012 : The Xen Cloud Platform
 
Ceph, Xen, and CloudStack: Semper Melior-XPUS13 McGarry
Ceph, Xen, and CloudStack: Semper Melior-XPUS13 McGarryCeph, Xen, and CloudStack: Semper Melior-XPUS13 McGarry
Ceph, Xen, and CloudStack: Semper Melior-XPUS13 McGarry
 
Docker Architecture (v1.3)
Docker Architecture (v1.3)Docker Architecture (v1.3)
Docker Architecture (v1.3)
 
Cloud Computing Hypervisors and Comparison Xen KVM
Cloud Computing Hypervisors and Comparison Xen KVM Cloud Computing Hypervisors and Comparison Xen KVM
Cloud Computing Hypervisors and Comparison Xen KVM
 
S4 xen hypervisor_20080622
S4 xen hypervisor_20080622S4 xen hypervisor_20080622
S4 xen hypervisor_20080622
 

Similar to Java one 2015 - v1

Dockerization of Azure Platform
Dockerization of Azure PlatformDockerization of Azure Platform
Dockerization of Azure Platform
nirajrules
 
Docker for developers
Docker for developersDocker for developers
Docker for developers
andrzejsydor
 
Scaleable PHP Applications in Kubernetes
Scaleable PHP Applications in KubernetesScaleable PHP Applications in Kubernetes
Scaleable PHP Applications in Kubernetes
Robert Lemke
 
Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 application
Roman Rodomansky
 
gDBClone - Database Clone “onecommand Automation Tool”
gDBClone - Database Clone “onecommand Automation Tool”gDBClone - Database Clone “onecommand Automation Tool”
gDBClone - Database Clone “onecommand Automation Tool”
Ruggero Citton
 
Improving Development and Deployment with Docker
Improving Development and Deployment with DockerImproving Development and Deployment with Docker
Improving Development and Deployment with Docker
Irfad Razick
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
Rafael Konlechner
 
docker
dockerdocker
docker
Cesar Maciel
 
Scalable Web Architecture
Scalable Web ArchitectureScalable Web Architecture
Scalable Web Architecture
Aleksandr Tsertkov
 
Containers, Docker, and Microservices: the Terrific Trio
Containers, Docker, and Microservices: the Terrific TrioContainers, Docker, and Microservices: the Terrific Trio
Containers, Docker, and Microservices: the Terrific Trio
Jérôme Petazzoni
 
Docker Introduction SDP 12-2015
Docker  Introduction  SDP 12-2015Docker  Introduction  SDP 12-2015
Docker Introduction SDP 12-2015
Rotem Or
 
Guaranteeing CloudStack Storage Performance
Guaranteeing CloudStack Storage Performance Guaranteeing CloudStack Storage Performance
Guaranteeing CloudStack Storage Performance
NetApp
 
Docker San Francisco Meetup April 2015 - The Docker Orchestration Ecosystem o...
Docker San Francisco Meetup April 2015 - The Docker Orchestration Ecosystem o...Docker San Francisco Meetup April 2015 - The Docker Orchestration Ecosystem o...
Docker San Francisco Meetup April 2015 - The Docker Orchestration Ecosystem o...
Patrick Chanezon
 
Getting Started with MariaDB with Docker
Getting Started with MariaDB with DockerGetting Started with MariaDB with Docker
Getting Started with MariaDB with Docker
MariaDB plc
 
Drupal PT Meetup Lisbon (December 2011)
Drupal PT Meetup Lisbon (December 2011)Drupal PT Meetup Lisbon (December 2011)
Drupal PT Meetup Lisbon (December 2011)
Paulo Gomes
 
Accelerate your development with Docker
Accelerate your development with DockerAccelerate your development with Docker
Accelerate your development with Docker
Andrey Hristov
 
Accelerate your software development with Docker
Accelerate your software development with DockerAccelerate your software development with Docker
Accelerate your software development with Docker
Andrey Hristov
 
Weave User Group Talk - DockerCon 2017 Recap
Weave User Group Talk - DockerCon 2017 RecapWeave User Group Talk - DockerCon 2017 Recap
Weave User Group Talk - DockerCon 2017 Recap
Patrick Chanezon
 
Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14
Simon Storm
 
Docker 101 Checonf 2016
Docker 101 Checonf 2016Docker 101 Checonf 2016
Docker 101 Checonf 2016
Patrick Chanezon
 

Similar to Java one 2015 - v1 (20)

Dockerization of Azure Platform
Dockerization of Azure PlatformDockerization of Azure Platform
Dockerization of Azure Platform
 
Docker for developers
Docker for developersDocker for developers
Docker for developers
 
Scaleable PHP Applications in Kubernetes
Scaleable PHP Applications in KubernetesScaleable PHP Applications in Kubernetes
Scaleable PHP Applications in Kubernetes
 
Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 application
 
gDBClone - Database Clone “onecommand Automation Tool”
gDBClone - Database Clone “onecommand Automation Tool”gDBClone - Database Clone “onecommand Automation Tool”
gDBClone - Database Clone “onecommand Automation Tool”
 
Improving Development and Deployment with Docker
Improving Development and Deployment with DockerImproving Development and Deployment with Docker
Improving Development and Deployment with Docker
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
docker
dockerdocker
docker
 
Scalable Web Architecture
Scalable Web ArchitectureScalable Web Architecture
Scalable Web Architecture
 
Containers, Docker, and Microservices: the Terrific Trio
Containers, Docker, and Microservices: the Terrific TrioContainers, Docker, and Microservices: the Terrific Trio
Containers, Docker, and Microservices: the Terrific Trio
 
Docker Introduction SDP 12-2015
Docker  Introduction  SDP 12-2015Docker  Introduction  SDP 12-2015
Docker Introduction SDP 12-2015
 
Guaranteeing CloudStack Storage Performance
Guaranteeing CloudStack Storage Performance Guaranteeing CloudStack Storage Performance
Guaranteeing CloudStack Storage Performance
 
Docker San Francisco Meetup April 2015 - The Docker Orchestration Ecosystem o...
Docker San Francisco Meetup April 2015 - The Docker Orchestration Ecosystem o...Docker San Francisco Meetup April 2015 - The Docker Orchestration Ecosystem o...
Docker San Francisco Meetup April 2015 - The Docker Orchestration Ecosystem o...
 
Getting Started with MariaDB with Docker
Getting Started with MariaDB with DockerGetting Started with MariaDB with Docker
Getting Started with MariaDB with Docker
 
Drupal PT Meetup Lisbon (December 2011)
Drupal PT Meetup Lisbon (December 2011)Drupal PT Meetup Lisbon (December 2011)
Drupal PT Meetup Lisbon (December 2011)
 
Accelerate your development with Docker
Accelerate your development with DockerAccelerate your development with Docker
Accelerate your development with Docker
 
Accelerate your software development with Docker
Accelerate your software development with DockerAccelerate your software development with Docker
Accelerate your software development with Docker
 
Weave User Group Talk - DockerCon 2017 Recap
Weave User Group Talk - DockerCon 2017 RecapWeave User Group Talk - DockerCon 2017 Recap
Weave User Group Talk - DockerCon 2017 Recap
 
Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14
 
Docker 101 Checonf 2016
Docker 101 Checonf 2016Docker 101 Checonf 2016
Docker 101 Checonf 2016
 

More from Michael Dawson

Index 2018 talk to your code
Index 2018   talk to your codeIndex 2018   talk to your code
Index 2018 talk to your code
Michael Dawson
 
Index 2018 node.js what's next
Index 2018   node.js what's nextIndex 2018   node.js what's next
Index 2018 node.js what's next
Michael Dawson
 
N api - node interactive 2017
N api - node interactive 2017N api - node interactive 2017
N api - node interactive 2017
Michael Dawson
 
N api-node summit-2017-final
N api-node summit-2017-finalN api-node summit-2017-final
N api-node summit-2017-final
Michael Dawson
 
Accelerate your digital transformation
Accelerate your digital transformationAccelerate your digital transformation
Accelerate your digital transformation
Michael Dawson
 
Ask us anything v9
Ask us anything v9Ask us anything v9
Ask us anything v9
Michael Dawson
 
Node.js Community Benchmarking WG update
Node.js Community  Benchmarking WG updateNode.js Community  Benchmarking WG update
Node.js Community Benchmarking WG update
Michael Dawson
 
Cascon intro
Cascon introCascon intro
Cascon intro
Michael Dawson
 
A294 fips support in node
A294  fips support in nodeA294  fips support in node
A294 fips support in node
Michael Dawson
 
A295 nodejs-knowledge-accelerator
A295   nodejs-knowledge-acceleratorA295   nodejs-knowledge-accelerator
A295 nodejs-knowledge-accelerator
Michael Dawson
 
A301 ctu madrid2016-monitoring
A301 ctu madrid2016-monitoringA301 ctu madrid2016-monitoring
A301 ctu madrid2016-monitoring
Michael Dawson
 
Post mortem talk - Node Interactive EU
Post mortem talk - Node Interactive EUPost mortem talk - Node Interactive EU
Post mortem talk - Node Interactive EU
Michael Dawson
 
Update from-build-workgroup
Update from-build-workgroupUpdate from-build-workgroup
Update from-build-workgroup
Michael Dawson
 
Node fips
Node fipsNode fips
Node fips
Michael Dawson
 
Micro app-framework - NodeLive Boston
Micro app-framework - NodeLive BostonMicro app-framework - NodeLive Boston
Micro app-framework - NodeLive Boston
Michael Dawson
 
Node liveboston welcome
Node liveboston welcomeNode liveboston welcome
Node liveboston welcome
Michael Dawson
 
Micro app-framework
Micro app-frameworkMicro app-framework
Micro app-framework
Michael Dawson
 
Node home automation with Node.js and MQTT
Node home automation with Node.js and MQTTNode home automation with Node.js and MQTT
Node home automation with Node.js and MQTT
Michael Dawson
 

More from Michael Dawson (18)

Index 2018 talk to your code
Index 2018   talk to your codeIndex 2018   talk to your code
Index 2018 talk to your code
 
Index 2018 node.js what's next
Index 2018   node.js what's nextIndex 2018   node.js what's next
Index 2018 node.js what's next
 
N api - node interactive 2017
N api - node interactive 2017N api - node interactive 2017
N api - node interactive 2017
 
N api-node summit-2017-final
N api-node summit-2017-finalN api-node summit-2017-final
N api-node summit-2017-final
 
Accelerate your digital transformation
Accelerate your digital transformationAccelerate your digital transformation
Accelerate your digital transformation
 
Ask us anything v9
Ask us anything v9Ask us anything v9
Ask us anything v9
 
Node.js Community Benchmarking WG update
Node.js Community  Benchmarking WG updateNode.js Community  Benchmarking WG update
Node.js Community Benchmarking WG update
 
Cascon intro
Cascon introCascon intro
Cascon intro
 
A294 fips support in node
A294  fips support in nodeA294  fips support in node
A294 fips support in node
 
A295 nodejs-knowledge-accelerator
A295   nodejs-knowledge-acceleratorA295   nodejs-knowledge-accelerator
A295 nodejs-knowledge-accelerator
 
A301 ctu madrid2016-monitoring
A301 ctu madrid2016-monitoringA301 ctu madrid2016-monitoring
A301 ctu madrid2016-monitoring
 
Post mortem talk - Node Interactive EU
Post mortem talk - Node Interactive EUPost mortem talk - Node Interactive EU
Post mortem talk - Node Interactive EU
 
Update from-build-workgroup
Update from-build-workgroupUpdate from-build-workgroup
Update from-build-workgroup
 
Node fips
Node fipsNode fips
Node fips
 
Micro app-framework - NodeLive Boston
Micro app-framework - NodeLive BostonMicro app-framework - NodeLive Boston
Micro app-framework - NodeLive Boston
 
Node liveboston welcome
Node liveboston welcomeNode liveboston welcome
Node liveboston welcome
 
Micro app-framework
Micro app-frameworkMicro app-framework
Micro app-framework
 
Node home automation with Node.js and MQTT
Node home automation with Node.js and MQTTNode home automation with Node.js and MQTT
Node home automation with Node.js and MQTT
 

Recently uploaded

みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 

Recently uploaded (20)

みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 

Java one 2015 - v1

  • 1. Michael Dawson October 2015 Leveraging Java Optimizations to Improve Density in Cloud Environments
  • 2. About Michael Dawson Loves the web and building software 2 Senior Software Developer @ IBM 23 years development experience 11 years in runtime development Contact me: Michael_dawson@ca.ibm.com Twitter: @mhdawson1 https://www.linkedin.com/pub/michael-dawson/2/128/605
  • 3. 3 • Motivation • Shared Classes • Cloud Environments • Docker • Cloud Foundry • Leveraging SC in Cloud Agenda
  • 4. 4 • Startup affects customers •- Restart •- Scale out • Footprint affects cost • Lots of small apps Motivation
  • 5. IBM SDK for Java java -Xshareclasses:name=myHelloApp -jar 5 Shared Classes No -Xshareclasses -Xshareclasses(1st run) -Xshareclasses 0 200 400 600 800 1000 1200 1400 1600 Java 70 Tomcat Startup Linux x86_64 Time(ms) Faster Startup Smaller Footprint
  • 6. 6 Shared Classes • What • Read only part of Class • Class File Bytes • String De-duplication • Jit Data (AOT) • Class Debug Data (separate) • How • SysV Shared Memory (e.g. on z/OS) • POSIX mmap (e.g. on Linux and AIX) • CreateFileMapping (e.g. on Windows)
  • 7. 7 Shared Classes – Faster Startup • Classloading Time • Read from disk • Parse • Create in-memory representation • JIT artifacts • Methods initially run interpreted • 1000’s of methods are JIT compiled • Start-up methods same run to run • Why compile over and over ? • Metadata to guide compilation
  • 8. 8 Shared Classes – Lower Footprint Heap Object Instances (e.g. tmp) JIT Code & Data Cache Shared Class Data Byte Codes (e.g. MyObject) JVM Process Memory Heap Object Instances (e.g. tmp) JIT Code & Data Cache Shared Class Data Byte Codes (e.g. MyObject) JVM Process Memory Shared Class Data Byte Codes (e.g. MyObject)
  • 10. 10 Cloud Environments – Bare Metal Multiple Apps Common Shared storage and memory Shared Classes works by default A P P 1 A P P N Faster Startup Lower Footprint
  • 11. 11 Cloud Environments – Virtual Machine Smaller deployment units (+) Memory not shared across VMs Storage not shared across VMs A P P 1 A P P N VM1 VMn Shared Classes – Reduced Effectiveness Faster Startup Lower Footprint
  • 12. 12 Cloud Environments - Docker Base OS (ex Ubuntu 14) Middleware Application Application https://hub.docker.com/_/websphere-liberty/ https://hub.docker.com/_/ubuntu/ A P P 1 A P P N CONT1 CONTn Middleware Base OS Images Application State1 Staten Containers
  • 13. 13 Cloud Environments – Docker Demo Docker images Docker ps Start/stop show state not preserved
  • 14. 14 Cloud Environments – Docker Even smaller deployment units (++) Memory not shared across VMs Storage not persistent A P P 1 A P P N CONT1 CONTn Shared Classes – Reduced Effectiveness Faster Startup Lower Footprint
  • 15. 15 Cloud Environments – PaaS – Cloud Foundry Staging -> buildpack creates Droplet Start or Scale Droplet to DEA, Extract Droplet Warden with droplet contents Droplet size affects push/startup times
  • 16. 16 Cloud Environments – Cloud Foundry
  • 17. 17 Cloud Environments – PaaS Even smaller deployment units (+++) Memory not shared across VMs Storage not persistent A P P 1 A P P N Warden1 Shared Classes – Reduced Effectiveness Faster Startup Lower Footprint WardenN
  • 18. 18 Cloud Environments – What’s different Persistent Storage Shared Storage Shared Memory Bare Metal X X X Virtual Machines X Docker PaaS
  • 19. 19 Cloud Environments – What can we do ? Start-up Persistent Storage ->Generate Dynamically Add cache sharing mechanism Shared storage Cache server Bundle pre-built cache Populate through warm up Extra disk footprint
  • 20. 20 Cloud Environments – What can we do ? Footprint Transparent Page sharing at OS Bundled pre-built cache Cache sharing mechanism Guided build Share Memory across containers/wardens V i r t 1 V i r t 2 V i r t N p h y s
  • 21. 21 Cloud Environments – Virtual Machines  Persistent storage – Startup benefit by default  Memory - build Cache to Enable sharing through TPS Pre-created, bundled or cache server Guide creation to end up with same result  To read more: http://www.computer.org/csdl/proceedings/ispass/2013/5 776/00/06557144.pdf
  • 22. 22 Cloud Environments - Docker Startup – shared cache pre-built (read-only) Footprint – Share memory across container ! Shared Cache disk file from shared layer Memory mapping results in shared memory Validated through lsof and /proc/pid/smaps
  • 23. 23 Cloud Environments - Docker A P P 1 A P P N CONT1 CONTn Liberty, JVM, Cache Base OS Application State1 Staten In Memory cache !!  Middleware Image with:  JVM  Liberty  Pre-built Shared Cache  Cache Read-only  File system back end with right properties (ex aufs)
  • 24. 24 1 2 3 4 5 6 7 8 9 10 0 200 400 600 800 1000 1200 1400 Used Memory (PSS) Share NoShare NoShareNoCache Cloud Environments – Docker 1 2 3 4 5 6 7 8 9 10 0 5 10 15 20 25 Startup Times Share NoShare NoShareNoCache Share: Shared cache pre-created and including in base layer – -Xshareclasses:cacheDir=/usr/lib/liberty-java/caches,name=cache1,enableBCI NoShare: cached created dynamically -Xshareclasses NoShareNoCache: No cache -Xshareclasses:none Faster Startup Lower Footprint
  • 25. 25 Cloud Environments – Cloud Foundry  Experimented with 2 optimizations so far  Share memory across wardens  Requires changes to CF installation  Cache server  Joint work with CAS Atlantic http://www.unb.ca/research/casatlantic/index.html  Panagiotis Patros, Kenneth Kent
  • 26. 26 Cloud Environments – Cloud Foundry – Share Memory  JVM, Liberty Cashed installed on DEA  Mapping options  Same File available in all Wardens  Memory map of same file -> shared memory across Wardens  R/O due to security concerns - src_path: /var/vcap/packages/ibmjvm64 dst_path: /tmp/jvms/ibmjvm64 mode: ro src_path: /var/vcap/packages/ibmClassCaches dst_path: /tmp/jvms/ibmClassCaches mode: ro - src_path: /var/vcap/packages/liberty dst_path: /tmp/liberty mode: ro
  • 27. 27 Cloud Environments – Cloud Foundry – Share Memory 0 2 4 6 8 10 12 14 16 18 20 No Sharing Sharing Libraries Sharing Libraries and Cache Start times (seconds) 0 20 40 60 80 100 120 140 160 180 200 No Sharing Sharing Libraries Sharing Libraries and Cache Resident Set Size (MB) Faster Startup Lower Footprint
  • 28. 28  Deployed as Bluemix App  No changes to CF Infrastructure  Cache Created Dynamically  Zeroth instance creates cache  Restage after cache creation  Cache bundled into droplet  Avoids “pull time”  Avoids manual cache creation  Extended to other artifacts (JSP precompile) Cloud Environments – Cloud Foundry – Cache Server
  • 29.
  • 30. The DCAS technique brings the second (scaled) instance up faster DCAS speedup over default is 1.37: around 3 seconds faster
  • 31. Request to restart at 120s Restarts happen when a new service is installed DCAS brings up the server online faster
  • 32. The DCAS technique brings the second (restarted) instance up faster DCAS speedup over default is again 1.37: around 4 seconds faster
  • 34. Copyrights and Trademarks © IBM Corporation 2015. All Rights Reserved IBM, the IBM logo, ibm.com are trademarks or registered trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at “Copyright and trademark information” at www.ibm.com/legal/copytrade.shtml Node.js is an official trademark of Joyent. IBM SDK for Node.js is not formally related to or endorsed by the official Joyent Node.js open source or commercial project. Java, JavaScript and all Java-based trademarks and logos are trademarks or registered trademarks of Oracle and/or its affiliates.