SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Mais procurados

syzkaller: the next gen kernel fuzzer
syzkaller: the next gen kernel fuzzersyzkaller: the next gen kernel fuzzer
syzkaller: the next gen kernel fuzzerDmitry Vyukov
 
Mapping Detection Coverage
Mapping Detection CoverageMapping Detection Coverage
Mapping Detection CoverageJared Atkinson
 
Exploring Thermal Related Stuff in iDevices using Open-Source Tool
Exploring Thermal Related Stuff in iDevices using Open-Source ToolExploring Thermal Related Stuff in iDevices using Open-Source Tool
Exploring Thermal Related Stuff in iDevices using Open-Source ToolKoan-Sin Tan
 
How to apply machine learning into your CI/CD pipeline
How to apply machine learning into your CI/CD pipelineHow to apply machine learning into your CI/CD pipeline
How to apply machine learning into your CI/CD pipelineAlon Weiss
 
Kernel Recipes 2017: Using Linux perf at Netflix
Kernel Recipes 2017: Using Linux perf at NetflixKernel Recipes 2017: Using Linux perf at Netflix
Kernel Recipes 2017: Using Linux perf at NetflixBrendan Gregg
 
Open Souce Intelligence (OSINT)
Open Souce Intelligence (OSINT)Open Souce Intelligence (OSINT)
Open Souce Intelligence (OSINT)shuna roo
 
GraalVM, CRaC, Leyden and friends
GraalVM, CRaC, Leyden and friendsGraalVM, CRaC, Leyden and friends
GraalVM, CRaC, Leyden and friendsArtur Skowroński
 
Apache Kylin: Speed Up Cubing with Apache Spark with Luke Han and Shaofeng Shi
 Apache Kylin: Speed Up Cubing with Apache Spark with Luke Han and Shaofeng Shi Apache Kylin: Speed Up Cubing with Apache Spark with Luke Han and Shaofeng Shi
Apache Kylin: Speed Up Cubing with Apache Spark with Luke Han and Shaofeng ShiDatabricks
 
Simplified Security Code Review Process
Simplified Security Code Review ProcessSimplified Security Code Review Process
Simplified Security Code Review ProcessSherif Koussa
 
Developing high frequency indicators using real time tick data on apache supe...
Developing high frequency indicators using real time tick data on apache supe...Developing high frequency indicators using real time tick data on apache supe...
Developing high frequency indicators using real time tick data on apache supe...Zekeriya Besiroglu
 
あ! やせいのEmotetがあらわれた! ~ IIJ C-SOCサービスの分析ルールについて~
あ! やせいのEmotetがあらわれた! ~ IIJ C-SOCサービスの分析ルールについて~あ! やせいのEmotetがあらわれた! ~ IIJ C-SOCサービスの分析ルールについて~
あ! やせいのEmotetがあらわれた! ~ IIJ C-SOCサービスの分析ルールについて~IIJ
 
Container Performance Analysis Brendan Gregg, Netflix
Container Performance Analysis Brendan Gregg, NetflixContainer Performance Analysis Brendan Gregg, Netflix
Container Performance Analysis Brendan Gregg, NetflixDocker, Inc.
 
Red7 SSDLC Introduction: Building Secure Web and Mobile Applications
Red7 SSDLC Introduction: Building Secure Web and Mobile ApplicationsRed7 SSDLC Introduction: Building Secure Web and Mobile Applications
Red7 SSDLC Introduction: Building Secure Web and Mobile ApplicationsRobert Grupe, CSSLP CISSP PE PMP
 
How Netflix Tunes EC2 Instances for Performance
How Netflix Tunes EC2 Instances for PerformanceHow Netflix Tunes EC2 Instances for Performance
How Netflix Tunes EC2 Instances for PerformanceBrendan Gregg
 
Exploring the x64
Exploring the x64Exploring the x64
Exploring the x64FFRI, Inc.
 
Sandbox Evasion Cheat Sheet
Sandbox Evasion Cheat SheetSandbox Evasion Cheat Sheet
Sandbox Evasion Cheat SheetThomas Roccia
 
Windows 10 Nt Heap Exploitation (English version)
Windows 10 Nt Heap Exploitation (English version)Windows 10 Nt Heap Exploitation (English version)
Windows 10 Nt Heap Exploitation (English version)Angel Boy
 
Ownership System in Rust
Ownership System in RustOwnership System in Rust
Ownership System in RustChih-Hsuan Kuo
 

Mais procurados (20)

syzkaller: the next gen kernel fuzzer
syzkaller: the next gen kernel fuzzersyzkaller: the next gen kernel fuzzer
syzkaller: the next gen kernel fuzzer
 
Mapping Detection Coverage
Mapping Detection CoverageMapping Detection Coverage
Mapping Detection Coverage
 
Exploring Thermal Related Stuff in iDevices using Open-Source Tool
Exploring Thermal Related Stuff in iDevices using Open-Source ToolExploring Thermal Related Stuff in iDevices using Open-Source Tool
Exploring Thermal Related Stuff in iDevices using Open-Source Tool
 
How to apply machine learning into your CI/CD pipeline
How to apply machine learning into your CI/CD pipelineHow to apply machine learning into your CI/CD pipeline
How to apply machine learning into your CI/CD pipeline
 
Kernel Recipes 2017: Using Linux perf at Netflix
Kernel Recipes 2017: Using Linux perf at NetflixKernel Recipes 2017: Using Linux perf at Netflix
Kernel Recipes 2017: Using Linux perf at Netflix
 
AKS
AKSAKS
AKS
 
Open Souce Intelligence (OSINT)
Open Souce Intelligence (OSINT)Open Souce Intelligence (OSINT)
Open Souce Intelligence (OSINT)
 
GraalVM, CRaC, Leyden and friends
GraalVM, CRaC, Leyden and friendsGraalVM, CRaC, Leyden and friends
GraalVM, CRaC, Leyden and friends
 
Apache Kylin: Speed Up Cubing with Apache Spark with Luke Han and Shaofeng Shi
 Apache Kylin: Speed Up Cubing with Apache Spark with Luke Han and Shaofeng Shi Apache Kylin: Speed Up Cubing with Apache Spark with Luke Han and Shaofeng Shi
Apache Kylin: Speed Up Cubing with Apache Spark with Luke Han and Shaofeng Shi
 
Simplified Security Code Review Process
Simplified Security Code Review ProcessSimplified Security Code Review Process
Simplified Security Code Review Process
 
Developing high frequency indicators using real time tick data on apache supe...
Developing high frequency indicators using real time tick data on apache supe...Developing high frequency indicators using real time tick data on apache supe...
Developing high frequency indicators using real time tick data on apache supe...
 
Jenkins tutorial
Jenkins tutorialJenkins tutorial
Jenkins tutorial
 
あ! やせいのEmotetがあらわれた! ~ IIJ C-SOCサービスの分析ルールについて~
あ! やせいのEmotetがあらわれた! ~ IIJ C-SOCサービスの分析ルールについて~あ! やせいのEmotetがあらわれた! ~ IIJ C-SOCサービスの分析ルールについて~
あ! やせいのEmotetがあらわれた! ~ IIJ C-SOCサービスの分析ルールについて~
 
Container Performance Analysis Brendan Gregg, Netflix
Container Performance Analysis Brendan Gregg, NetflixContainer Performance Analysis Brendan Gregg, Netflix
Container Performance Analysis Brendan Gregg, Netflix
 
Red7 SSDLC Introduction: Building Secure Web and Mobile Applications
Red7 SSDLC Introduction: Building Secure Web and Mobile ApplicationsRed7 SSDLC Introduction: Building Secure Web and Mobile Applications
Red7 SSDLC Introduction: Building Secure Web and Mobile Applications
 
How Netflix Tunes EC2 Instances for Performance
How Netflix Tunes EC2 Instances for PerformanceHow Netflix Tunes EC2 Instances for Performance
How Netflix Tunes EC2 Instances for Performance
 
Exploring the x64
Exploring the x64Exploring the x64
Exploring the x64
 
Sandbox Evasion Cheat Sheet
Sandbox Evasion Cheat SheetSandbox Evasion Cheat Sheet
Sandbox Evasion Cheat Sheet
 
Windows 10 Nt Heap Exploitation (English version)
Windows 10 Nt Heap Exploitation (English version)Windows 10 Nt Heap Exploitation (English version)
Windows 10 Nt Heap Exploitation (English version)
 
Ownership System in Rust
Ownership System in RustOwnership System in Rust
Ownership System in Rust
 

Semelhante a 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
 
[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
 
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
 

Semelhante a 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
 
[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
 
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
 

Último

The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
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.
 
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
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
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
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
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
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
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
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 

Último (20)

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
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 ...
 
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
 
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...
 
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 ...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
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
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
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
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
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
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 

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

Notas do Editor

  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.