SlideShare une entreprise Scribd logo
1  sur  29
Why does my Jenkins freeze sometimes and what
can I do about it?
Jenkins session you may like
Taboola - Numbers
On Average Every American Sees Taboola 70 Times a Month (comScore)
500K+ Requests/sec
15B recommendation/day
1B Monthly unique users
17TB+ incoming raw data/day
8 Data-Centers globally, with over ~2500 Production servers
Taboola - Jenkins
4 Jenkins servers
48 slaves
Hundreds of builds / day
~ 5 releases per day
Taboola - Technologies
6
Agenda
● The problem
● JVM architecture
● Garbage collectors
● The solution
The problem
Problem: Jenkins pages get load very slowly
JVM architecture
http://www.oracle.com/technetwork/tutorials/tutorials-1876574.html
JVM architecture
http://coding-geek.com/jvm-memory-model/
JVM architecture
http://javatutorialhere.blogspot.co.il/2014/08/how-objects-are-stored-in-heap-and.html
JVM architecture
Choose >, < or =
32GB Heap 35GB Heap
?
JVM architecture
-Xmx - heap maximum size
-Xms - initial heap size
jinfo -flag UseCompressedOops <pid>
JVM architecture
http://java-latte.blogspot.co.il/2014/03/metaspace-in-java-8.html
Garbage Collector
Garbage Collector
Garbage Collector
https://medium.com/@petloverooka/heres-how-garbage-collection-in-java-really-work-2acacc171c1
Garbage Collector
http://www.oracle.com/technetwork/tutorials/tutorials-1876574.html
The solution - G1GC and logs
Enable G1Gc:
-XX:+UseG1GC
Logs:
-Xloggc:/myJenkinsDir/gc-%t.log -XX:NumberOfGCLogFiles=5 -XX:+UseGCLogFileRotation -
XX:GCLogFileSize=20m -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -
XX:+PrintGCDetails -XX:+PrintHeapAtGC -XX:+PrintGCCause -
XX:+PrintTenuringDistribution -XX:+PrintReferenceGC -XX:+PrintAdaptiveSizePolicy -
verbose:gc -XX:+UnlockDiagnosticVMOptions -XX:+PrintFlagsFinal
The solution - GC logs
The solution - Tools
http://gceasy.io/
The solution - Tools
The solution - More GC Flags
-XX:MaxGCPauseMillis=<n> (default 200ms)
-XX:InitiatingHeapOccupancyPercent=45
-XX:ParallelGCThreads=15
-XX:ConcGCThreads=4
-XX:+PrintStringDeduplicationStatistics -XX:+UseStringDeduplication
-XX:+DisableExplicitGC
G1GC Tuning
The solution - Jconsole
The solution - Jconsole
-Djava.rmi.server.hostname=<your Jenkins host> -
Dcom.sun.management.jmxremote.port=<choose a port> -
Dcom.sun.management.jmxremote.authenticate=false -
Dcom.sun.management.jmxremote.ssl=false
The solution - Jenkins Old data
Jenkins Old data: http://yourJenkinsHost/administrativeMonitor/OldData/manage
The solution - Summary
● Switch to G1GC
● Enable and analyze logs
● Add relevant flags
● Analyze logs again
● Remove old Jenkins data
● Monitor
Thank You!
Tidhar Klein Orbach
@tizkiko
tidharko
Tidhar Klein Orbach
Resources
● Joining the Big Leagues: Tuning Jenkins GC For Responsiveness and
Stability
● JVM memory model
● Getting Started with the G1 Garbage Collector
● Everything I Ever Learned about JVM Performance Tuning @twitter
● Here’s How Garbage Collection in JAVA Really Work
● Java HotSpot VM Options
● Why 35GB Heap is Less Than 32GB – Java JVM Memory Oddities

Contenu connexe

Tendances

Sync or swim: the challenge of complex offline apps
Sync or swim:  the challenge of complex offline appsSync or swim:  the challenge of complex offline apps
Sync or swim: the challenge of complex offline appsOutSystems
 
Performance Comparison of Mutex, RWLock and Atomic types in Rust
Performance Comparison of Mutex, RWLock and  Atomic types in RustPerformance Comparison of Mutex, RWLock and  Atomic types in Rust
Performance Comparison of Mutex, RWLock and Atomic types in RustMitsunori Komatsu
 
From Lucene to Elasticsearch, a short explanation of horizontal scalability
From Lucene to Elasticsearch, a short explanation of horizontal scalabilityFrom Lucene to Elasticsearch, a short explanation of horizontal scalability
From Lucene to Elasticsearch, a short explanation of horizontal scalabilityStéphane Gamard
 
Linux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsLinux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsBrendan Gregg
 
OutSystems community meetup 2019 03_how to handle exceptions like a pro
OutSystems community meetup 2019 03_how to handle exceptions like a proOutSystems community meetup 2019 03_how to handle exceptions like a pro
OutSystems community meetup 2019 03_how to handle exceptions like a proProvidit
 
VictoriaLogs: Open Source Log Management System - Preview
VictoriaLogs: Open Source Log Management System - PreviewVictoriaLogs: Open Source Log Management System - Preview
VictoriaLogs: Open Source Log Management System - PreviewVictoriaMetrics
 
Linux SMEP bypass techniques
Linux SMEP bypass techniquesLinux SMEP bypass techniques
Linux SMEP bypass techniquesVitaly Nikolenko
 
Container Performance Analysis
Container Performance AnalysisContainer Performance Analysis
Container Performance AnalysisBrendan Gregg
 
Coder sans peur du changement avec la meme pas mal hexagonal architecture
Coder sans peur du changement avec la meme pas mal hexagonal architectureCoder sans peur du changement avec la meme pas mal hexagonal architecture
Coder sans peur du changement avec la meme pas mal hexagonal architectureThomas Pierrain
 
OSMC 2022 | VictoriaMetrics: scaling to 100 million metrics per second by Ali...
OSMC 2022 | VictoriaMetrics: scaling to 100 million metrics per second by Ali...OSMC 2022 | VictoriaMetrics: scaling to 100 million metrics per second by Ali...
OSMC 2022 | VictoriaMetrics: scaling to 100 million metrics per second by Ali...NETWAYS
 
USENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame GraphsUSENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame GraphsBrendan Gregg
 
[Outdated] Secrets of Performance Tuning Java on Kubernetes
[Outdated] Secrets of Performance Tuning Java on Kubernetes[Outdated] Secrets of Performance Tuning Java on Kubernetes
[Outdated] Secrets of Performance Tuning Java on KubernetesBruno Borges
 
Kernel Recipes 2015: Linux Kernel IO subsystem - How it works and how can I s...
Kernel Recipes 2015: Linux Kernel IO subsystem - How it works and how can I s...Kernel Recipes 2015: Linux Kernel IO subsystem - How it works and how can I s...
Kernel Recipes 2015: Linux Kernel IO subsystem - How it works and how can I s...Anne Nicolas
 
Technical Webinar: By the (Play) Book: The Agile Practice at OutSystems
Technical Webinar: By the (Play) Book: The Agile Practice at OutSystemsTechnical Webinar: By the (Play) Book: The Agile Practice at OutSystems
Technical Webinar: By the (Play) Book: The Agile Practice at OutSystemsOutSystems
 
What Is Light BPT and How Can You Use it for Parallel Processing?
What Is Light BPT and How Can You Use it for Parallel Processing?What Is Light BPT and How Can You Use it for Parallel Processing?
What Is Light BPT and How Can You Use it for Parallel Processing?OutSystems
 
Kafka used at scale to deliver real-time notifications
Kafka used at scale to deliver real-time notificationsKafka used at scale to deliver real-time notifications
Kafka used at scale to deliver real-time notificationsSérgio Nunes
 
Data Loss and Duplication in Kafka
Data Loss and Duplication in KafkaData Loss and Duplication in Kafka
Data Loss and Duplication in KafkaJayesh Thakrar
 
ceph::errorator<> throw/catch-free, compile time-checked exceptions for seast...
ceph::errorator<> throw/catch-free, compile time-checked exceptions for seast...ceph::errorator<> throw/catch-free, compile time-checked exceptions for seast...
ceph::errorator<> throw/catch-free, compile time-checked exceptions for seast...ScyllaDB
 

Tendances (20)

Sync or swim: the challenge of complex offline apps
Sync or swim:  the challenge of complex offline appsSync or swim:  the challenge of complex offline apps
Sync or swim: the challenge of complex offline apps
 
Fluent Bit: Log Forwarding at Scale
Fluent Bit: Log Forwarding at ScaleFluent Bit: Log Forwarding at Scale
Fluent Bit: Log Forwarding at Scale
 
Performance Comparison of Mutex, RWLock and Atomic types in Rust
Performance Comparison of Mutex, RWLock and  Atomic types in RustPerformance Comparison of Mutex, RWLock and  Atomic types in Rust
Performance Comparison of Mutex, RWLock and Atomic types in Rust
 
From Lucene to Elasticsearch, a short explanation of horizontal scalability
From Lucene to Elasticsearch, a short explanation of horizontal scalabilityFrom Lucene to Elasticsearch, a short explanation of horizontal scalability
From Lucene to Elasticsearch, a short explanation of horizontal scalability
 
Linux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsLinux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old Secrets
 
OutSystems community meetup 2019 03_how to handle exceptions like a pro
OutSystems community meetup 2019 03_how to handle exceptions like a proOutSystems community meetup 2019 03_how to handle exceptions like a pro
OutSystems community meetup 2019 03_how to handle exceptions like a pro
 
VictoriaLogs: Open Source Log Management System - Preview
VictoriaLogs: Open Source Log Management System - PreviewVictoriaLogs: Open Source Log Management System - Preview
VictoriaLogs: Open Source Log Management System - Preview
 
eBPF/XDP
eBPF/XDP eBPF/XDP
eBPF/XDP
 
Linux SMEP bypass techniques
Linux SMEP bypass techniquesLinux SMEP bypass techniques
Linux SMEP bypass techniques
 
Container Performance Analysis
Container Performance AnalysisContainer Performance Analysis
Container Performance Analysis
 
Coder sans peur du changement avec la meme pas mal hexagonal architecture
Coder sans peur du changement avec la meme pas mal hexagonal architectureCoder sans peur du changement avec la meme pas mal hexagonal architecture
Coder sans peur du changement avec la meme pas mal hexagonal architecture
 
OSMC 2022 | VictoriaMetrics: scaling to 100 million metrics per second by Ali...
OSMC 2022 | VictoriaMetrics: scaling to 100 million metrics per second by Ali...OSMC 2022 | VictoriaMetrics: scaling to 100 million metrics per second by Ali...
OSMC 2022 | VictoriaMetrics: scaling to 100 million metrics per second by Ali...
 
USENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame GraphsUSENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame Graphs
 
[Outdated] Secrets of Performance Tuning Java on Kubernetes
[Outdated] Secrets of Performance Tuning Java on Kubernetes[Outdated] Secrets of Performance Tuning Java on Kubernetes
[Outdated] Secrets of Performance Tuning Java on Kubernetes
 
Kernel Recipes 2015: Linux Kernel IO subsystem - How it works and how can I s...
Kernel Recipes 2015: Linux Kernel IO subsystem - How it works and how can I s...Kernel Recipes 2015: Linux Kernel IO subsystem - How it works and how can I s...
Kernel Recipes 2015: Linux Kernel IO subsystem - How it works and how can I s...
 
Technical Webinar: By the (Play) Book: The Agile Practice at OutSystems
Technical Webinar: By the (Play) Book: The Agile Practice at OutSystemsTechnical Webinar: By the (Play) Book: The Agile Practice at OutSystems
Technical Webinar: By the (Play) Book: The Agile Practice at OutSystems
 
What Is Light BPT and How Can You Use it for Parallel Processing?
What Is Light BPT and How Can You Use it for Parallel Processing?What Is Light BPT and How Can You Use it for Parallel Processing?
What Is Light BPT and How Can You Use it for Parallel Processing?
 
Kafka used at scale to deliver real-time notifications
Kafka used at scale to deliver real-time notificationsKafka used at scale to deliver real-time notifications
Kafka used at scale to deliver real-time notifications
 
Data Loss and Duplication in Kafka
Data Loss and Duplication in KafkaData Loss and Duplication in Kafka
Data Loss and Duplication in Kafka
 
ceph::errorator<> throw/catch-free, compile time-checked exceptions for seast...
ceph::errorator<> throw/catch-free, compile time-checked exceptions for seast...ceph::errorator<> throw/catch-free, compile time-checked exceptions for seast...
ceph::errorator<> throw/catch-free, compile time-checked exceptions for seast...
 

Similaire à Why does my jenkins freeze sometimes and what can I do about it?

Secrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on KubernetesSecrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on KubernetesBruno Borges
 
Persistent Memory Programming with Java*
Persistent Memory Programming with Java*Persistent Memory Programming with Java*
Persistent Memory Programming with Java*Intel® Software
 
SF Big Analytics & SF Machine Learning Meetup: Machine Learning at the Limit ...
SF Big Analytics & SF Machine Learning Meetup: Machine Learning at the Limit ...SF Big Analytics & SF Machine Learning Meetup: Machine Learning at the Limit ...
SF Big Analytics & SF Machine Learning Meetup: Machine Learning at the Limit ...Chester Chen
 
Jvm problem diagnostics
Jvm problem diagnosticsJvm problem diagnostics
Jvm problem diagnosticsDanijel Mitar
 
JITServerTalk Nebraska 2023.pdf
JITServerTalk Nebraska 2023.pdfJITServerTalk Nebraska 2023.pdf
JITServerTalk Nebraska 2023.pdfRichHagarty
 
Modern Engineer’s Troubleshooting Tools, Techniques & Tricks at Confoo 2018
Modern Engineer’s Troubleshooting Tools, Techniques & Tricks at Confoo 2018Modern Engineer’s Troubleshooting Tools, Techniques & Tricks at Confoo 2018
Modern Engineer’s Troubleshooting Tools, Techniques & Tricks at Confoo 2018Tier1app
 
Javaland_JITServerTalk.pptx
Javaland_JITServerTalk.pptxJavaland_JITServerTalk.pptx
Javaland_JITServerTalk.pptxGrace Jansen
 
Introduction of Java GC Tuning and Java Java Mission Control
Introduction of Java GC Tuning and Java Java Mission ControlIntroduction of Java GC Tuning and Java Java Mission Control
Introduction of Java GC Tuning and Java Java Mission ControlLeon Chen
 
ContainerWorkloadwithSemeru.pdf
ContainerWorkloadwithSemeru.pdfContainerWorkloadwithSemeru.pdf
ContainerWorkloadwithSemeru.pdfSumanMitra22
 
Performance Benchmarking: Tips, Tricks, and Lessons Learned
Performance Benchmarking: Tips, Tricks, and Lessons LearnedPerformance Benchmarking: Tips, Tricks, and Lessons Learned
Performance Benchmarking: Tips, Tricks, and Lessons LearnedTim Callaghan
 
Make Oracle scream with Flash Storage - Kaminario
Make Oracle scream with Flash Storage - KaminarioMake Oracle scream with Flash Storage - Kaminario
Make Oracle scream with Flash Storage - KaminarioToronto-Oracle-Users-Group
 
JITServerTalk JCON World 2023.pdf
JITServerTalk JCON World 2023.pdfJITServerTalk JCON World 2023.pdf
JITServerTalk JCON World 2023.pdfRichHagarty
 
.NET Memory Primer (Martin Kulov)
.NET Memory Primer (Martin Kulov).NET Memory Primer (Martin Kulov)
.NET Memory Primer (Martin Kulov)ITCamp
 
Kafka to the Maxka - (Kafka Performance Tuning)
Kafka to the Maxka - (Kafka Performance Tuning)Kafka to the Maxka - (Kafka Performance Tuning)
Kafka to the Maxka - (Kafka Performance Tuning)DataWorks Summit
 
Flink Forward Berlin 2017: Robert Metzger - Keep it going - How to reliably a...
Flink Forward Berlin 2017: Robert Metzger - Keep it going - How to reliably a...Flink Forward Berlin 2017: Robert Metzger - Keep it going - How to reliably a...
Flink Forward Berlin 2017: Robert Metzger - Keep it going - How to reliably a...Flink Forward
 
Nexcess Magento Imagine 2014 Performance Breakout
Nexcess Magento Imagine 2014 Performance BreakoutNexcess Magento Imagine 2014 Performance Breakout
Nexcess Magento Imagine 2014 Performance BreakoutNexcess.net LLC
 
JITServerTalk-OSS-2023.pdf
JITServerTalk-OSS-2023.pdfJITServerTalk-OSS-2023.pdf
JITServerTalk-OSS-2023.pdfRichHagarty
 
HPPG - high performance photo gallery
HPPG - high performance photo galleryHPPG - high performance photo gallery
HPPG - high performance photo galleryRemigijus Kiminas
 

Similaire à Why does my jenkins freeze sometimes and what can I do about it? (20)

Secrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on KubernetesSecrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on Kubernetes
 
Persistent Memory Programming with Java*
Persistent Memory Programming with Java*Persistent Memory Programming with Java*
Persistent Memory Programming with Java*
 
SF Big Analytics & SF Machine Learning Meetup: Machine Learning at the Limit ...
SF Big Analytics & SF Machine Learning Meetup: Machine Learning at the Limit ...SF Big Analytics & SF Machine Learning Meetup: Machine Learning at the Limit ...
SF Big Analytics & SF Machine Learning Meetup: Machine Learning at the Limit ...
 
Jvm problem diagnostics
Jvm problem diagnosticsJvm problem diagnostics
Jvm problem diagnostics
 
JITServerTalk Nebraska 2023.pdf
JITServerTalk Nebraska 2023.pdfJITServerTalk Nebraska 2023.pdf
JITServerTalk Nebraska 2023.pdf
 
Modern Engineer’s Troubleshooting Tools, Techniques & Tricks at Confoo 2018
Modern Engineer’s Troubleshooting Tools, Techniques & Tricks at Confoo 2018Modern Engineer’s Troubleshooting Tools, Techniques & Tricks at Confoo 2018
Modern Engineer’s Troubleshooting Tools, Techniques & Tricks at Confoo 2018
 
Loom promises: be there!
Loom promises: be there!Loom promises: be there!
Loom promises: be there!
 
Javaland_JITServerTalk.pptx
Javaland_JITServerTalk.pptxJavaland_JITServerTalk.pptx
Javaland_JITServerTalk.pptx
 
Introduction of Java GC Tuning and Java Java Mission Control
Introduction of Java GC Tuning and Java Java Mission ControlIntroduction of Java GC Tuning and Java Java Mission Control
Introduction of Java GC Tuning and Java Java Mission Control
 
Java performance tuning
Java performance tuningJava performance tuning
Java performance tuning
 
ContainerWorkloadwithSemeru.pdf
ContainerWorkloadwithSemeru.pdfContainerWorkloadwithSemeru.pdf
ContainerWorkloadwithSemeru.pdf
 
Performance Benchmarking: Tips, Tricks, and Lessons Learned
Performance Benchmarking: Tips, Tricks, and Lessons LearnedPerformance Benchmarking: Tips, Tricks, and Lessons Learned
Performance Benchmarking: Tips, Tricks, and Lessons Learned
 
Make Oracle scream with Flash Storage - Kaminario
Make Oracle scream with Flash Storage - KaminarioMake Oracle scream with Flash Storage - Kaminario
Make Oracle scream with Flash Storage - Kaminario
 
JITServerTalk JCON World 2023.pdf
JITServerTalk JCON World 2023.pdfJITServerTalk JCON World 2023.pdf
JITServerTalk JCON World 2023.pdf
 
.NET Memory Primer (Martin Kulov)
.NET Memory Primer (Martin Kulov).NET Memory Primer (Martin Kulov)
.NET Memory Primer (Martin Kulov)
 
Kafka to the Maxka - (Kafka Performance Tuning)
Kafka to the Maxka - (Kafka Performance Tuning)Kafka to the Maxka - (Kafka Performance Tuning)
Kafka to the Maxka - (Kafka Performance Tuning)
 
Flink Forward Berlin 2017: Robert Metzger - Keep it going - How to reliably a...
Flink Forward Berlin 2017: Robert Metzger - Keep it going - How to reliably a...Flink Forward Berlin 2017: Robert Metzger - Keep it going - How to reliably a...
Flink Forward Berlin 2017: Robert Metzger - Keep it going - How to reliably a...
 
Nexcess Magento Imagine 2014 Performance Breakout
Nexcess Magento Imagine 2014 Performance BreakoutNexcess Magento Imagine 2014 Performance Breakout
Nexcess Magento Imagine 2014 Performance Breakout
 
JITServerTalk-OSS-2023.pdf
JITServerTalk-OSS-2023.pdfJITServerTalk-OSS-2023.pdf
JITServerTalk-OSS-2023.pdf
 
HPPG - high performance photo gallery
HPPG - high performance photo galleryHPPG - high performance photo gallery
HPPG - high performance photo gallery
 

Dernier

Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 

Dernier (20)

Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 

Why does my jenkins freeze sometimes and what can I do about it?

Notes de l'éditeur

  1. In order to develop and deliver fast, you need fast tools.
  2. Taboola - The meetup host
  3. Examples for Taboola’s widgets
  4. Taboola’s usage scale
  5. Our Jenkins environment. We have 4 Jenkins master, on of them is the major Jenkins that serves the major builds. We have about 48 slaves, hundreds of builds per day with lots of automation: unit testing, integration, selenium and more. We use Jenkins pipeline widely.
  6. Technologies used at taboola
  7. I prepared a list of topics that will assist solving issues like the freeze issue.
  8. So, Jenkins freezes sometimes, when I first encountered that issue I start investigating what is the cause. I saw that the Jenkins machine was not loaded (CPU, Memory), so I understood that it is something applicative. Then, I found a blog post that suggested that the issue is the JAVA garbage collector, and followed that suggestion. In order to understand the garbage collector, let's have a quick view on the JVM and some its components
  9. The JVM consist of some parts for example: Class loader, Runtime data areas and the execution engine. The highlighted components, the JIT Compiler, Garbage collector and the heap are the major components that affects the JVM performance. The JIT Compiler is not in the scope of that talk, but we will talk about the garbage collector, and for that we need to talk about the heap first.
  10. Let’s focus on the data runtime areas. We see that there are parts that are shared between the threads like the heap, and part that are per thread like the stack. Most of us know or heard about the heap and the stack but what are they actually? The heap and the stack are memory sets, each one stores different elements. The stack for examples, holds local variables, primitives and addresses. The heap stores objects.
  11. In the example we can see that: We define int x=99 and it is stored in the stack We define Counter c1 and it is also stored in the stack (it is a pointer to a null object) When we create an instance of Counter, the instance is stored in the heap and the address is stored in the stack. I said that the heap has an effect on the JVM performance, and the thing that most of us do (in relation to the heap) is to define its maximum size.
  12. Pop quiz: We have 2 heaps, each has a different size, in which heap do you think we can store more objects? The correct answer is the 32GB heap. The reason is special mechanism called UseCompressedOop. This mechanism shrinks the object's pointer from 64bit to 32bit (on 64bit platforms), therefore create a lot more space in the heap. The mechanism works by default on heaps up to 32GB (actually a little less), and then stops. When it stops, that means that the pointer grows back to 64bit and we have much less space in the heap. To compensate that we need to create a 48GB heap! So, when you define your heap size, try to keep it less than 32GB or above 48GB.
  13. To define the maximum heap size we use -Xmx -Xms is used to define the initial heap size. In order to check of UseCompressedOops works, we can use jinfo which is a tool that comes with the java JDK.
  14. Let’s have a look on the heap areas. We have Eden, this is the area where most of the objects are created and removed (collected) The survivor areas - Objects that survive collection in the eden, are promoted to a survivor area. Object that survive a collection in the survivor area is move to the other survivor areas in the first N cycles. After the Nth cycle the object gets promoted to the old generation. Eden + survivor = Young Old = Tenured Now let’s talk about the garbage collector
  15. What is garbage collector? The garbage collector is an automatic memory management process. One of its main goal is to identify unused object in the heap and release the memory that they hold. (Note: unused objects are object that can no longer be refer to) There are a few different implementation for the garbage collector.
  16. You can check which garbage collector your application use by using the command: Jmap -heap <pid> In the example I started a Jenkins instance on my laptop and got: Parallel GC with 4 threads This is the GC type.
  17. There are 4 types of GC: Serial, Parallel (which we saw earlier), CMS - Concurrent Mark and Sweep and G1. The first 2, Serial and Parallel stops the application when they run. This pause is called “stop the world” pause. The other 2, CMS and G1, tries to keep the pause time to the minimum while doing some of their tasks concurrently with the application. They are also called Mostly concurrent collectors. The G1 is the newer and is going to be the default GC in Java 9. The solution I present here uses G1.
  18. G1 divides the heap a bit different, it breaks the heap to lots of small regions sizes 1Mb to 32MB. Those region are combined logically to the same heap areas we saw earlier (Eden, Survivor and Old gen) One of the first actions the G1 does it to pick the top garbage regions - the region that has the most unused / unreferenced objects - and collects them. Its name comes from that action, G1 = garbage first. G1 has a default pause time target of 200ms, and it will try to make it by learning from previous collections and selecting region which it can collect on time. Now that we have the background, let’s see the general guidelines to solve the freeze issue.
  19. First enable G1GC by using the JVM flag -XX:+UseG1GC In addition, add GC log flags so we can analyze the log behavior. In the example you can see some of the log flags I use.
  20. A record in the log will look like this. There is a lot of data here: type of action, time, duration, memory before and after, and a lot more. In order to analyze it we need an automatic tool.
  21. I use GCeasy. This tool allows you to upload GC logs and it performs analysis on them. It will tell you if there is a problem and suggest a solution. In addition it will display a report with some data. In the example report you can see that the throughput is about 60%. Throughput is the percentage of time that the application run. Which means that the application stopped for about 40% of the time. This is a very low throughput. You can also see the the maximum garbage collection time is almost 10 seconds, where we talked about a target of 200ms. So we can definitely understand that something is not working well.
  22. In this report you can see the duration of the GC over time. At first there were only young collections that performed well, but then it started to perform full collection (on the entire heap) and it takes lots of time. Those cases indicates that tuning is required.
  23. Tuning is done by adding (or removing) JVM flags. Here are some JVM flags that are related to the G1GC (the numbers are the default values): -XX:MaxGCPauseMillis=<n> (default 200ms) - for changing the default pause time -XX:InitiatingHeapOccupancyPercent=45 - the heap occupancy percentage where the GC starts its cycle -XX:ParallelGCThreads=15 - amount of threads to be use in GC actions that “stop the world” -XX:ConcGCThreads=4 - amount of threads to be used in GC concurrent actions -XX:+UseStringDeduplication - String deduplication is a G1 feature that saves memory that is taken by duplicated string in the heap. -XX:+DisableExplicitGC - disable the option to perform system.gc() calls which can lead to unnecessary GC cycles Adding flags does not end the process, it will take you a few cycles until you find the proper flags for your application. Note: after switching to G1 and adding flags, you need to give your application some time to run in order to get enough data in the logs.
  24. Monitoring There are a lot of monitoring tools, but a nice tools that comes with java is the Jconsole. Jconsole can connect to the process (locally or remote), and show some data about the JVM. the data includes: general JVM data (flags, heap size, etc), over time graphs of CPU usage, classes count, thread count and memory usage. You can identify issues with the heap graph, for examples if the graph show that the memory usage gets higher and higher over time, or if the GC cycles don’t collects enough data.
  25. In order to enable the ability to connect with Jconsole, you need to add the JMX system properties to the startup of your application. The properties are: host, port and authentication. Then you can open Jconsole, type the host and port and connect.
  26. The last item I want to mention is the Jenkins old data mechanism. (Jenkins -> Manage Jenkins -> Manage Old data) This is a backward compatibility mechanism. When the format of the files on the disk is changed, Jenkins keeps the old format and loads the new format to the memory. This can also cause to redundant GC cycles or even out of memory. So make a habit (or a script) and from time to time check if the data in that page is still relevant, if not remove it.
  27. To sum it up, In order to solve the freeze issue: Enable G1GC and logs Analyze the current behavior Add relevant flags (you’ll need to understand the flags you add) Repeat steps 2, 3 until satisfied Keep monitoring Remove old data from time to time (especially after updating plugins or core)
  28. Give Jenkins pilot sunglasses
  29. Recommended resources I used for my research.