SlideShare a Scribd company logo
1 of 13
Download to read offline
GO Performance Tooling
Adil Hafeez
@adilhafeez
- Performance bites hard when app hits scale
- Even though GO is garbage collected language, allocated objects have
implications on latency and gc time
- When measuring latency,look at percentiles not just averages
- Percentiles show you tail latencies - this also helps you to understand what perf is those
unlucky customers seeing (bottom 1% or 5%)
Importance of Performance Measurement
What is profiling
- Pause application and capture thread stack multiple times per-second
- Usually takes around 100 stack dumps per second
- For java developers it is similar to running jstack (or yourkit) couple of times in a second
- With profiling data we can do lot of things like,
- Shows what functions are used
- Can build call graphs
- Find out what functions are at the top of the stack (taking CPU time)
Viewing CPU/Memory profile snapshot
- Every node is a function call
- A vertex from X to Y indicates a call from X -> Y
- For example in the profile snapshot below
- FindLoops took 4.41s of CPU time
- Remaining 30.28s were spent on outgoing function call
- “web” command opens up web view of profiler
GO Profiling tools - pprof
- What we can profile?
- Standalone application (start with profiling enabled through commandline arg)
- A live process
- Using net.http.pprof, go can capture profile of a live process
- Many others features available thorugh web interface like viewing passed in
command line arguments, memory profile, cpu profile etc.
- What you can do with profiling data
- View methods that are taking more time, or allocation more objects
- Annotate code with cpu/memory profile data
- Slice and dice into different parts of the program for better understanding of cpu time
- GO allows you to do cpu and memory profile (and blocking)
- CPU allows you to look at what functions are taking cpu time
- Memory profile lets you see memory allocation per function
GO Profiling tools - benchmarking
- Run test X number of times and reports the average time
- Prints allocations per call
- Run with multiple CPU (GOMAXPROCs)
- Execute following command to get memory allocation along with runtime,
- $ go test -bench=. -benchmem
pprof commands (top)
- Top command lets you view functions that are taking up most CPU time
pprof commands (weblist)
- weblist annotates source code with profiler data (and assembly) in a
webview
- Drill down and expand each source line to see assembly instructions (pretty powerful)
Live demo
- Type of garbage collectors
- STW - Stop the World
- Concurrent
- With 1.5, go started to have concurrent gc
- This means less time spent in STW phase (~ 10ms)
- Latencies improve overall
- More details here
- GO 1.6 does little better
- GC pauses is even lower
- See here for details
Garbage Collector
- Simplicity - core principle
- GOGC - the only parameter that you’d ever to tune
- Defaults to 100%, which really means that your heap size after garbage collection will be
kept at
- gctrace (GODEBUG=gctrace=1 commandline)
- Go program will start writing detailed information about GC on stdout
- Helpful in debuggin whether GC is the cause of latency or the not
- GOMAXPROC
- This sets the maximum number of processes GO process can use
- As of go1.5, there isnt any need to set this as runtime figures it out automatically
GO Performance Tuning (GC)
Summary
- Be judicious when allocating new objects
- See if you can use simpler data structures (e.g. slice instead of map)
- Reuse objects if possible (connection pooling, objects cache etc)
- Measure latencies in percentiles
- Enable web pprof in our application
- Doesnt cost much, and lets you take traces of live process
- For all users of 1.3, upgrade to 1.6
- Concurrent GC
- Less time spent in GC, more time for the app (mutator)
- Play with GOGC and gcdebug parameter
Links and further reading
- GO 1.5 gc release notes - https://blog.golang.org/go15gc
- Concurrent vs stop the world gc - https://talks.golang.org/2015/go-gc.pdf
- Testing and benchmarking - https://golang.org/pkg/testing/
- Running pprof from http - https://golang.org/pkg/net/http/pprof/
- Profiling GO Programs - https://blog.golang.org/profiling-go-programs
- http://www.stuartcheshire.org/rants/Latency.html

More Related Content

What's hot

Let’s Fix Logging Once and for All
Let’s Fix Logging Once and for AllLet’s Fix Logging Once and for All
Let’s Fix Logging Once and for AllScyllaDB
 
Tips on High Performance Server Programming
Tips on High Performance Server ProgrammingTips on High Performance Server Programming
Tips on High Performance Server ProgrammingJoshua Zhu
 
Basics of Logical Replication,Streaming replication vs Logical Replication ,U...
Basics of Logical Replication,Streaming replication vs Logical Replication ,U...Basics of Logical Replication,Streaming replication vs Logical Replication ,U...
Basics of Logical Replication,Streaming replication vs Logical Replication ,U...Rajni Baliyan
 
plProxy, pgBouncer, pgBalancer
plProxy, pgBouncer, pgBalancerplProxy, pgBouncer, pgBalancer
plProxy, pgBouncer, pgBalancerelliando dias
 
JavaScript code academy - introduction
JavaScript code academy - introductionJavaScript code academy - introduction
JavaScript code academy - introductionJaroslav Kubíček
 
DB Latency Using DRAM + PMem in App Direct & Memory Modes
DB Latency Using DRAM + PMem in App Direct & Memory ModesDB Latency Using DRAM + PMem in App Direct & Memory Modes
DB Latency Using DRAM + PMem in App Direct & Memory ModesScyllaDB
 
GulpJs - An Introduction
GulpJs - An IntroductionGulpJs - An Introduction
GulpJs - An IntroductionKnoldus Inc.
 
Islamabad PUG - 7th meetup - performance tuning
Islamabad PUG - 7th meetup - performance tuningIslamabad PUG - 7th meetup - performance tuning
Islamabad PUG - 7th meetup - performance tuningUmair Shahid
 
Salt Stack - Subhankar Sengupta
Salt Stack - Subhankar SenguptaSalt Stack - Subhankar Sengupta
Salt Stack - Subhankar SenguptaDevOpsBangalore
 
Linux talk | scheduled tasks
Linux talk | scheduled tasksLinux talk | scheduled tasks
Linux talk | scheduled tasksYashwantVarma1
 
OSNoise Tracer: Who Is Stealing My CPU Time?
OSNoise Tracer: Who Is Stealing My CPU Time?OSNoise Tracer: Who Is Stealing My CPU Time?
OSNoise Tracer: Who Is Stealing My CPU Time?ScyllaDB
 
Linux fundamental - Chap 15 Job Scheduling
Linux fundamental - Chap 15 Job SchedulingLinux fundamental - Chap 15 Job Scheduling
Linux fundamental - Chap 15 Job SchedulingKenny (netman)
 
Scalability strategies for cloud based system architecture
Scalability strategies for cloud based system architectureScalability strategies for cloud based system architecture
Scalability strategies for cloud based system architectureSangJin Kang
 
Full Stack Load Testing
Full Stack Load Testing Full Stack Load Testing
Full Stack Load Testing Terral R Jordan
 
Rails Application Optimization Techniques & Tools
Rails Application Optimization Techniques & ToolsRails Application Optimization Techniques & Tools
Rails Application Optimization Techniques & Toolsguest05c09d
 
Extreme HTTP Performance Tuning: 1.2M API req/s on a 4 vCPU EC2 Instance
Extreme HTTP Performance Tuning: 1.2M API req/s on a 4 vCPU EC2 InstanceExtreme HTTP Performance Tuning: 1.2M API req/s on a 4 vCPU EC2 Instance
Extreme HTTP Performance Tuning: 1.2M API req/s on a 4 vCPU EC2 InstanceScyllaDB
 
Scaling Apache Pulsar to 10 Petabytes/Day
Scaling Apache Pulsar to 10 Petabytes/DayScaling Apache Pulsar to 10 Petabytes/Day
Scaling Apache Pulsar to 10 Petabytes/DayScyllaDB
 
Bareon functional testing ci
Bareon functional testing   ciBareon functional testing   ci
Bareon functional testing ciMax Lobur
 

What's hot (20)

Let’s Fix Logging Once and for All
Let’s Fix Logging Once and for AllLet’s Fix Logging Once and for All
Let’s Fix Logging Once and for All
 
Tips on High Performance Server Programming
Tips on High Performance Server ProgrammingTips on High Performance Server Programming
Tips on High Performance Server Programming
 
Basics of Logical Replication,Streaming replication vs Logical Replication ,U...
Basics of Logical Replication,Streaming replication vs Logical Replication ,U...Basics of Logical Replication,Streaming replication vs Logical Replication ,U...
Basics of Logical Replication,Streaming replication vs Logical Replication ,U...
 
plProxy, pgBouncer, pgBalancer
plProxy, pgBouncer, pgBalancerplProxy, pgBouncer, pgBalancer
plProxy, pgBouncer, pgBalancer
 
JavaScript code academy - introduction
JavaScript code academy - introductionJavaScript code academy - introduction
JavaScript code academy - introduction
 
DB Latency Using DRAM + PMem in App Direct & Memory Modes
DB Latency Using DRAM + PMem in App Direct & Memory ModesDB Latency Using DRAM + PMem in App Direct & Memory Modes
DB Latency Using DRAM + PMem in App Direct & Memory Modes
 
GulpJs - An Introduction
GulpJs - An IntroductionGulpJs - An Introduction
GulpJs - An Introduction
 
Islamabad PUG - 7th meetup - performance tuning
Islamabad PUG - 7th meetup - performance tuningIslamabad PUG - 7th meetup - performance tuning
Islamabad PUG - 7th meetup - performance tuning
 
Salt Stack - Subhankar Sengupta
Salt Stack - Subhankar SenguptaSalt Stack - Subhankar Sengupta
Salt Stack - Subhankar Sengupta
 
Shootout at the AWS Corral
Shootout at the AWS CorralShootout at the AWS Corral
Shootout at the AWS Corral
 
Linux talk | scheduled tasks
Linux talk | scheduled tasksLinux talk | scheduled tasks
Linux talk | scheduled tasks
 
OSNoise Tracer: Who Is Stealing My CPU Time?
OSNoise Tracer: Who Is Stealing My CPU Time?OSNoise Tracer: Who Is Stealing My CPU Time?
OSNoise Tracer: Who Is Stealing My CPU Time?
 
Linux fundamental - Chap 15 Job Scheduling
Linux fundamental - Chap 15 Job SchedulingLinux fundamental - Chap 15 Job Scheduling
Linux fundamental - Chap 15 Job Scheduling
 
Scalability strategies for cloud based system architecture
Scalability strategies for cloud based system architectureScalability strategies for cloud based system architecture
Scalability strategies for cloud based system architecture
 
Full Stack Load Testing
Full Stack Load Testing Full Stack Load Testing
Full Stack Load Testing
 
Gulp
GulpGulp
Gulp
 
Rails Application Optimization Techniques & Tools
Rails Application Optimization Techniques & ToolsRails Application Optimization Techniques & Tools
Rails Application Optimization Techniques & Tools
 
Extreme HTTP Performance Tuning: 1.2M API req/s on a 4 vCPU EC2 Instance
Extreme HTTP Performance Tuning: 1.2M API req/s on a 4 vCPU EC2 InstanceExtreme HTTP Performance Tuning: 1.2M API req/s on a 4 vCPU EC2 Instance
Extreme HTTP Performance Tuning: 1.2M API req/s on a 4 vCPU EC2 Instance
 
Scaling Apache Pulsar to 10 Petabytes/Day
Scaling Apache Pulsar to 10 Petabytes/DayScaling Apache Pulsar to 10 Petabytes/Day
Scaling Apache Pulsar to 10 Petabytes/Day
 
Bareon functional testing ci
Bareon functional testing   ciBareon functional testing   ci
Bareon functional testing ci
 

Viewers also liked

EChr - CSR & HR - Presentation Dr/ Nicholas Andreou
EChr - CSR & HR - Presentation Dr/ Nicholas AndreouEChr - CSR & HR - Presentation Dr/ Nicholas Andreou
EChr - CSR & HR - Presentation Dr/ Nicholas AndreouEChr
 
бодовнA листa интерних активности стручног усавршавања
бодовнA листa интерних активности стручног усавршавањабодовнA листa интерних активности стручног усавршавања
бодовнA листa интерних активности стручног усавршавањаmkaseric
 
Whatchamacallit: Controlled Vocabularies for Technical Writers (Write the Doc...
Whatchamacallit: Controlled Vocabularies for Technical Writers (Write the Doc...Whatchamacallit: Controlled Vocabularies for Technical Writers (Write the Doc...
Whatchamacallit: Controlled Vocabularies for Technical Writers (Write the Doc...Emilie Boillat
 
WiFifor.me - увеличение лояльности ваших покупателей и гостей
WiFifor.me - увеличение лояльности ваших покупателей и гостейWiFifor.me - увеличение лояльности ваших покупателей и гостей
WiFifor.me - увеличение лояльности ваших покупателей и гостейSoloten
 
Whatchamacallit: Controlled Vocabularies for Technical Writers (soap! 2015)
Whatchamacallit: Controlled Vocabularies for Technical Writers (soap! 2015)Whatchamacallit: Controlled Vocabularies for Technical Writers (soap! 2015)
Whatchamacallit: Controlled Vocabularies for Technical Writers (soap! 2015)Emilie Boillat
 
Biographies
BiographiesBiographies
Biographiesab8179
 
SoloTours
SoloToursSoloTours
SoloToursSoloten
 
Bahaging ginampanan ng simbahan sa pagpapalaganap ng kristaynismo at sa pamam...
Bahaging ginampanan ng simbahan sa pagpapalaganap ng kristaynismo at sa pamam...Bahaging ginampanan ng simbahan sa pagpapalaganap ng kristaynismo at sa pamam...
Bahaging ginampanan ng simbahan sa pagpapalaganap ng kristaynismo at sa pamam...Ran Apagar
 
Power point lesson_5_prep_g
Power point lesson_5_prep_gPower point lesson_5_prep_g
Power point lesson_5_prep_gbluepool
 
Steven ten Have. Integrated Coastal Zone (Change) Management
Steven ten Have. Integrated Coastal Zone (Change) ManagementSteven ten Have. Integrated Coastal Zone (Change) Management
Steven ten Have. Integrated Coastal Zone (Change) ManagementSUSCOD
 
Biographies
BiographiesBiographies
Biographiesab8179
 
Мобильное рабочее место руководителя
Мобильное рабочее место руководителяМобильное рабочее место руководителя
Мобильное рабочее место руководителяSoloten
 
Re-desenhando um novo Paradigma para a ECOnomia - Filipe Moreira Alves
Re-desenhando um novo Paradigma para a ECOnomia - Filipe Moreira AlvesRe-desenhando um novo Paradigma para a ECOnomia - Filipe Moreira Alves
Re-desenhando um novo Paradigma para a ECOnomia - Filipe Moreira AlvesPROUTugal
 
Solo Docs
Solo DocsSolo Docs
Solo DocsSoloten
 
CSR & HR - Presentation Pr. Chizu Nakajima
CSR & HR - Presentation Pr. Chizu NakajimaCSR & HR - Presentation Pr. Chizu Nakajima
CSR & HR - Presentation Pr. Chizu NakajimaEChr
 
Solowords
SolowordsSolowords
SolowordsSoloten
 
Контент-менеджмент: руководство к действию.
Контент-менеджмент: руководство к действию.Контент-менеджмент: руководство к действию.
Контент-менеджмент: руководство к действию.Soloten
 
The North Carolina Sales Institute
The North Carolina Sales InstituteThe North Carolina Sales Institute
The North Carolina Sales InstituteJohn L. Chapman
 

Viewers also liked (20)

EChr - CSR & HR - Presentation Dr/ Nicholas Andreou
EChr - CSR & HR - Presentation Dr/ Nicholas AndreouEChr - CSR & HR - Presentation Dr/ Nicholas Andreou
EChr - CSR & HR - Presentation Dr/ Nicholas Andreou
 
бодовнA листa интерних активности стручног усавршавања
бодовнA листa интерних активности стручног усавршавањабодовнA листa интерних активности стручног усавршавања
бодовнA листa интерних активности стручног усавршавања
 
Whatchamacallit: Controlled Vocabularies for Technical Writers (Write the Doc...
Whatchamacallit: Controlled Vocabularies for Technical Writers (Write the Doc...Whatchamacallit: Controlled Vocabularies for Technical Writers (Write the Doc...
Whatchamacallit: Controlled Vocabularies for Technical Writers (Write the Doc...
 
15:16museums and cultural pro
15:16museums and cultural pro15:16museums and cultural pro
15:16museums and cultural pro
 
WiFifor.me - увеличение лояльности ваших покупателей и гостей
WiFifor.me - увеличение лояльности ваших покупателей и гостейWiFifor.me - увеличение лояльности ваших покупателей и гостей
WiFifor.me - увеличение лояльности ваших покупателей и гостей
 
Whatchamacallit: Controlled Vocabularies for Technical Writers (soap! 2015)
Whatchamacallit: Controlled Vocabularies for Technical Writers (soap! 2015)Whatchamacallit: Controlled Vocabularies for Technical Writers (soap! 2015)
Whatchamacallit: Controlled Vocabularies for Technical Writers (soap! 2015)
 
Biographies
BiographiesBiographies
Biographies
 
SoloTours
SoloToursSoloTours
SoloTours
 
Bahaging ginampanan ng simbahan sa pagpapalaganap ng kristaynismo at sa pamam...
Bahaging ginampanan ng simbahan sa pagpapalaganap ng kristaynismo at sa pamam...Bahaging ginampanan ng simbahan sa pagpapalaganap ng kristaynismo at sa pamam...
Bahaging ginampanan ng simbahan sa pagpapalaganap ng kristaynismo at sa pamam...
 
Power point lesson_5_prep_g
Power point lesson_5_prep_gPower point lesson_5_prep_g
Power point lesson_5_prep_g
 
Steven ten Have. Integrated Coastal Zone (Change) Management
Steven ten Have. Integrated Coastal Zone (Change) ManagementSteven ten Have. Integrated Coastal Zone (Change) Management
Steven ten Have. Integrated Coastal Zone (Change) Management
 
Biographies
BiographiesBiographies
Biographies
 
Мобильное рабочее место руководителя
Мобильное рабочее место руководителяМобильное рабочее место руководителя
Мобильное рабочее место руководителя
 
Re-desenhando um novo Paradigma para a ECOnomia - Filipe Moreira Alves
Re-desenhando um novo Paradigma para a ECOnomia - Filipe Moreira AlvesRe-desenhando um novo Paradigma para a ECOnomia - Filipe Moreira Alves
Re-desenhando um novo Paradigma para a ECOnomia - Filipe Moreira Alves
 
Solo Docs
Solo DocsSolo Docs
Solo Docs
 
CSR & HR - Presentation Pr. Chizu Nakajima
CSR & HR - Presentation Pr. Chizu NakajimaCSR & HR - Presentation Pr. Chizu Nakajima
CSR & HR - Presentation Pr. Chizu Nakajima
 
Solowords
SolowordsSolowords
Solowords
 
Контент-менеджмент: руководство к действию.
Контент-менеджмент: руководство к действию.Контент-менеджмент: руководство к действию.
Контент-менеджмент: руководство к действию.
 
Readme
ReadmeReadme
Readme
 
The North Carolina Sales Institute
The North Carolina Sales InstituteThe North Carolina Sales Institute
The North Carolina Sales Institute
 

Similar to Go performance tooling

Profiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / WebgrindProfiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / WebgrindSam Keen
 
How to pinpoint and fix sources of performance problems in your SAP BusinessO...
How to pinpoint and fix sources of performance problems in your SAP BusinessO...How to pinpoint and fix sources of performance problems in your SAP BusinessO...
How to pinpoint and fix sources of performance problems in your SAP BusinessO...Xoomworks Business Intelligence
 
Performance Tuning Oracle Weblogic Server 12c
Performance Tuning Oracle Weblogic Server 12cPerformance Tuning Oracle Weblogic Server 12c
Performance Tuning Oracle Weblogic Server 12cAjith Narayanan
 
Odoo command line interface
Odoo command line interfaceOdoo command line interface
Odoo command line interfaceJalal Zahid
 
PuppetDB: Sneaking Clojure into Operations
PuppetDB: Sneaking Clojure into OperationsPuppetDB: Sneaking Clojure into Operations
PuppetDB: Sneaking Clojure into Operationsgrim_radical
 
Understanding Spark Tuning: Strata New York
Understanding Spark Tuning: Strata New YorkUnderstanding Spark Tuning: Strata New York
Understanding Spark Tuning: Strata New YorkRachel Warren
 
Spark Autotuning Talk - Strata New York
Spark Autotuning Talk - Strata New YorkSpark Autotuning Talk - Strata New York
Spark Autotuning Talk - Strata New YorkHolden Karau
 
Spark Autotuning - Strata EU 2018
Spark Autotuning - Strata EU 2018Spark Autotuning - Strata EU 2018
Spark Autotuning - Strata EU 2018Holden Karau
 
Scaling python webapps from 0 to 50 million users - A top-down approach
Scaling python webapps from 0 to 50 million users - A top-down approachScaling python webapps from 0 to 50 million users - A top-down approach
Scaling python webapps from 0 to 50 million users - A top-down approachJinal Jhaveri
 
Hadoop cluster performance profiler
Hadoop cluster performance profilerHadoop cluster performance profiler
Hadoop cluster performance profilerIhor Bobak
 
Azure Functions @ global azure day 2017
Azure Functions  @ global azure day 2017Azure Functions  @ global azure day 2017
Azure Functions @ global azure day 2017Sean Feldman
 
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...javier ramirez
 
Java Performance and Profiling
Java Performance and ProfilingJava Performance and Profiling
Java Performance and ProfilingWSO2
 
Performance Tuning Cheat Sheet for MongoDB
Performance Tuning Cheat Sheet for MongoDBPerformance Tuning Cheat Sheet for MongoDB
Performance Tuning Cheat Sheet for MongoDBSeveralnines
 
Guide to alfresco monitoring
Guide to alfresco monitoringGuide to alfresco monitoring
Guide to alfresco monitoringMiguel Rodriguez
 
airflowpresentation1-180717183432.pptx
airflowpresentation1-180717183432.pptxairflowpresentation1-180717183432.pptx
airflowpresentation1-180717183432.pptxVIJAYAPRABAP
 
Putting Lipstick on Apache Pig at Netflix
Putting Lipstick on Apache Pig at NetflixPutting Lipstick on Apache Pig at Netflix
Putting Lipstick on Apache Pig at NetflixJeff Magnusson
 
Netflix - Pig with Lipstick by Jeff Magnusson
Netflix - Pig with Lipstick by Jeff Magnusson Netflix - Pig with Lipstick by Jeff Magnusson
Netflix - Pig with Lipstick by Jeff Magnusson Hakka Labs
 

Similar to Go performance tooling (20)

Profiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / WebgrindProfiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / Webgrind
 
How to pinpoint and fix sources of performance problems in your SAP BusinessO...
How to pinpoint and fix sources of performance problems in your SAP BusinessO...How to pinpoint and fix sources of performance problems in your SAP BusinessO...
How to pinpoint and fix sources of performance problems in your SAP BusinessO...
 
Performance Tuning Oracle Weblogic Server 12c
Performance Tuning Oracle Weblogic Server 12cPerformance Tuning Oracle Weblogic Server 12c
Performance Tuning Oracle Weblogic Server 12c
 
Odoo command line interface
Odoo command line interfaceOdoo command line interface
Odoo command line interface
 
PuppetDB: Sneaking Clojure into Operations
PuppetDB: Sneaking Clojure into OperationsPuppetDB: Sneaking Clojure into Operations
PuppetDB: Sneaking Clojure into Operations
 
Understanding Spark Tuning: Strata New York
Understanding Spark Tuning: Strata New YorkUnderstanding Spark Tuning: Strata New York
Understanding Spark Tuning: Strata New York
 
Spark Autotuning Talk - Strata New York
Spark Autotuning Talk - Strata New YorkSpark Autotuning Talk - Strata New York
Spark Autotuning Talk - Strata New York
 
Spark Autotuning - Strata EU 2018
Spark Autotuning - Strata EU 2018Spark Autotuning - Strata EU 2018
Spark Autotuning - Strata EU 2018
 
Scaling python webapps from 0 to 50 million users - A top-down approach
Scaling python webapps from 0 to 50 million users - A top-down approachScaling python webapps from 0 to 50 million users - A top-down approach
Scaling python webapps from 0 to 50 million users - A top-down approach
 
Hadoop cluster performance profiler
Hadoop cluster performance profilerHadoop cluster performance profiler
Hadoop cluster performance profiler
 
Azure Functions @ global azure day 2017
Azure Functions  @ global azure day 2017Azure Functions  @ global azure day 2017
Azure Functions @ global azure day 2017
 
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
 
Autosar Basics hand book_v1
Autosar Basics  hand book_v1Autosar Basics  hand book_v1
Autosar Basics hand book_v1
 
Java Performance and Profiling
Java Performance and ProfilingJava Performance and Profiling
Java Performance and Profiling
 
Performance Tuning Cheat Sheet for MongoDB
Performance Tuning Cheat Sheet for MongoDBPerformance Tuning Cheat Sheet for MongoDB
Performance Tuning Cheat Sheet for MongoDB
 
Guide to alfresco monitoring
Guide to alfresco monitoringGuide to alfresco monitoring
Guide to alfresco monitoring
 
airflowpresentation1-180717183432.pptx
airflowpresentation1-180717183432.pptxairflowpresentation1-180717183432.pptx
airflowpresentation1-180717183432.pptx
 
Lipstick On Pig
Lipstick On Pig Lipstick On Pig
Lipstick On Pig
 
Putting Lipstick on Apache Pig at Netflix
Putting Lipstick on Apache Pig at NetflixPutting Lipstick on Apache Pig at Netflix
Putting Lipstick on Apache Pig at Netflix
 
Netflix - Pig with Lipstick by Jeff Magnusson
Netflix - Pig with Lipstick by Jeff Magnusson Netflix - Pig with Lipstick by Jeff Magnusson
Netflix - Pig with Lipstick by Jeff Magnusson
 

Recently uploaded

Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 

Recently uploaded (20)

Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 

Go performance tooling

  • 1. GO Performance Tooling Adil Hafeez @adilhafeez
  • 2. - Performance bites hard when app hits scale - Even though GO is garbage collected language, allocated objects have implications on latency and gc time - When measuring latency,look at percentiles not just averages - Percentiles show you tail latencies - this also helps you to understand what perf is those unlucky customers seeing (bottom 1% or 5%) Importance of Performance Measurement
  • 3. What is profiling - Pause application and capture thread stack multiple times per-second - Usually takes around 100 stack dumps per second - For java developers it is similar to running jstack (or yourkit) couple of times in a second - With profiling data we can do lot of things like, - Shows what functions are used - Can build call graphs - Find out what functions are at the top of the stack (taking CPU time)
  • 4. Viewing CPU/Memory profile snapshot - Every node is a function call - A vertex from X to Y indicates a call from X -> Y - For example in the profile snapshot below - FindLoops took 4.41s of CPU time - Remaining 30.28s were spent on outgoing function call - “web” command opens up web view of profiler
  • 5. GO Profiling tools - pprof - What we can profile? - Standalone application (start with profiling enabled through commandline arg) - A live process - Using net.http.pprof, go can capture profile of a live process - Many others features available thorugh web interface like viewing passed in command line arguments, memory profile, cpu profile etc. - What you can do with profiling data - View methods that are taking more time, or allocation more objects - Annotate code with cpu/memory profile data - Slice and dice into different parts of the program for better understanding of cpu time - GO allows you to do cpu and memory profile (and blocking) - CPU allows you to look at what functions are taking cpu time - Memory profile lets you see memory allocation per function
  • 6. GO Profiling tools - benchmarking - Run test X number of times and reports the average time - Prints allocations per call - Run with multiple CPU (GOMAXPROCs) - Execute following command to get memory allocation along with runtime, - $ go test -bench=. -benchmem
  • 7. pprof commands (top) - Top command lets you view functions that are taking up most CPU time
  • 8. pprof commands (weblist) - weblist annotates source code with profiler data (and assembly) in a webview - Drill down and expand each source line to see assembly instructions (pretty powerful)
  • 10. - Type of garbage collectors - STW - Stop the World - Concurrent - With 1.5, go started to have concurrent gc - This means less time spent in STW phase (~ 10ms) - Latencies improve overall - More details here - GO 1.6 does little better - GC pauses is even lower - See here for details Garbage Collector
  • 11. - Simplicity - core principle - GOGC - the only parameter that you’d ever to tune - Defaults to 100%, which really means that your heap size after garbage collection will be kept at - gctrace (GODEBUG=gctrace=1 commandline) - Go program will start writing detailed information about GC on stdout - Helpful in debuggin whether GC is the cause of latency or the not - GOMAXPROC - This sets the maximum number of processes GO process can use - As of go1.5, there isnt any need to set this as runtime figures it out automatically GO Performance Tuning (GC)
  • 12. Summary - Be judicious when allocating new objects - See if you can use simpler data structures (e.g. slice instead of map) - Reuse objects if possible (connection pooling, objects cache etc) - Measure latencies in percentiles - Enable web pprof in our application - Doesnt cost much, and lets you take traces of live process - For all users of 1.3, upgrade to 1.6 - Concurrent GC - Less time spent in GC, more time for the app (mutator) - Play with GOGC and gcdebug parameter
  • 13. Links and further reading - GO 1.5 gc release notes - https://blog.golang.org/go15gc - Concurrent vs stop the world gc - https://talks.golang.org/2015/go-gc.pdf - Testing and benchmarking - https://golang.org/pkg/testing/ - Running pprof from http - https://golang.org/pkg/net/http/pprof/ - Profiling GO Programs - https://blog.golang.org/profiling-go-programs - http://www.stuartcheshire.org/rants/Latency.html