SlideShare una empresa de Scribd logo
1 de 60
Descargar para leer sin conexión
Java Applications
inside Kubernetes
with Nested Container Architecture
● Ruslan Synytsky
● CEO and co-founder of Jelastic PaaS
● Java Champion
● Two-times Duke’s Choice Award Winner
● Former lead of engineering team at
National Data Center (NDC) at National
Space Agency of Ukraine
● @siruslan
About Speaker
● Virtualization and Container Types
● Effective Usage of Infrastructure
● Scaling VMs vs Containers
● Pay-as-you-Go vs Pay-per-Actual-Use
● Overcoming Java Memory Waste
● Kubernetes Challenges & Solutions
Agenda
VIRTUALIZATION
Virtualization Types
Virtualization Types
Virtualization Types
Container Types
● Used as an OS to run multiple services
● No layered filesystems by default
● Stronger isolation
● Examples: Virtuozzo, LXC
● Used to run for a single service
● Layered filesystems
● Examples: Docker, CRI-O
EFFECTIVE USAGE OF
INFRASTRUCTURE
Running Kubernetes on VMs vs System Containers
Kubernetes on VMs vs System Containers
Kubernetes on VMs vs System Containers
Kubernetes on VMs vs System Containers
Deployment Unification - Kubernetes on Containers in VMs
Kubernetes on VMs vs Containers
Live Migration of Containers
● Zero downtime hardware maintenance
● Load rebalancing across host nodes
● High-availability across clouds
Live Migration across Clouds without Downtime
SCALING JAVA IN
VMs vs CONTAINERS
Resource Limit vs Real Usage in VM and Container
Horizontal Scaling: VMs vs Containers
VMs
Containers
Vertical Scaling: VMs vs Containers
Resizing of the same container on the fly is easier, cheaper and faster
than moving to a larger VM.
Nested Limits
Kubernetes Node Limit
UNDERALLOCATION
OK OVERALLOCATION
JVM Vertical Scaling
Important JVM Options When Running in Containers
-XX:+UseContainerSupport
Force JVM to use containers limit instead of the host limits
It’s a must for application containers and can be disregarded for system containers
-XX:InitialRAMPercentage=N
Set initial heap size as a percentage of total memory
If you set a value for -Xms, the -XX:InitialRAMPercentage option is ignored
-XX:MaxRAMPercentage=N
Set maximum heap size as a percentage of total memory
If you set a value for -Xmx, the -XX:MaxRAMPercentage option is ignored
Jelastic PaaS adjusts configs of certified Java software stacks based on the
vertical scaling limits
Environment variable
XMX_DEF_PERCENT=80
Automatic Stacks Adjusting based on Scaling Limits
OVERCOMING JAVA
MEMORY WASTE
Jakarta EE Developer Survey 2018
“The most widely acknowledged issue
when employing with Java EE is
large memory requirements (40%)”
Most Challenging Aspect of Working with Jakarta EE
Unreleased Heap Memory
Over-Allocation and Underutilization
The Problem Symptoms
Make the G1 garbage collector automatically give back Java heap memory
to the operating system when idle
● -XX:G1PeriodicGCInterval=[milliseconds]
● -XX:G1PeriodicGCSystemLoadThreshold=[float]
● -XX:+G1PeriodicGCInvokesConcurrent
JEP 346: Promptly Return Unused Committed Memory from G1
java -Xmx2g -XX:+UseG1GC -XX:G1PeriodicGCInterval=900k
-XX:G1PeriodicGCSystemLoadThreshold=0.6 -jar app.jar
Available from Java 12
Timely Reduce Unused Committed Memory (JEP 346)
Automatically Released Heap
Immediately Improved Heap Elasticity
Community Recognition
https://github.com/jelastic-
jps/java-memory-agent
As compacting GC cycles are not triggered automatically, we execute them explicitly by
injecting an agent which monitors the memory usage and calls System.gc() periodically:
-javaagent:jelastic-gc-agent.jar=period=300,debug=true
Workaround for Java < 12: Calling Full GC Periodically
java -XX:+UseG1GC -Xmx2g -jar app.jar
https://github.com/jelastic/java-vertical-scaling-test
G1 and Full GC
Return unused HotSpot class-metadata memory to the operating system
more promptly, reduce metaspace footprint, and simplify the metaspace
code in order to reduce maintenance costs.
● Replace the existing metaspace memory allocator with a buddy-based
allocation scheme to allocate metaspace memory in smaller chunks.
● Commit memory from the operating system to arenas lazily, on
demand to reduce footprint for loaders
● Arrange metaspace memory into uniformly-sized granules which can
be committed and uncommitted independently of each other
-XX:MetaspaceReclaimPolicy=(balanced|aggressive|none)
Available from Java 16
Elastic Metaspace (JEP 387) https://openjdk.java.net/jeps/387
PAY-PER-USE
vs
PAY-AS-YOU-GO
Pay-As-You-Go vs Pay-per-Actual-Use
Using automatic vertical scaling, cloud provides can offer economically
advantageous pricing based on the actual resource consumption
Forbes - Deceptive Cloud Efficiency: Do You Really Pay As You Use?
Pay-As-You-Go Pay-per-Actual-Use
~$ free -m
● total - memory limit, amount of memory that can be used
● used - currently used memory, calculated as total - free - buffers - cache
● shared - extra used memory and shared with other containers on the same host
● buff/cache - temporary used memory which can be reclaimed any time on demand
Linux Terminology for RAM Consumption
● Physical Memory - the amount of RAM installed
● Memory Used - the amount of RAM being used
○ App Memory - the amount of memory being used by apps
○ Wired Memory - memory required by the system to operate. This memory can’t
be cached and must stay in RAM, so it’s not available to other apps
○ Compressed - the amount of memory that has been compressed to make
more RAM available
To check RAM usage on Mac, go to Activity Monitor (Applications > Utilities)
MacOS Terminology for RAM Consumption
● Total - memory limit, amount of memory
that can be used
● In Use - currently used memory,
calculated as total - free - standby -
modified
● Modified - memory whose contents must
be written to disk before it can be used
for another purpose
● Standby - memory that contains cached data and code that is not actually in use
● Free - memory does not contain any valuable data and that will be used first and
processors drivers or the operating system needs more memory
Windows Terminology for RAM Consumption
Pay-as-You-Go
Pay-as-You-Allocate
Pay-as-You-Reserve
= Pay-for-Limits
Pay-per-Use !=
Speculation with Pay-per-Use Term
https://aws.amazon.com/ecs/pricing/
AWS’s Pay-per-Use = Pay-per-Allocated-Limits
https://aws.amazon.com/fargate/pricing/
AWS’s Pay-per-Use = Pay-per-Allocated-Limits
https://cloud.google.com/run#section-2
https://cloud.google.com/run/pricing#cloudrun-pricing
Google’s Pay-per-Use = Pay-per-Allocated-Limits
Google’s Pay-per-Use = Pay-per-Allocated-Limits
Real Statistics of Resource Consumption with Containers
JELASTIC RESPONSE TO
KUBERNETES STRUGGLES
Technical Struggles with Kubernetes Services
● Too many components to manage (pod, node, service, ingress
and ingress controller, namespace, deployment, statefulset,
RBAC, nodeport, load balancer, physical volume, physical volume
claim, networks, resource limits, and so on)
● High entry barrier for beginners, most of features are
API-managed only, default Kubernetes Dashboard UI provides
limited functionality
● Migration complexity of traditional and legacy applications
● K8s was designed for large scale cloud-native apps and
microservices, so it’s not suitable for all workloads
● Upgrade to next Kubernetes version requires proper automation
and may be a challenge
Kubernetes Issues Solved by Jelastic
● Challenging setup is converted to “one click”
● Manual nodes configuration is fully automated
● Out of the box LB and SSL support
● K8s metrics and monitoring solutions
pre installed
● Replacing VMs with system containers
○ “Pay-Per-Actual-Use” pricing
○ Fast scaling of K8s nodes
● Turnkey solution for Public Hosting
Business
● Multi-cluster and multi-cloud
management
● Built-in billing and monitoring tools
● Product and security updates automation
https://www.youtube.com/watch?v=l9H28icAlUg
Automated Kubernetes Cluster Installation
● Nginx, HAProxy or Traefik, ingress
controllers for transferring HTTP/HTTPS
requests to services
● CNI plugin (powered by Weave) for overlay
network support
● CoreDNS for internal names resolution
● Dynamic provisioner of persistent volumes
● Metrics Server for gathering stats
● Jelastic SSL for protecting ingress network
● Kubernetes Dashboard
● HELM package manager to auto-install
pre-packed solutions from repositories
● Jaeger, Prometheus and Grafana
Pre-Installed Kubernetes Components
Automatic Vertical Scaling with Pay-Per-Actual-Use Pricing
An example of Workers vertical scaling: available capacity 48 GiB vs actually used and billed 2 GiB
Changing Worker Node Resource Limits on the Fly
Access to Worker and Master Nodes Via Web SSH
Upgrade Procedure
Upgrade Procedure
● Check if the cluster is eligible to
upgrade, and availability of final
version(s)
● Upgrade installed cluster
components (Weave, ingresses,
dashboards, hello-world,
metrics-server, Helm,
Prometheus+Grafana, etc.)
● Check if deprecated components are
present in the cluster
● Upgrade master instances
one-by-one via redeploy
● Evict PODs, upgrade worker
instances one-by-one via redeploy
Built-In Add-Ons
Embedded Cluster Monitoring
Grafana Prometheus
Kubernetes Hosting across Clouds & Data Centers
● Provision the clusters across multiple
clouds and on-premises with no
vendor lock-in
● Full interoperability and unification -
no configuration differences in
Kubernetes clusters running on
different clouds
● Mix and match infrastructure for extra
savings and for compliance with strict
data protection requirements
100+ data centers from 65+ local providers in 38 countries
Distributed Network of Service Providers Worldwide
Give a Try Yourself
https://jelastic.com/kubernetes-hosting/
Contact for Partnership
and Assistance
info@jelastic.com

Más contenido relacionado

La actualidad más candente

Application-level Disaster Recovery on OpenStack
Application-level Disaster Recovery on OpenStackApplication-level Disaster Recovery on OpenStack
Application-level Disaster Recovery on OpenStack
Ali Hodroj
 

La actualidad más candente (19)

Autoscaling Kubernetes
Autoscaling KubernetesAutoscaling Kubernetes
Autoscaling Kubernetes
 
CloudStack Best Practice in PPTV
CloudStack Best Practice in PPTVCloudStack Best Practice in PPTV
CloudStack Best Practice in PPTV
 
Scaling DataStax in Docker
Scaling DataStax in DockerScaling DataStax in Docker
Scaling DataStax in Docker
 
Performance Benchmarking of Clouds Evaluating OpenStack
Performance Benchmarking of Clouds                Evaluating OpenStackPerformance Benchmarking of Clouds                Evaluating OpenStack
Performance Benchmarking of Clouds Evaluating OpenStack
 
2016 08-30 Kubernetes talk for Waterloo DevOps
2016 08-30 Kubernetes talk for Waterloo DevOps2016 08-30 Kubernetes talk for Waterloo DevOps
2016 08-30 Kubernetes talk for Waterloo DevOps
 
Open Datacentre
Open DatacentreOpen Datacentre
Open Datacentre
 
A guide of PostgreSQL on Kubernetes
A guide of PostgreSQL on KubernetesA guide of PostgreSQL on Kubernetes
A guide of PostgreSQL on Kubernetes
 
Antoine Coetsier - billing the cloud
Antoine Coetsier - billing the cloudAntoine Coetsier - billing the cloud
Antoine Coetsier - billing the cloud
 
XCP-ng - past, present and future
XCP-ng - past, present and futureXCP-ng - past, present and future
XCP-ng - past, present and future
 
Enabling Disaster Recovery as Service (DRaaS) on OpenStack
Enabling Disaster Recovery as Service (DRaaS) on OpenStack Enabling Disaster Recovery as Service (DRaaS) on OpenStack
Enabling Disaster Recovery as Service (DRaaS) on OpenStack
 
Provisioning and automating high availability postgres on aws ec2 (1)
Provisioning and automating high availability postgres on aws ec2 (1)Provisioning and automating high availability postgres on aws ec2 (1)
Provisioning and automating high availability postgres on aws ec2 (1)
 
OpenStack Best Practices and Considerations - terasky tech day
OpenStack Best Practices and Considerations  - terasky tech dayOpenStack Best Practices and Considerations  - terasky tech day
OpenStack Best Practices and Considerations - terasky tech day
 
Application-level Disaster Recovery on OpenStack
Application-level Disaster Recovery on OpenStackApplication-level Disaster Recovery on OpenStack
Application-level Disaster Recovery on OpenStack
 
Investing the Effects of Overcommitting YARN resources
Investing the Effects of Overcommitting YARN resourcesInvesting the Effects of Overcommitting YARN resources
Investing the Effects of Overcommitting YARN resources
 
Paul Angus – Backup & Recovery in CloudStack
Paul Angus – Backup & Recovery in CloudStackPaul Angus – Backup & Recovery in CloudStack
Paul Angus – Backup & Recovery in CloudStack
 
Muli Ben-Yehuda, Stratoscale - The Road to a Hyper-Converged OpenStack, OpenS...
Muli Ben-Yehuda, Stratoscale - The Road to a Hyper-Converged OpenStack, OpenS...Muli Ben-Yehuda, Stratoscale - The Road to a Hyper-Converged OpenStack, OpenS...
Muli Ben-Yehuda, Stratoscale - The Road to a Hyper-Converged OpenStack, OpenS...
 
Application Caching: The Hidden Microservice
Application Caching: The Hidden MicroserviceApplication Caching: The Hidden Microservice
Application Caching: The Hidden Microservice
 
Performance tuning in BlueStore & RocksDB - Li Xiaoyan
Performance tuning in BlueStore & RocksDB - Li XiaoyanPerformance tuning in BlueStore & RocksDB - Li Xiaoyan
Performance tuning in BlueStore & RocksDB - Li Xiaoyan
 
Wido den Hollander - building highly available cloud with Ceph and CloudStack
Wido den Hollander - building highly available cloud with Ceph and CloudStackWido den Hollander - building highly available cloud with Ceph and CloudStack
Wido den Hollander - building highly available cloud with Ceph and CloudStack
 

Similar a Running Java Applications inside Kubernetes with Nested Container Architecture - jLove

Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...
Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...
Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...
DataStax
 
Citrix Synergy 2014 - Syn232 Building a Cloud Architecture and Self- Service ...
Citrix Synergy 2014 - Syn232 Building a Cloud Architecture and Self- Service ...Citrix Synergy 2014 - Syn232 Building a Cloud Architecture and Self- Service ...
Citrix Synergy 2014 - Syn232 Building a Cloud Architecture and Self- Service ...
Citrix
 

Similar a Running Java Applications inside Kubernetes with Nested Container Architecture - jLove (20)

Running Projects in Application Containers, System Containers & VMs - Jelasti...
Running Projects in Application Containers, System Containers & VMs - Jelasti...Running Projects in Application Containers, System Containers & VMs - Jelasti...
Running Projects in Application Containers, System Containers & VMs - Jelasti...
 
2689 - Exploring IBM PureApplication System and IBM Workload Deployer Best Pr...
2689 - Exploring IBM PureApplication System and IBM Workload Deployer Best Pr...2689 - Exploring IBM PureApplication System and IBM Workload Deployer Best Pr...
2689 - Exploring IBM PureApplication System and IBM Workload Deployer Best Pr...
 
Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...
Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...
Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...
 
DevoxxUK: Optimizating Application Performance on Kubernetes
DevoxxUK: Optimizating Application Performance on KubernetesDevoxxUK: Optimizating Application Performance on Kubernetes
DevoxxUK: Optimizating Application Performance on Kubernetes
 
State of Java Elasticity. Tuning Java Efficiency - GIDS.JAVA LIVE 2020
State of Java Elasticity. Tuning Java Efficiency - GIDS.JAVA LIVE 2020State of Java Elasticity. Tuning Java Efficiency - GIDS.JAVA LIVE 2020
State of Java Elasticity. Tuning Java Efficiency - GIDS.JAVA LIVE 2020
 
Foundations of Amazon EC2 - SRV319 - Chicago AWS Summit
Foundations of Amazon EC2 - SRV319 - Chicago AWS SummitFoundations of Amazon EC2 - SRV319 - Chicago AWS Summit
Foundations of Amazon EC2 - SRV319 - Chicago AWS Summit
 
DR-to-the-Cloud Best Practices
DR-to-the-Cloud Best PracticesDR-to-the-Cloud Best Practices
DR-to-the-Cloud Best Practices
 
Building a Just-in-Time Application Stack for Analysts
Building a Just-in-Time Application Stack for AnalystsBuilding a Just-in-Time Application Stack for Analysts
Building a Just-in-Time Application Stack for Analysts
 
Optimizing elastic search on google compute engine
Optimizing elastic search on google compute engineOptimizing elastic search on google compute engine
Optimizing elastic search on google compute engine
 
Running ElasticSearch on Google Compute Engine in Production
Running ElasticSearch on Google Compute Engine in ProductionRunning ElasticSearch on Google Compute Engine in Production
Running ElasticSearch on Google Compute Engine in Production
 
Deep Dive on Amazon EC2 Instances - AWS Summit Cape Town 2017
Deep Dive on Amazon EC2 Instances - AWS Summit Cape Town 2017Deep Dive on Amazon EC2 Instances - AWS Summit Cape Town 2017
Deep Dive on Amazon EC2 Instances - AWS Summit Cape Town 2017
 
How Netflix Tunes Amazon EC2 Instances for Performance - CMP325 - re:Invent 2017
How Netflix Tunes Amazon EC2 Instances for Performance - CMP325 - re:Invent 2017How Netflix Tunes Amazon EC2 Instances for Performance - CMP325 - re:Invent 2017
How Netflix Tunes Amazon EC2 Instances for Performance - CMP325 - re:Invent 2017
 
GDG Cloud Southlake #20:Stefano Doni: Kubernetes performance tuning dilemma: ...
GDG Cloud Southlake #20:Stefano Doni: Kubernetes performance tuning dilemma: ...GDG Cloud Southlake #20:Stefano Doni: Kubernetes performance tuning dilemma: ...
GDG Cloud Southlake #20:Stefano Doni: Kubernetes performance tuning dilemma: ...
 
Benchmarking your cloud performance with top 4 global public clouds
Benchmarking your cloud performance with top 4 global public cloudsBenchmarking your cloud performance with top 4 global public clouds
Benchmarking your cloud performance with top 4 global public clouds
 
Amazon EC2 Instances, Featuring Performance Optimisation Best Practices
Amazon EC2 Instances, Featuring Performance Optimisation Best PracticesAmazon EC2 Instances, Featuring Performance Optimisation Best Practices
Amazon EC2 Instances, Featuring Performance Optimisation Best Practices
 
Introduction to Container Storage Interface (CSI)
Introduction to Container Storage Interface (CSI)Introduction to Container Storage Interface (CSI)
Introduction to Container Storage Interface (CSI)
 
Citrix Synergy 2014 - Syn232 Building a Cloud Architecture and Self- Service ...
Citrix Synergy 2014 - Syn232 Building a Cloud Architecture and Self- Service ...Citrix Synergy 2014 - Syn232 Building a Cloud Architecture and Self- Service ...
Citrix Synergy 2014 - Syn232 Building a Cloud Architecture and Self- Service ...
 
Deep Dive on Amazon EC2 Accelerated Computing - AWS Online Tech Talks
Deep Dive on Amazon EC2 Accelerated Computing - AWS Online Tech TalksDeep Dive on Amazon EC2 Accelerated Computing - AWS Online Tech Talks
Deep Dive on Amazon EC2 Accelerated Computing - AWS Online Tech Talks
 
Achieving the Ultimate Performance with KVM
Achieving the Ultimate Performance with KVMAchieving the Ultimate Performance with KVM
Achieving the Ultimate Performance with KVM
 
Actionable Insights with Apache Apex at Apache Big Data 2017 by Devendra Tagare
Actionable Insights with Apache Apex at Apache Big Data 2017 by Devendra TagareActionable Insights with Apache Apex at Apache Big Data 2017 by Devendra Tagare
Actionable Insights with Apache Apex at Apache Big Data 2017 by Devendra Tagare
 

Más de Jelastic Multi-Cloud PaaS

Más de Jelastic Multi-Cloud PaaS (20)

Kubernetes and Nested Containers: Enhanced 3 Ps (Performance, Price and Provi...
Kubernetes and Nested Containers: Enhanced 3 Ps (Performance, Price and Provi...Kubernetes and Nested Containers: Enhanced 3 Ps (Performance, Price and Provi...
Kubernetes and Nested Containers: Enhanced 3 Ps (Performance, Price and Provi...
 
Elastic JVM for Scalable Java EE Applications Running in Containers #Jakart...
Elastic JVM  for Scalable Java EE Applications  Running in Containers #Jakart...Elastic JVM  for Scalable Java EE Applications  Running in Containers #Jakart...
Elastic JVM for Scalable Java EE Applications Running in Containers #Jakart...
 
Choosing Right Garbage Collector to Increase Efficiency of Java Memory Usage
Choosing Right Garbage Collector to Increase Efficiency of Java Memory UsageChoosing Right Garbage Collector to Increase Efficiency of Java Memory Usage
Choosing Right Garbage Collector to Increase Efficiency of Java Memory Usage
 
SaaSification in Action. Attracting Software Vendors with Easy Transformation
SaaSification in Action. Attracting Software Vendors with Easy TransformationSaaSification in Action. Attracting Software Vendors with Easy Transformation
SaaSification in Action. Attracting Software Vendors with Easy Transformation
 
State of the Art UI - Overview of Jelastic PaaS Functionality
State of the Art UI - Overview of Jelastic PaaS FunctionalityState of the Art UI - Overview of Jelastic PaaS Functionality
State of the Art UI - Overview of Jelastic PaaS Functionality
 
How to Make Money Solving 5 Major Problems of Cloud Hosting Customers
How to Make Money Solving 5 Major Problems of Cloud Hosting CustomersHow to Make Money Solving 5 Major Problems of Cloud Hosting Customers
How to Make Money Solving 5 Major Problems of Cloud Hosting Customers
 
Multi-Cloud Lightweight Platform as a Service
Multi-Cloud Lightweight Platform as a ServiceMulti-Cloud Lightweight Platform as a Service
Multi-Cloud Lightweight Platform as a Service
 
From VMs to Containers: Decompose and Migrate Old Legacy JavaEE Application
From VMs to Containers: Decompose and Migrate Old Legacy JavaEE ApplicationFrom VMs to Containers: Decompose and Migrate Old Legacy JavaEE Application
From VMs to Containers: Decompose and Migrate Old Legacy JavaEE Application
 
Automating CICD Pipeline with GitLab and Docker Containers for Java Applications
Automating CICD Pipeline with GitLab and Docker Containers for Java ApplicationsAutomating CICD Pipeline with GitLab and Docker Containers for Java Applications
Automating CICD Pipeline with GitLab and Docker Containers for Java Applications
 
Automated Scaling of Microservice Stacks for JavaEE Applications
Automated Scaling of Microservice Stacks for JavaEE ApplicationsAutomated Scaling of Microservice Stacks for JavaEE Applications
Automated Scaling of Microservice Stacks for JavaEE Applications
 
Cloud Hosting Business in Africa: Market Specifics and Ways to Grow
Cloud Hosting Business in Africa: Market Specifics and Ways to GrowCloud Hosting Business in Africa: Market Specifics and Ways to Grow
Cloud Hosting Business in Africa: Market Specifics and Ways to Grow
 
Automated scaling of microservice stacks for JavaEE applications - JEEConf 2017
Automated scaling of microservice stacks for JavaEE applications - JEEConf 2017Automated scaling of microservice stacks for JavaEE applications - JEEConf 2017
Automated scaling of microservice stacks for JavaEE applications - JEEConf 2017
 
Jelastic DevOps Platform Product Overview for Service Providers
Jelastic DevOps Platform Product Overview for Service ProvidersJelastic DevOps Platform Product Overview for Service Providers
Jelastic DevOps Platform Product Overview for Service Providers
 
Auto Scaling for Multi-Tier Containers Topology
Auto Scaling for Multi-Tier Containers TopologyAuto Scaling for Multi-Tier Containers Topology
Auto Scaling for Multi-Tier Containers Topology
 
Jelastic DevOps Platform Product Overview for ISVs
Jelastic DevOps Platform Product Overview for ISVsJelastic DevOps Platform Product Overview for ISVs
Jelastic DevOps Platform Product Overview for ISVs
 
DevOps Epoch 2016
DevOps Epoch 2016DevOps Epoch 2016
DevOps Epoch 2016
 
Онлайн миграция контейнеров. Взгляд изнутри
Онлайн миграция контейнеров. Взгляд изнутриОнлайн миграция контейнеров. Взгляд изнутри
Онлайн миграция контейнеров. Взгляд изнутри
 
Jelastic - DevOps PaaS Business with Docker Support for Service Providers
Jelastic - DevOps PaaS Business with Docker Support for Service ProvidersJelastic - DevOps PaaS Business with Docker Support for Service Providers
Jelastic - DevOps PaaS Business with Docker Support for Service Providers
 
Jelastic Turnkey Cloud PaaS for Developers
Jelastic Turnkey Cloud PaaS for DevelopersJelastic Turnkey Cloud PaaS for Developers
Jelastic Turnkey Cloud PaaS for Developers
 
Jelastic - Containers Live Migration Behind the Scene
Jelastic - Containers Live Migration Behind the SceneJelastic - Containers Live Migration Behind the Scene
Jelastic - Containers Live Migration Behind the Scene
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

Running Java Applications inside Kubernetes with Nested Container Architecture - jLove

  • 1. Java Applications inside Kubernetes with Nested Container Architecture
  • 2. ● Ruslan Synytsky ● CEO and co-founder of Jelastic PaaS ● Java Champion ● Two-times Duke’s Choice Award Winner ● Former lead of engineering team at National Data Center (NDC) at National Space Agency of Ukraine ● @siruslan About Speaker
  • 3. ● Virtualization and Container Types ● Effective Usage of Infrastructure ● Scaling VMs vs Containers ● Pay-as-you-Go vs Pay-per-Actual-Use ● Overcoming Java Memory Waste ● Kubernetes Challenges & Solutions Agenda
  • 8. Container Types ● Used as an OS to run multiple services ● No layered filesystems by default ● Stronger isolation ● Examples: Virtuozzo, LXC ● Used to run for a single service ● Layered filesystems ● Examples: Docker, CRI-O
  • 10. Running Kubernetes on VMs vs System Containers
  • 11. Kubernetes on VMs vs System Containers
  • 12. Kubernetes on VMs vs System Containers
  • 13. Kubernetes on VMs vs System Containers
  • 14. Deployment Unification - Kubernetes on Containers in VMs
  • 15. Kubernetes on VMs vs Containers
  • 16. Live Migration of Containers ● Zero downtime hardware maintenance ● Load rebalancing across host nodes ● High-availability across clouds
  • 17. Live Migration across Clouds without Downtime
  • 18. SCALING JAVA IN VMs vs CONTAINERS
  • 19. Resource Limit vs Real Usage in VM and Container
  • 20. Horizontal Scaling: VMs vs Containers VMs Containers
  • 21. Vertical Scaling: VMs vs Containers Resizing of the same container on the fly is easier, cheaper and faster than moving to a larger VM.
  • 24. Important JVM Options When Running in Containers -XX:+UseContainerSupport Force JVM to use containers limit instead of the host limits It’s a must for application containers and can be disregarded for system containers -XX:InitialRAMPercentage=N Set initial heap size as a percentage of total memory If you set a value for -Xms, the -XX:InitialRAMPercentage option is ignored -XX:MaxRAMPercentage=N Set maximum heap size as a percentage of total memory If you set a value for -Xmx, the -XX:MaxRAMPercentage option is ignored
  • 25. Jelastic PaaS adjusts configs of certified Java software stacks based on the vertical scaling limits Environment variable XMX_DEF_PERCENT=80 Automatic Stacks Adjusting based on Scaling Limits
  • 27. Jakarta EE Developer Survey 2018 “The most widely acknowledged issue when employing with Java EE is large memory requirements (40%)” Most Challenging Aspect of Working with Jakarta EE
  • 28. Unreleased Heap Memory Over-Allocation and Underutilization The Problem Symptoms
  • 29. Make the G1 garbage collector automatically give back Java heap memory to the operating system when idle ● -XX:G1PeriodicGCInterval=[milliseconds] ● -XX:G1PeriodicGCSystemLoadThreshold=[float] ● -XX:+G1PeriodicGCInvokesConcurrent JEP 346: Promptly Return Unused Committed Memory from G1 java -Xmx2g -XX:+UseG1GC -XX:G1PeriodicGCInterval=900k -XX:G1PeriodicGCSystemLoadThreshold=0.6 -jar app.jar Available from Java 12 Timely Reduce Unused Committed Memory (JEP 346)
  • 30. Automatically Released Heap Immediately Improved Heap Elasticity
  • 32. https://github.com/jelastic- jps/java-memory-agent As compacting GC cycles are not triggered automatically, we execute them explicitly by injecting an agent which monitors the memory usage and calls System.gc() periodically: -javaagent:jelastic-gc-agent.jar=period=300,debug=true Workaround for Java < 12: Calling Full GC Periodically
  • 33. java -XX:+UseG1GC -Xmx2g -jar app.jar https://github.com/jelastic/java-vertical-scaling-test G1 and Full GC
  • 34. Return unused HotSpot class-metadata memory to the operating system more promptly, reduce metaspace footprint, and simplify the metaspace code in order to reduce maintenance costs. ● Replace the existing metaspace memory allocator with a buddy-based allocation scheme to allocate metaspace memory in smaller chunks. ● Commit memory from the operating system to arenas lazily, on demand to reduce footprint for loaders ● Arrange metaspace memory into uniformly-sized granules which can be committed and uncommitted independently of each other -XX:MetaspaceReclaimPolicy=(balanced|aggressive|none) Available from Java 16 Elastic Metaspace (JEP 387) https://openjdk.java.net/jeps/387
  • 36. Pay-As-You-Go vs Pay-per-Actual-Use Using automatic vertical scaling, cloud provides can offer economically advantageous pricing based on the actual resource consumption Forbes - Deceptive Cloud Efficiency: Do You Really Pay As You Use? Pay-As-You-Go Pay-per-Actual-Use
  • 37. ~$ free -m ● total - memory limit, amount of memory that can be used ● used - currently used memory, calculated as total - free - buffers - cache ● shared - extra used memory and shared with other containers on the same host ● buff/cache - temporary used memory which can be reclaimed any time on demand Linux Terminology for RAM Consumption
  • 38. ● Physical Memory - the amount of RAM installed ● Memory Used - the amount of RAM being used ○ App Memory - the amount of memory being used by apps ○ Wired Memory - memory required by the system to operate. This memory can’t be cached and must stay in RAM, so it’s not available to other apps ○ Compressed - the amount of memory that has been compressed to make more RAM available To check RAM usage on Mac, go to Activity Monitor (Applications > Utilities) MacOS Terminology for RAM Consumption
  • 39. ● Total - memory limit, amount of memory that can be used ● In Use - currently used memory, calculated as total - free - standby - modified ● Modified - memory whose contents must be written to disk before it can be used for another purpose ● Standby - memory that contains cached data and code that is not actually in use ● Free - memory does not contain any valuable data and that will be used first and processors drivers or the operating system needs more memory Windows Terminology for RAM Consumption
  • 44. Google’s Pay-per-Use = Pay-per-Allocated-Limits
  • 45. Real Statistics of Resource Consumption with Containers
  • 47. Technical Struggles with Kubernetes Services ● Too many components to manage (pod, node, service, ingress and ingress controller, namespace, deployment, statefulset, RBAC, nodeport, load balancer, physical volume, physical volume claim, networks, resource limits, and so on) ● High entry barrier for beginners, most of features are API-managed only, default Kubernetes Dashboard UI provides limited functionality ● Migration complexity of traditional and legacy applications ● K8s was designed for large scale cloud-native apps and microservices, so it’s not suitable for all workloads ● Upgrade to next Kubernetes version requires proper automation and may be a challenge
  • 48. Kubernetes Issues Solved by Jelastic ● Challenging setup is converted to “one click” ● Manual nodes configuration is fully automated ● Out of the box LB and SSL support ● K8s metrics and monitoring solutions pre installed ● Replacing VMs with system containers ○ “Pay-Per-Actual-Use” pricing ○ Fast scaling of K8s nodes ● Turnkey solution for Public Hosting Business ● Multi-cluster and multi-cloud management ● Built-in billing and monitoring tools ● Product and security updates automation
  • 50. ● Nginx, HAProxy or Traefik, ingress controllers for transferring HTTP/HTTPS requests to services ● CNI plugin (powered by Weave) for overlay network support ● CoreDNS for internal names resolution ● Dynamic provisioner of persistent volumes ● Metrics Server for gathering stats ● Jelastic SSL for protecting ingress network ● Kubernetes Dashboard ● HELM package manager to auto-install pre-packed solutions from repositories ● Jaeger, Prometheus and Grafana Pre-Installed Kubernetes Components
  • 51. Automatic Vertical Scaling with Pay-Per-Actual-Use Pricing An example of Workers vertical scaling: available capacity 48 GiB vs actually used and billed 2 GiB
  • 52. Changing Worker Node Resource Limits on the Fly
  • 53. Access to Worker and Master Nodes Via Web SSH
  • 55. Upgrade Procedure ● Check if the cluster is eligible to upgrade, and availability of final version(s) ● Upgrade installed cluster components (Weave, ingresses, dashboards, hello-world, metrics-server, Helm, Prometheus+Grafana, etc.) ● Check if deprecated components are present in the cluster ● Upgrade master instances one-by-one via redeploy ● Evict PODs, upgrade worker instances one-by-one via redeploy
  • 58. Kubernetes Hosting across Clouds & Data Centers ● Provision the clusters across multiple clouds and on-premises with no vendor lock-in ● Full interoperability and unification - no configuration differences in Kubernetes clusters running on different clouds ● Mix and match infrastructure for extra savings and for compliance with strict data protection requirements
  • 59. 100+ data centers from 65+ local providers in 38 countries Distributed Network of Service Providers Worldwide
  • 60. Give a Try Yourself https://jelastic.com/kubernetes-hosting/ Contact for Partnership and Assistance info@jelastic.com