SlideShare a Scribd company logo
Automated Scaling of Microservice Stacks 

for
JavaEE Applications
by Ihor Kolodyuk
Few words about me …
Driving technology direction at Jelastic
Like to solve unsolvable problems
Checking technology concepts on practice
Why I am here?
I want to talk to you about:
General autoscaling concept for JavaEE applications
Real use cases. Real issues. Tricky things
My goals are:
Save your time if you decide you need to scale your app
Share our own experience
I just deploy my application to Docker, set a number of replicas and
… have it running … bla bla bla … super easy! Done!
The myth
Yes, pretty easy …

If you need a super scalable and clustered Hello World application …
In real life with JavaEE application
we have architecture similar to this
and its autoscaling becomes not a very trivial task…
The truth
Legacy Application
Scalable Cluster
Autoscalable Cluster
Theoretical part
At least 3 key things to make your
applications scalable
First:
Adapted runtime
(Container + JVM + JavaEE Server)
micro
Preferably, thin versions of application servers
YES!NO!
micro
glassfish
There are various versions adapted
for lightweight containers
Any specific reason to use
VMs for microservices?
NO!
Well…it might be, but …
What should we use instead?
YES!
One container - one microservice
instance
YES! NO!
Second:
Application
prepared for microservices
APP
MS
MS MS
MS
SORRY,
Application
prepared for SCALABLE microservices
Next few slides can be a bit boring for those
who know…
BUT
Still important!!!!!!
Ideal scaling and decomposition
horizontal
vertical
topology
Decomposition into microservice
At least 2 key approaches
Logical division
Splitting bigger parts into smaller
1.Analyse metrics (NewRelic / JavaVisualVM)
2.Find a weak point (!)
3.Move this part to microservice
4.Repeat
Third:
Orchestration software
What it typically does?
CONTAINERS

PROVISIONING
HEALTHCHECKS
METRICS

GATHERING
APPLICATION 

LIFECYCLE

MANAGEMENT
SCALING
AUTOMATIC 

LOAD

BALANCING
SERVICE

DISCOVERY

&

CONNECTIVITY
CUSTOM
SCRIPTING*
Typical triggers that are used for scaling
CPU RAM
HDD

(disk I/O)
NETWORK
SERVICE

FAILURE
SCHEDULER
Practical part
Tricky things
Typical issues
Examples 

Tricky thing #1
In which direction to scale?
horizontal
vertical
topology
Example #1
Message Queue Service
Triggers configuration
CPU
RAM
HDD (disk I/O)
NETWORK
SCHEDULER YES
NO
PROBABLY NO
GENERAL SET
GENERAL SET
Scaling type HORIZONTAL
Tricky place
Example #2
Databases
CPU
RAM
HDD (disk I/O)
NETWORK
SCHEDULER
YES
VERTICAL
NO
NO
NO
Scaling type
Triggers configuration
YES
Typical issues while scaling of database instances
Takes much time to sync data
Temporary locks
Temporary performance degradation
Hard to use auto horizontal scaling
Automatic vertical scaling can be used just fine
It’s better to keep spare instances underloaded
(dedicated storage per instance)
RESUME
Example #3
Legacy JavaEE application
TOPOLOGY
Java EE Server
Business Tier
Web Tier
JSP App1 JSP App2 JSP App2
EJB App1 EJB App2
Java EE 

Micro Instance
JSP App1
Java EE 

Micro Instance
JSP App1
Java EE 

Micro Instance
JSP App1
Java EE 

Micro Instance
JSP App1
Java EE 

Micro Instance
JSP App1
Java EE 

Micro Instance
JSP App2
Java EE 

Micro Instance
JSP App1
Java EE 

Micro Instance
JSP App1
Java EE 

Micro Instance
EJB App2
Java EE 

Micro Instance
JSP App1
Java EE 

Micro Instance
JSP App1
Java EE 

Micro Instance
EJB App2
Scaling type
Tricky thing #2
Events subscription
Usually, just spinning up an extra instance is NOTenough
Example #1
Typical ScaleIn/ScaleOut events and cases
onAfterScaleOut[nodeGroup:ejb-app1] {
“call”: “registerNodeInMonitoringSystem”,
“call”: “addMemberToHazelcast”,
“call”: “call3rdPartyApiService”
}
onAfterScaleIn[nodeGroup:jsp-app2] {
“call”: “removeNodeFromMonitoringSystem”,
“call”: “removeMemberFromHazelcast”
}
THE FULL WORKING AND MORE COMPLEX CODE EXAMPLE CAN BE FOUND HERE
Example #2
2. Get auth keys by instance before joining DAS
onBeforeStartService[nodeGroup:instance] {
“cmd”: “/root/scripts/pullAccessKeys.sh ${token}”
}
THE FULL WORKING AND MORE COMPLEX CODE EXAMPLE CAN BE FOUND HERE
1. Decrypt encrypted volume, that was attached on-fly
onAfterVolumeAttached[nodeGroup:instance] {
“call”: “decryptVolume”
}
3. Deprovision node from DAS if cluster was shrinked
onAfterScaleOut[nodeGroup:das] {
“cmd”: “./asadmin_proxy remove ${instance[@last].ip}”
}
Tricky thing #3
Proper triggers configuration
This tuning is a long process, so be patient
Typical problem #1
Changing the value in one place can be reflected in other places
How to deal with this?
Load Testing
Gathering

Metrics
Detect deviations in a testing loop
Analyzing

Metrics
Edit
Triggers
Com
pare previous 

results
Typical problem #2
The triggers can become outdated with new code
The fix is easy here
Inject metrics collection as a part of your CI/CD step
COMMIT BUILD TESTING
PERFORMANCE

ANALYSIS
DELIVERY
Tricky thing #4
Getting rid of spare things
Typical problem #1
Network is full of useless traffic
Total bandwidth
Multicast | Heartbeats
Useful traffic
What we can do?
Avoid multicast (for members detection)
Use events and static members lists
Static members list Static members list Static members list
Orchestrator
Typical problem #2
Some of JavaEE Servers are designed for VMs, not for containers
On example of Weblogic
VM VM VM VM
What is the right way to go?
Just remove everything spare
LIVE demo comes here
QUESTIONS
CONTACTS
http://jelastic.com ihor.kolodyuk@jelastic.com

More Related Content

PDF
From VMs to Containers: Decompose and Migrate Old Legacy JavaEE Application
PDF
How to Make Money Solving 5 Major Problems of Cloud Hosting Customers
PDF
Automated Scaling of Microservice Stacks for JavaEE Applications
PPTX
Structured Container Delivery by Oscar Renalias, Accenture
PDF
Proof of Concept: Serverless with Swarm by Nirmal Mehta, Booz Allen Hamilton
PPTX
Containers and VMs and Clouds: Oh My. by Mike Coleman
PPTX
Docker for Ops: Docker Networking Deep Dive, Considerations and Troubleshooti...
PPTX
How (and why) to roll your own Docker SaaS
From VMs to Containers: Decompose and Migrate Old Legacy JavaEE Application
How to Make Money Solving 5 Major Problems of Cloud Hosting Customers
Automated Scaling of Microservice Stacks for JavaEE Applications
Structured Container Delivery by Oscar Renalias, Accenture
Proof of Concept: Serverless with Swarm by Nirmal Mehta, Booz Allen Hamilton
Containers and VMs and Clouds: Oh My. by Mike Coleman
Docker for Ops: Docker Networking Deep Dive, Considerations and Troubleshooti...
How (and why) to roll your own Docker SaaS

What's hot (20)

PDF
Microservices + Events + Docker = A Perfect Trio by Docker Captain Chris Rich...
PDF
Highly Available Persistent Applications in Containers by Kendrick Coleman, E...
PPTX
The Mushroom Cloud Effect or What Happens When Containers Fail? by Alois Mayr...
PDF
Infinit's Next Generation Key-value Store - Julien Quintard and Quentin Hocqu...
PDF
Aks pimarox from zero to hero
ODP
Practical Container Security by Mrunal Patel and Thomas Cameron, Red Hat
PDF
DCSF19 Container Security: Theory & Practice at Netflix
PPTX
Containers: Life Beyond Microservices? by Sushil Kumar, Robin Systems
PPTX
Docker Practice in Alibaba Cloud by Li Yi (Mark) & Zuhe Li (Sogo)
PPT
Sebastien goasguen cloud stack the next year
PDF
Securing the Container Pipeline at Salesforce by Cem Gurkok
PDF
DCEU 18: App-in-a-Box with Docker Application Packages
PDF
Docker on Docker
PPTX
Container Orchestration with Docker Swarm and Kubernetes
PPTX
A New Centralized Volume Storage Solution for Docker and Container Cloud by W...
PDF
Production Ready Containers from IBM and Docker
PDF
Wido den hollander cloud stack and ceph
PPTX
Adf with docker
PPTX
Docker - A curtain raiser to the Container world
PDF
How to accelerate docker adoption with a simple and powerful user experience
Microservices + Events + Docker = A Perfect Trio by Docker Captain Chris Rich...
Highly Available Persistent Applications in Containers by Kendrick Coleman, E...
The Mushroom Cloud Effect or What Happens When Containers Fail? by Alois Mayr...
Infinit's Next Generation Key-value Store - Julien Quintard and Quentin Hocqu...
Aks pimarox from zero to hero
Practical Container Security by Mrunal Patel and Thomas Cameron, Red Hat
DCSF19 Container Security: Theory & Practice at Netflix
Containers: Life Beyond Microservices? by Sushil Kumar, Robin Systems
Docker Practice in Alibaba Cloud by Li Yi (Mark) & Zuhe Li (Sogo)
Sebastien goasguen cloud stack the next year
Securing the Container Pipeline at Salesforce by Cem Gurkok
DCEU 18: App-in-a-Box with Docker Application Packages
Docker on Docker
Container Orchestration with Docker Swarm and Kubernetes
A New Centralized Volume Storage Solution for Docker and Container Cloud by W...
Production Ready Containers from IBM and Docker
Wido den hollander cloud stack and ceph
Adf with docker
Docker - A curtain raiser to the Container world
How to accelerate docker adoption with a simple and powerful user experience
Ad

Similar to Automated scaling of microservice stacks for JavaEE applications - JEEConf 2017 (20)

PPTX
5 Quick Wins for the Cloud
PPT
Best Practices for performance evaluation and diagnosis of Java Applications ...
PDF
20141021 AWS Cloud Taekwon - Startup Best Practices on AWS
PDF
Austin Web Architecture
PDF
Multi-Cloud testing
PDF
Microservices for java architects it-symposium-2015-09-15
PPTX
patchVantage Cloud Starter Pack
PDF
Cloudy in Indonesia: Java and Cloud
PPTX
.NET Developer Days - So many Docker platforms, so little time...
PDF
Where Django Caching Bust at the Seams
PPTX
Greenfield Development with CQRS
PPTX
Planning to Fail #phpuk13
PDF
Divide and Conquer – Microservices with Node.js
PPT
Web Speed And Scalability
PPTX
Implementing dr w. hyper v clustering
PPTX
Windows Azure Acid Test
ODP
Virtualization Techniques & Cloud Compting
PPT
Infrastructure as Code to Maintain your Sanity
PDF
AWS Lambda from the Trenches
PPTX
Planning to Fail #phpne13
5 Quick Wins for the Cloud
Best Practices for performance evaluation and diagnosis of Java Applications ...
20141021 AWS Cloud Taekwon - Startup Best Practices on AWS
Austin Web Architecture
Multi-Cloud testing
Microservices for java architects it-symposium-2015-09-15
patchVantage Cloud Starter Pack
Cloudy in Indonesia: Java and Cloud
.NET Developer Days - So many Docker platforms, so little time...
Where Django Caching Bust at the Seams
Greenfield Development with CQRS
Planning to Fail #phpuk13
Divide and Conquer – Microservices with Node.js
Web Speed And Scalability
Implementing dr w. hyper v clustering
Windows Azure Acid Test
Virtualization Techniques & Cloud Compting
Infrastructure as Code to Maintain your Sanity
AWS Lambda from the Trenches
Planning to Fail #phpne13
Ad

More from Jelastic Multi-Cloud PaaS (20)

PDF
Running Projects in Application Containers, System Containers & VMs - Jelasti...
PDF
Running Java Applications inside Kubernetes with Nested Container Architectur...
PDF
MariaDB Auto-Clustering, Vertical and Horizontal Scaling within Jelastic PaaS
PDF
Scaling Jakarta EE Applications Vertically and Horizontally with Jelastic PaaS
PDF
State of Java Elasticity. Tuning Java Efficiency - GIDS.JAVA LIVE 2020
PDF
Kubernetes and Nested Containers: Enhanced 3 Ps (Performance, Price and Provi...
PDF
WordPress Cluster for Enterprise High-Availability and On-Demand Scaling
PDF
Elastic JVM for Scalable Java EE Applications Running in Containers #Jakart...
PDF
Choosing Right Garbage Collector to Increase Efficiency of Java Memory Usage
PDF
SaaSification in Action. Attracting Software Vendors with Easy Transformation
PDF
State of the Art UI - Overview of Jelastic PaaS Functionality
PDF
Multi-Cloud Lightweight Platform as a Service
PDF
Automating CICD Pipeline with GitLab and Docker Containers for Java Applications
PDF
Cloud Hosting Business in Africa: Market Specifics and Ways to Grow
PDF
Jelastic DevOps Platform Product Overview for Service Providers
PPSX
Auto Scaling for Multi-Tier Containers Topology
PDF
Jelastic DevOps Platform Product Overview for ISVs
PDF
DevOps Epoch 2016
PDF
Онлайн миграция контейнеров. Взгляд изнутри
PDF
Jelastic - DevOps PaaS Business with Docker Support for Service Providers
Running Projects in Application Containers, System Containers & VMs - Jelasti...
Running Java Applications inside Kubernetes with Nested Container Architectur...
MariaDB Auto-Clustering, Vertical and Horizontal Scaling within Jelastic PaaS
Scaling Jakarta EE Applications Vertically and Horizontally with Jelastic PaaS
State of Java Elasticity. Tuning Java Efficiency - GIDS.JAVA LIVE 2020
Kubernetes and Nested Containers: Enhanced 3 Ps (Performance, Price and Provi...
WordPress Cluster for Enterprise High-Availability and On-Demand Scaling
Elastic JVM for Scalable Java EE Applications Running in Containers #Jakart...
Choosing Right Garbage Collector to Increase Efficiency of Java Memory Usage
SaaSification in Action. Attracting Software Vendors with Easy Transformation
State of the Art UI - Overview of Jelastic PaaS Functionality
Multi-Cloud Lightweight Platform as a Service
Automating CICD Pipeline with GitLab and Docker Containers for Java Applications
Cloud Hosting Business in Africa: Market Specifics and Ways to Grow
Jelastic DevOps Platform Product Overview for Service Providers
Auto Scaling for Multi-Tier Containers Topology
Jelastic DevOps Platform Product Overview for ISVs
DevOps Epoch 2016
Онлайн миграция контейнеров. Взгляд изнутри
Jelastic - DevOps PaaS Business with Docker Support for Service Providers

Recently uploaded (20)

PPTX
Tartificialntelligence_presentation.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Empathic Computing: Creating Shared Understanding
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Electronic commerce courselecture one. Pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Big Data Technologies - Introduction.pptx
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
A Presentation on Artificial Intelligence
Tartificialntelligence_presentation.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
Empathic Computing: Creating Shared Understanding
Unlocking AI with Model Context Protocol (MCP)
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Electronic commerce courselecture one. Pdf
Network Security Unit 5.pdf for BCA BBA.
SOPHOS-XG Firewall Administrator PPT.pptx
Approach and Philosophy of On baking technology
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Encapsulation_ Review paper, used for researhc scholars
Reach Out and Touch Someone: Haptics and Empathic Computing
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Big Data Technologies - Introduction.pptx
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Building Integrated photovoltaic BIPV_UPV.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
A Presentation on Artificial Intelligence

Automated scaling of microservice stacks for JavaEE applications - JEEConf 2017

  • 1. Automated Scaling of Microservice Stacks 
 for JavaEE Applications by Ihor Kolodyuk
  • 2. Few words about me … Driving technology direction at Jelastic Like to solve unsolvable problems Checking technology concepts on practice
  • 3. Why I am here? I want to talk to you about: General autoscaling concept for JavaEE applications Real use cases. Real issues. Tricky things My goals are: Save your time if you decide you need to scale your app Share our own experience
  • 4. I just deploy my application to Docker, set a number of replicas and … have it running … bla bla bla … super easy! Done! The myth
  • 5. Yes, pretty easy …
 If you need a super scalable and clustered Hello World application …
  • 6. In real life with JavaEE application we have architecture similar to this and its autoscaling becomes not a very trivial task…
  • 7. The truth Legacy Application Scalable Cluster Autoscalable Cluster
  • 9. At least 3 key things to make your applications scalable
  • 10. First: Adapted runtime (Container + JVM + JavaEE Server) micro
  • 11. Preferably, thin versions of application servers YES!NO!
  • 12. micro glassfish There are various versions adapted for lightweight containers
  • 13. Any specific reason to use VMs for microservices? NO!
  • 15. What should we use instead? YES!
  • 16. One container - one microservice instance YES! NO!
  • 19. Next few slides can be a bit boring for those who know… BUT Still important!!!!!!
  • 20. Ideal scaling and decomposition horizontal vertical topology
  • 21. Decomposition into microservice At least 2 key approaches
  • 23. Splitting bigger parts into smaller 1.Analyse metrics (NewRelic / JavaVisualVM) 2.Find a weak point (!) 3.Move this part to microservice 4.Repeat
  • 25. What it typically does? CONTAINERS
 PROVISIONING HEALTHCHECKS METRICS
 GATHERING APPLICATION 
 LIFECYCLE
 MANAGEMENT SCALING AUTOMATIC 
 LOAD
 BALANCING SERVICE
 DISCOVERY
 &
 CONNECTIVITY CUSTOM SCRIPTING*
  • 26. Typical triggers that are used for scaling CPU RAM HDD
 (disk I/O) NETWORK SERVICE
 FAILURE SCHEDULER
  • 28. Tricky thing #1 In which direction to scale? horizontal vertical topology
  • 29. Example #1 Message Queue Service Triggers configuration CPU RAM HDD (disk I/O) NETWORK SCHEDULER YES NO PROBABLY NO GENERAL SET GENERAL SET Scaling type HORIZONTAL Tricky place
  • 30. Example #2 Databases CPU RAM HDD (disk I/O) NETWORK SCHEDULER YES VERTICAL NO NO NO Scaling type Triggers configuration YES
  • 31. Typical issues while scaling of database instances Takes much time to sync data Temporary locks Temporary performance degradation Hard to use auto horizontal scaling Automatic vertical scaling can be used just fine It’s better to keep spare instances underloaded (dedicated storage per instance) RESUME
  • 32. Example #3 Legacy JavaEE application TOPOLOGY Java EE Server Business Tier Web Tier JSP App1 JSP App2 JSP App2 EJB App1 EJB App2 Java EE 
 Micro Instance JSP App1 Java EE 
 Micro Instance JSP App1 Java EE 
 Micro Instance JSP App1 Java EE 
 Micro Instance JSP App1 Java EE 
 Micro Instance JSP App1 Java EE 
 Micro Instance JSP App2 Java EE 
 Micro Instance JSP App1 Java EE 
 Micro Instance JSP App1 Java EE 
 Micro Instance EJB App2 Java EE 
 Micro Instance JSP App1 Java EE 
 Micro Instance JSP App1 Java EE 
 Micro Instance EJB App2 Scaling type
  • 33. Tricky thing #2 Events subscription Usually, just spinning up an extra instance is NOTenough
  • 34. Example #1 Typical ScaleIn/ScaleOut events and cases onAfterScaleOut[nodeGroup:ejb-app1] { “call”: “registerNodeInMonitoringSystem”, “call”: “addMemberToHazelcast”, “call”: “call3rdPartyApiService” } onAfterScaleIn[nodeGroup:jsp-app2] { “call”: “removeNodeFromMonitoringSystem”, “call”: “removeMemberFromHazelcast” } THE FULL WORKING AND MORE COMPLEX CODE EXAMPLE CAN BE FOUND HERE
  • 35. Example #2 2. Get auth keys by instance before joining DAS onBeforeStartService[nodeGroup:instance] { “cmd”: “/root/scripts/pullAccessKeys.sh ${token}” } THE FULL WORKING AND MORE COMPLEX CODE EXAMPLE CAN BE FOUND HERE 1. Decrypt encrypted volume, that was attached on-fly onAfterVolumeAttached[nodeGroup:instance] { “call”: “decryptVolume” } 3. Deprovision node from DAS if cluster was shrinked onAfterScaleOut[nodeGroup:das] { “cmd”: “./asadmin_proxy remove ${instance[@last].ip}” }
  • 36. Tricky thing #3 Proper triggers configuration This tuning is a long process, so be patient
  • 37. Typical problem #1 Changing the value in one place can be reflected in other places
  • 38. How to deal with this? Load Testing Gathering
 Metrics Detect deviations in a testing loop Analyzing
 Metrics Edit
Triggers Com pare previous 
 results
  • 39. Typical problem #2 The triggers can become outdated with new code
  • 40. The fix is easy here Inject metrics collection as a part of your CI/CD step COMMIT BUILD TESTING PERFORMANCE
 ANALYSIS DELIVERY
  • 41. Tricky thing #4 Getting rid of spare things
  • 42. Typical problem #1 Network is full of useless traffic Total bandwidth Multicast | Heartbeats Useful traffic
  • 43. What we can do? Avoid multicast (for members detection) Use events and static members lists Static members list Static members list Static members list Orchestrator
  • 44. Typical problem #2 Some of JavaEE Servers are designed for VMs, not for containers On example of Weblogic VM VM VM VM
  • 45. What is the right way to go? Just remove everything spare