SlideShare ist ein Scribd-Unternehmen logo
1 von 17
Dynamic Tracing your AMP site Sriram Natarajan Engineer Sun Microsystems Inc
What is Dtrace ? ,[object Object]
Analyze data looking for bottlenecks, trends and correlations.
Speculate on remedies
Evaluate and repeat the process ,[object Object]
Largely new functionality to ask questions.
How does it work ? ,[object Object]
Zero probe effect when Dtrace is not running.
Does a fast trap into Dtrace probe to minimize performance impact.
A simple Dtrace script #!/usr/sbin/dtrace -qs syscall:::entry  {  @num[probefunc] = count()  }
Dtrace format ●   provider:module:function:name ●  -P provider ●  -m module ●  -f function ●  -n name ●  -s script ●  -p pid ●  -c run command ●  -l list ●  -v verbose
How to write a Dtrace script ,[object Object]
http://www.opensolaris.org/os/community/dtrace/dtracetoolkit/ ,[object Object]
MySQL sample Dtrace scripts are available at ,[object Object]
Dtrace for AMP stack ,[object Object]
MySQL / PHP Dtrace probes are enabled within engine
Fired when execution flow reaches probe location.

Weitere ähnliche Inhalte

Was ist angesagt?

PHP applications/environments monitoring: APM & Pinba
PHP applications/environments monitoring: APM & PinbaPHP applications/environments monitoring: APM & Pinba
PHP applications/environments monitoring: APM & Pinba
Patrick Allaert
 

Was ist angesagt? (20)

Protocol handler in Gecko
Protocol handler in GeckoProtocol handler in Gecko
Protocol handler in Gecko
 
Evgeniy Muralev, Mark Vince, Working with the compiler, not against it
Evgeniy Muralev, Mark Vince, Working with the compiler, not against itEvgeniy Muralev, Mark Vince, Working with the compiler, not against it
Evgeniy Muralev, Mark Vince, Working with the compiler, not against it
 
SHA1 collision analysis and resolving a problem of recursive hashing with xra...
SHA1 collision analysis and resolving a problem of recursive hashing with xra...SHA1 collision analysis and resolving a problem of recursive hashing with xra...
SHA1 collision analysis and resolving a problem of recursive hashing with xra...
 
A CTF Hackers Toolbox
A CTF Hackers ToolboxA CTF Hackers Toolbox
A CTF Hackers Toolbox
 
TensorFlow XLA RPC
TensorFlow XLA RPCTensorFlow XLA RPC
TensorFlow XLA RPC
 
Евгений Крутько, Многопоточные вычисления, современный подход.
Евгений Крутько, Многопоточные вычисления, современный подход.Евгений Крутько, Многопоточные вычисления, современный подход.
Евгений Крутько, Многопоточные вычисления, современный подход.
 
Top 10 Perl Performance Tips
Top 10 Perl Performance TipsTop 10 Perl Performance Tips
Top 10 Perl Performance Tips
 
Devel::NYTProf 2009-07 (OUTDATED, see 201008)
Devel::NYTProf 2009-07 (OUTDATED, see 201008)Devel::NYTProf 2009-07 (OUTDATED, see 201008)
Devel::NYTProf 2009-07 (OUTDATED, see 201008)
 
Binary Studio Academy: Concurrency in C# 5.0
Binary Studio Academy: Concurrency in C# 5.0Binary Studio Academy: Concurrency in C# 5.0
Binary Studio Academy: Concurrency in C# 5.0
 
typemap in Perl/XS
typemap in Perl/XS  typemap in Perl/XS
typemap in Perl/XS
 
Антон Бикинеев, Reflection in C++Next
Антон Бикинеев,  Reflection in C++NextАнтон Бикинеев,  Reflection in C++Next
Антон Бикинеев, Reflection in C++Next
 
JavaOne 2015 - Having fun with Javassist
JavaOne 2015 - Having fun with JavassistJavaOne 2015 - Having fun with Javassist
JavaOne 2015 - Having fun with Javassist
 
GTAC 2014: What lurks in test suites?
GTAC 2014: What lurks in test suites?GTAC 2014: What lurks in test suites?
GTAC 2014: What lurks in test suites?
 
TensorFlow local Python XLA client
TensorFlow local Python XLA clientTensorFlow local Python XLA client
TensorFlow local Python XLA client
 
Kirk Shoop, Reactive programming in C++
Kirk Shoop, Reactive programming in C++Kirk Shoop, Reactive programming in C++
Kirk Shoop, Reactive programming in C++
 
An Experiment with Checking the glibc Library
An Experiment with Checking the glibc LibraryAn Experiment with Checking the glibc Library
An Experiment with Checking the glibc Library
 
PHP applications/environments monitoring: APM & Pinba
PHP applications/environments monitoring: APM & PinbaPHP applications/environments monitoring: APM & Pinba
PHP applications/environments monitoring: APM & Pinba
 
How to inspect a RUNNING perl process
How to inspect a RUNNING perl processHow to inspect a RUNNING perl process
How to inspect a RUNNING perl process
 
Profiling and optimizing go programs
Profiling and optimizing go programsProfiling and optimizing go programs
Profiling and optimizing go programs
 
The Challenges of Container Configuration
The Challenges of Container ConfigurationThe Challenges of Container Configuration
The Challenges of Container Configuration
 

Ähnlich wie Dynamic Tracing of your AMP web site

D Trace Support In My Sql Guide To Solving Reallife Performance Problems
D Trace Support In My Sql Guide To Solving Reallife Performance ProblemsD Trace Support In My Sql Guide To Solving Reallife Performance Problems
D Trace Support In My Sql Guide To Solving Reallife Performance Problems
MySQLConference
 
r,rstats,r language,r packages
r,rstats,r language,r packagesr,rstats,r language,r packages
r,rstats,r language,r packages
Ajay Ohri
 
It802 bruning
It802 bruningIt802 bruning
It802 bruning
mrbruning
 

Ähnlich wie Dynamic Tracing of your AMP web site (20)

D Trace Support In My Sql Guide To Solving Reallife Performance Problems
D Trace Support In My Sql Guide To Solving Reallife Performance ProblemsD Trace Support In My Sql Guide To Solving Reallife Performance Problems
D Trace Support In My Sql Guide To Solving Reallife Performance Problems
 
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak   CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
 
4Developers 2018: Pyt(h)on vs słoń: aktualny stan przetwarzania dużych danych...
4Developers 2018: Pyt(h)on vs słoń: aktualny stan przetwarzania dużych danych...4Developers 2018: Pyt(h)on vs słoń: aktualny stan przetwarzania dużych danych...
4Developers 2018: Pyt(h)on vs słoń: aktualny stan przetwarzania dużych danych...
 
Osol Pgsql
Osol PgsqlOsol Pgsql
Osol Pgsql
 
Cloud Observation and Performance Analysis using Solaris 11 DTrace
Cloud Observation and Performance Analysis using Solaris 11 DTraceCloud Observation and Performance Analysis using Solaris 11 DTrace
Cloud Observation and Performance Analysis using Solaris 11 DTrace
 
ETL with SPARK - First Spark London meetup
ETL with SPARK - First Spark London meetupETL with SPARK - First Spark London meetup
ETL with SPARK - First Spark London meetup
 
Learning Dtrace
Learning DtraceLearning Dtrace
Learning Dtrace
 
Hadoop cluster performance profiler
Hadoop cluster performance profilerHadoop cluster performance profiler
Hadoop cluster performance profiler
 
Monitoring MySQL with DTrace/SystemTap
Monitoring MySQL with DTrace/SystemTapMonitoring MySQL with DTrace/SystemTap
Monitoring MySQL with DTrace/SystemTap
 
Sinatra and JSONQuery Web Service
Sinatra and JSONQuery Web ServiceSinatra and JSONQuery Web Service
Sinatra and JSONQuery Web Service
 
Performance Profiling in Rust
Performance Profiling in RustPerformance Profiling in Rust
Performance Profiling in Rust
 
TransmogrifAI - Automate Machine Learning Workflow with the power of Scala an...
TransmogrifAI - Automate Machine Learning Workflow with the power of Scala an...TransmogrifAI - Automate Machine Learning Workflow with the power of Scala an...
TransmogrifAI - Automate Machine Learning Workflow with the power of Scala an...
 
dtrace
dtracedtrace
dtrace
 
Deep learning - the conf br 2018
Deep learning - the conf br 2018Deep learning - the conf br 2018
Deep learning - the conf br 2018
 
Monitoring as Code: Getting to Monitoring-Driven Development - DEV314 - re:In...
Monitoring as Code: Getting to Monitoring-Driven Development - DEV314 - re:In...Monitoring as Code: Getting to Monitoring-Driven Development - DEV314 - re:In...
Monitoring as Code: Getting to Monitoring-Driven Development - DEV314 - re:In...
 
r,rstats,r language,r packages
r,rstats,r language,r packagesr,rstats,r language,r packages
r,rstats,r language,r packages
 
It802 bruning
It802 bruningIt802 bruning
It802 bruning
 
Automate ml workflow_transmogrif_ai-_chetan_khatri_berlin-scala
Automate ml workflow_transmogrif_ai-_chetan_khatri_berlin-scalaAutomate ml workflow_transmogrif_ai-_chetan_khatri_berlin-scala
Automate ml workflow_transmogrif_ai-_chetan_khatri_berlin-scala
 
WMQ Toolbox: 20 Scripts, One-liners, & Utilities for UNIX & Windows
WMQ Toolbox: 20 Scripts, One-liners, & Utilities for UNIX & Windows WMQ Toolbox: 20 Scripts, One-liners, & Utilities for UNIX & Windows
WMQ Toolbox: 20 Scripts, One-liners, & Utilities for UNIX & Windows
 
Django - Framework web para perfeccionistas com prazos
Django - Framework web para perfeccionistas com prazosDjango - Framework web para perfeccionistas com prazos
Django - Framework web para perfeccionistas com prazos
 

Kürzlich hochgeladen

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Kürzlich hochgeladen (20)

Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 

Dynamic Tracing of your AMP web site

  • 1. Dynamic Tracing your AMP site Sriram Natarajan Engineer Sun Microsystems Inc
  • 2.
  • 3. Analyze data looking for bottlenecks, trends and correlations.
  • 5.
  • 6. Largely new functionality to ask questions.
  • 7.
  • 8. Zero probe effect when Dtrace is not running.
  • 9. Does a fast trap into Dtrace probe to minimize performance impact.
  • 10. A simple Dtrace script #!/usr/sbin/dtrace -qs syscall:::entry { @num[probefunc] = count() }
  • 11. Dtrace format ● provider:module:function:name ● -P provider ● -m module ● -f function ● -n name ● -s script ● -p pid ● -c run command ● -l list ● -v verbose
  • 12.
  • 13.
  • 14.
  • 15.
  • 16. MySQL / PHP Dtrace probes are enabled within engine
  • 17. Fired when execution flow reaches probe location.
  • 18. No overhead for inactive probes.
  • 19. Provide hard to get under the hood information in a simple way.
  • 20. Some performance hit depending on number of probes fired
  • 21. Sample MySQL D Script #!/usr/sbin/dtrace -qs dtrace:::BEGIN { printf("%-40s %2s %-9s", "Query", "QC", "Time(ms)"); } mysql*:::query-start { self->query = copyinstr(arg0); self->querystart = timestamp; self->qc = 0; } mysql*:::query-cache-hit { self->qc = 1; } mysql*:::query-cache-miss { self->qc = 0; } mysql*:::query-done { printf("%-40s %-2s %-9d",self->query,(self->qc ? "Y" : "N"), (timestamp - self->querystart) / 1000000); }
  • 22. Sample MySQL D Script Output select * from t1 order by i limit 10 N 1072 set global query_cache_size=262144 N 0 select * from t1 order by i limit 10 N 781 select * from t1 order by i limit 10 Y 0 select * from t1 order by i limit 30 Y 0 select * from t1 order by i limit 10 Y 0 select * from t1 order by i limit 10 Y 0
  • 23. MySQL Dtrace probes connection-start(id, user, hostname) connection-done(status, id) command-start(id, command_id) command-end(status) query-start(query, id, db, user, host) query-done(status) query-parse-start(query) query-parse-done(status) query-cache-hit(query, row) query-cache-miss(query) query-exec-start(query, id, db, host, exec_type) query-exec-done(status) insert/update/delete-row-start(db, table, status) insert/update/delete-row-done(db, table, status) select/insert/update/multi-update-start(query, status, rows, rowsmatched, rowschanged) select/insert/update/multi-update-done(query, status, rows, rowsmatched, rowschanged)
  • 24. Sample PHP D Script php*:::compile-file-entry /arg0 != NULL/ { self->compile_file = copyinstr(arg0); self->compile_start_time = timestamp; } php*:::compile-file-return /self->compile_file == copyinstr(arg0)/ { self->compile_elapsed = ((timestamp - self->compile_start_time) / 1000000); @compile_time[self->compile_file] = quantize(self->compile_elapsed); self->compile_file = 0; self->compile_file_translated = 0; self->compile_start_time = 0; } tick-60s { printf("Exclusive compile elapsed times,"); printa(" %s, %@d", @compile_time); }
  • 25. PHP Dtrace probes request-startup(request-file, request-uri, request-method) request-end(request-file, request-uri, request-method) compile-file-entry(compile-file, compile-file-translated) compile-file-return(compile-file, compile-file-translated) function-entry(function-name, request-file, lineno, classname, scope) function-end(function-name, request-file, lineno, classname, scope) execute-entry(request-file, lineno) execute-end(request-file, lineno) error(errormsg, request-file, lineno) execption-thrown(classname) exception-catched(classname)
  • 26.
  • 27.
  • 28. To track Object create / destroy life cycle.
  • 29.
  • 30. Apache Dtrace Probes accept_connection(uint*) log_request(uint*, char*, char*) receive_request (uint*) create_child() check_user_credentials(uint*) check_access(uint*) check_authorization(uint*)
  • 31.
  • 32. Apache Dtrace probes are available at http://prefetch.net
  • 33. PHP Dtrace probes are integrated within PHP 6.x source tree.
  • 34. Ruby Dtrace probes are integrated within Ruby source.
  • 35.
  • 37.
  • 38.
  • 39.