SlideShare une entreprise Scribd logo
1  sur  21
USE              IMPROVE                   EVANGELIZE


Observability Matters:
How DTrace Helped Twitter
Adam Leventhal
Brendan Gregg

FishWorks
Sun Microsystems
a version of this presentation with the demo materials will be available shortly after the conference at http://blogs.sun.com/ahl
USE   IMPROVE   EVANGELIZE




This Talk
    Twitter performance meltdown
●

    Introduction to DTrace
●

    DTrace on the case
●

    Solutions and results
●

    DTrace for your application
●

    Q&A
●




                                              2
USE     IMPROVE   EVANGELIZE




What Is Twitter?
    Social networking/RSS/SMS
●

    Ruby on Rails application
●

    Horizontally scaled
●

    Centralized MySQL backend
●




                                              3
USE     IMPROVE   EVANGELIZE




Twitter's Problem
    Started with a few users
●

    Didn't scale with their success
●

    High latencies could make it unusable
●

    Many possible suspects:
●

        The OS: kernel, libraries, etc.
    –

        Ruby, MySQL, Apache
    –

        The Twitter application itself
    –


                                                        4
USE    IMPROVE   EVANGELIZE




Enter DTrace
    Luckily: Twitter had DTrace
●
        Solaris 10, Mac OS X 10.5, FreeBSD*
    –

    Systemic observability
●
        Ruby, Java, JavaScript, C/C++, kernel ...
    –

    Concise answers to arbitrary questions
●

    Designed for production systems
●

        Architected to always be safe
    –

        No overhead when not in use
    –

    Also great for developers
●                                                           5
USE   IMPROVE   EVANGELIZE




DEMO

                       6
USE   IMPROVE   EVANGELIZE




The Investigation
    High latencies under load
●

    What could cause these latencies?
●

        on-CPU time: slow/numerous functions, ...
    –

        off-CPU time: I/O, lock contention, ...
    –




                                                      7
USE   IMPROVE   EVANGELIZE




DEMO

                       8
USE   IMPROVE   EVANGELIZE




Investigation: Steps
1. Started with a broad look at the system
 using familiar tools
     mpstat, ...
 ●



2. DTrace profiling to sample processes
3. DTrace profiling to sample user stacks




                                             9
USE   IMPROVE   EVANGELIZE




Investigation: So Far
    What we knew:
●

        High application latency (from somewhere)
    –

    What we learned:
●

        Latency may be due to high CPU load
    –

        CPU load is due to some Ruby component:
    –
             Twitter application
         ●


             Standard Ruby libraries
         ●


             Interpreter itself
         ●




                                                           10
USE   IMPROVE   EVANGELIZE




DEMO

                       11
USE   IMPROVE   EVANGELIZE




Investigation: Steps
4. Function call counts
5. ustack() for memcpy()
6. Time spent in backtrace()

    What we learned:
●

        40% of CPU time spent in backtrace()
    –




                                                   12
USE   IMPROVE   EVANGELIZE




DEMO

                       13
USE   IMPROVE   EVANGELIZE




Investigation: Steps
7. Located source of backtrace() calls in
  Ruby code

    What we learned:
●

        Several instances of code like this:
    –
         @string = (str.string rescue str)




                                                     14
USE   IMPROVE   EVANGELIZE




Results: No Exceptions
    Rather than blithely calling the method:
●
    @string = (str.string rescue str)

    ... check first:
●
    @string = str.responds_to?(:string) ?
        str.string : str

    Result: 30% drop in CPU utilization
●



                                                15
USE   IMPROVE   EVANGELIZE




Ruby Provider
    Joyent built DTrace-enabled Ruby
●

    Trace function entry and return
●

    Probes for line execution, memory
●
    allocation, etc.




                                               16
USE   IMPROVE   EVANGELIZE




DEMO

                       17
USE   IMPROVE   EVANGELIZE




Results: CRC32 in C
    Precision optimization
●

    Rewrite the CRC32 computation in C
●

    Estimated result: 15% drop in CPU
●
    utilization




                                              18
USE   IMPROVE   EVANGELIZE




DTrace Your Application
    Get your application on an OS with
●
    DTrace
    Start with the tools you know and dive
●
    deeper with DTrace
    If you can do it today or tomorrow, find
●
    Adam and Brendan: we'll help you
    investigate
    DTrace sees all
●


                                                19
USE    IMPROVE   EVANGELIZE




    Q&A (and links)
    DTrace home page
–
         http://www.opensolaris.org/os/community/dtrace
     ●


    DTrace-enabled Ruby
–
         http://dtrace.joyent.com
     ●


    Getting started with DTrace
–
         http://blogs.sun.com/ahl/entry/dtrace_boot_camp
     ●


    Exception problem:
–
         http://dev.rubyonrails.org/ticket/8159
     ●


         http://dev.rubyonrails.org/changeset/6571
     ●


    Joyent's blog post on this subject
–
         http://joyeur.com/2007/04/24/solaris-dtrace-and-rails   20
     ●
USE      IMPROVE   EVANGELIZE


Observability Matters:
How DTrace Helped Twitter
Adam Leventhal
http://blogs.sun.com/ahl

Brendan Gregg
http://blogs.sun.com/brendan

Contenu connexe

Tendances

Dependency management with Composer
Dependency management with ComposerDependency management with Composer
Dependency management with Composer
Jason Grimes
 
Adding_GD2_to_PHP_on_OS_X_Server_10_5_Leopard
Adding_GD2_to_PHP_on_OS_X_Server_10_5_LeopardAdding_GD2_to_PHP_on_OS_X_Server_10_5_Leopard
Adding_GD2_to_PHP_on_OS_X_Server_10_5_Leopard
tutorialsruby
 

Tendances (20)

Composer | PHP Dependency Manager
Composer | PHP Dependency ManagerComposer | PHP Dependency Manager
Composer | PHP Dependency Manager
 
Dist::Zilla - A very brief introduction
Dist::Zilla - A very brief introductionDist::Zilla - A very brief introduction
Dist::Zilla - A very brief introduction
 
Maven 3.0 at Øredev
Maven 3.0 at ØredevMaven 3.0 at Øredev
Maven 3.0 at Øredev
 
Leaner microservices with Java 10
Leaner microservices with Java 10Leaner microservices with Java 10
Leaner microservices with Java 10
 
Swoole Love PHP
Swoole Love PHPSwoole Love PHP
Swoole Love PHP
 
Perlbrew
PerlbrewPerlbrew
Perlbrew
 
Symfony Under Control by Maxim Romanovsky
Symfony Under Control by Maxim RomanovskySymfony Under Control by Maxim Romanovsky
Symfony Under Control by Maxim Romanovsky
 
Capistrano
CapistranoCapistrano
Capistrano
 
Managing Complexity with Module::Release
Managing Complexity with Module::ReleaseManaging Complexity with Module::Release
Managing Complexity with Module::Release
 
The Integration of Laravel with Swoole
The Integration of Laravel with SwooleThe Integration of Laravel with Swoole
The Integration of Laravel with Swoole
 
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
 
perlbrew yapcasia 2010
perlbrew yapcasia 2010perlbrew yapcasia 2010
perlbrew yapcasia 2010
 
Fastlane - ATC 2016
Fastlane - ATC 2016Fastlane - ATC 2016
Fastlane - ATC 2016
 
Composer Helpdesk
Composer HelpdeskComposer Helpdesk
Composer Helpdesk
 
Dependency management with Composer
Dependency management with ComposerDependency management with Composer
Dependency management with Composer
 
Defcon - Veil-Pillage
Defcon - Veil-PillageDefcon - Veil-Pillage
Defcon - Veil-Pillage
 
[Part 1] automation of home appliances using raspberry pi – software installa...
[Part 1] automation of home appliances using raspberry pi – software installa...[Part 1] automation of home appliances using raspberry pi – software installa...
[Part 1] automation of home appliances using raspberry pi – software installa...
 
4. open mano set up and usage
4. open mano set up and usage4. open mano set up and usage
4. open mano set up and usage
 
FITC - Node.js 101
FITC - Node.js 101FITC - Node.js 101
FITC - Node.js 101
 
Adding_GD2_to_PHP_on_OS_X_Server_10_5_Leopard
Adding_GD2_to_PHP_on_OS_X_Server_10_5_LeopardAdding_GD2_to_PHP_on_OS_X_Server_10_5_Leopard
Adding_GD2_to_PHP_on_OS_X_Server_10_5_Leopard
 

En vedette (8)

DTrace
DTraceDTrace
DTrace
 
DTrace - Miracle Scotland Database Forum
DTrace - Miracle Scotland Database ForumDTrace - Miracle Scotland Database Forum
DTrace - Miracle Scotland Database Forum
 
DTrace talk at Oracle Open World
DTrace talk at Oracle Open WorldDTrace talk at Oracle Open World
DTrace talk at Oracle Open World
 
OpenSolaris 2009.06 Workshop
OpenSolaris 2009.06 WorkshopOpenSolaris 2009.06 Workshop
OpenSolaris 2009.06 Workshop
 
Oraclew2013 devopsjlm
Oraclew2013 devopsjlmOraclew2013 devopsjlm
Oraclew2013 devopsjlm
 
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
 
Solaris Internals Preso circa 2009
Solaris Internals Preso circa 2009Solaris Internals Preso circa 2009
Solaris Internals Preso circa 2009
 
Facebook Powerpoint
Facebook PowerpointFacebook Powerpoint
Facebook Powerpoint
 

Similaire à Os Leventhal

Drupalcamp Simpletest
Drupalcamp SimpletestDrupalcamp Simpletest
Drupalcamp Simpletest
lyricnz
 
Joxean Koret - Database Security Paradise [Rooted CON 2011]
Joxean Koret - Database Security Paradise [Rooted CON 2011]Joxean Koret - Database Security Paradise [Rooted CON 2011]
Joxean Koret - Database Security Paradise [Rooted CON 2011]
RootedCON
 
Gatling - Bordeaux JUG
Gatling - Bordeaux JUGGatling - Bordeaux JUG
Gatling - Bordeaux JUG
slandelle
 

Similaire à Os Leventhal (20)

Troubleshooting Deep Neural Networks - Full Stack Deep Learning
Troubleshooting Deep Neural Networks - Full Stack Deep LearningTroubleshooting Deep Neural Networks - Full Stack Deep Learning
Troubleshooting Deep Neural Networks - Full Stack Deep Learning
 
So. many. vulnerabilities. Why are containers such a mess and what to do abou...
So. many. vulnerabilities. Why are containers such a mess and what to do abou...So. many. vulnerabilities. Why are containers such a mess and what to do abou...
So. many. vulnerabilities. Why are containers such a mess and what to do abou...
 
Performance Analysis of Idle Programs
Performance Analysis of Idle ProgramsPerformance Analysis of Idle Programs
Performance Analysis of Idle Programs
 
It's always sunny with OpenJ9
It's always sunny with OpenJ9It's always sunny with OpenJ9
It's always sunny with OpenJ9
 
JavaOne 2010: Top 10 Causes for Java Issues in Production and What to Do When...
JavaOne 2010: Top 10 Causes for Java Issues in Production and What to Do When...JavaOne 2010: Top 10 Causes for Java Issues in Production and What to Do When...
JavaOne 2010: Top 10 Causes for Java Issues in Production and What to Do When...
 
Os Selbak
Os SelbakOs Selbak
Os Selbak
 
Puppet for Sys Admins
Puppet for Sys AdminsPuppet for Sys Admins
Puppet for Sys Admins
 
Binding android piece by piece
Binding android piece by pieceBinding android piece by piece
Binding android piece by piece
 
STAMP, or Test Amplification to DevTestOps service, OW2con'18, June 7-8, 2018...
STAMP, or Test Amplification to DevTestOps service, OW2con'18, June 7-8, 2018...STAMP, or Test Amplification to DevTestOps service, OW2con'18, June 7-8, 2018...
STAMP, or Test Amplification to DevTestOps service, OW2con'18, June 7-8, 2018...
 
Drupalcamp Simpletest
Drupalcamp SimpletestDrupalcamp Simpletest
Drupalcamp Simpletest
 
Testing In Drupal
Testing In DrupalTesting In Drupal
Testing In Drupal
 
Continuous Integration Testing in Django
Continuous Integration Testing in DjangoContinuous Integration Testing in Django
Continuous Integration Testing in Django
 
Joxean Koret - Database Security Paradise [Rooted CON 2011]
Joxean Koret - Database Security Paradise [Rooted CON 2011]Joxean Koret - Database Security Paradise [Rooted CON 2011]
Joxean Koret - Database Security Paradise [Rooted CON 2011]
 
The Diabolical Developer's Guide to Surviving Java 9
The Diabolical Developer's Guide to Surviving Java 9The Diabolical Developer's Guide to Surviving Java 9
The Diabolical Developer's Guide to Surviving Java 9
 
Surge2012
Surge2012Surge2012
Surge2012
 
Gatling - Bordeaux JUG
Gatling - Bordeaux JUGGatling - Bordeaux JUG
Gatling - Bordeaux JUG
 
PAC 2019 virtual Christoph NEUMÜLLER
PAC 2019 virtual Christoph NEUMÜLLERPAC 2019 virtual Christoph NEUMÜLLER
PAC 2019 virtual Christoph NEUMÜLLER
 
Containerize your Blackbox tests
Containerize your Blackbox testsContainerize your Blackbox tests
Containerize your Blackbox tests
 
Monitoring MySQL with DTrace/SystemTap
Monitoring MySQL with DTrace/SystemTapMonitoring MySQL with DTrace/SystemTap
Monitoring MySQL with DTrace/SystemTap
 
Techniques for Preserving Scientific Software Executions: Preserve the Mess o...
Techniques for Preserving Scientific Software Executions: Preserve the Mess o...Techniques for Preserving Scientific Software Executions: Preserve the Mess o...
Techniques for Preserving Scientific Software Executions: Preserve the Mess o...
 

Plus de oscon2007

J Ruby Whirlwind Tour
J Ruby Whirlwind TourJ Ruby Whirlwind Tour
J Ruby Whirlwind Tour
oscon2007
 
Solr Presentation5
Solr Presentation5Solr Presentation5
Solr Presentation5
oscon2007
 
Os Fitzpatrick Sussman Wiifm
Os Fitzpatrick Sussman WiifmOs Fitzpatrick Sussman Wiifm
Os Fitzpatrick Sussman Wiifm
oscon2007
 
Performance Whack A Mole
Performance Whack A MolePerformance Whack A Mole
Performance Whack A Mole
oscon2007
 
Os Lanphier Brashears
Os Lanphier BrashearsOs Lanphier Brashears
Os Lanphier Brashears
oscon2007
 
Os Fitzpatrick Sussman Swp
Os Fitzpatrick Sussman SwpOs Fitzpatrick Sussman Swp
Os Fitzpatrick Sussman Swp
oscon2007
 
Os Berlin Dispelling Myths
Os Berlin Dispelling MythsOs Berlin Dispelling Myths
Os Berlin Dispelling Myths
oscon2007
 
Os Keysholistic
Os KeysholisticOs Keysholistic
Os Keysholistic
oscon2007
 
Os Jonphillips
Os JonphillipsOs Jonphillips
Os Jonphillips
oscon2007
 
Os Urnerupdated
Os UrnerupdatedOs Urnerupdated
Os Urnerupdated
oscon2007
 

Plus de oscon2007 (20)

J Ruby Whirlwind Tour
J Ruby Whirlwind TourJ Ruby Whirlwind Tour
J Ruby Whirlwind Tour
 
Solr Presentation5
Solr Presentation5Solr Presentation5
Solr Presentation5
 
Os Borger
Os BorgerOs Borger
Os Borger
 
Os Harkins
Os HarkinsOs Harkins
Os Harkins
 
Os Fitzpatrick Sussman Wiifm
Os Fitzpatrick Sussman WiifmOs Fitzpatrick Sussman Wiifm
Os Fitzpatrick Sussman Wiifm
 
Os Bunce
Os BunceOs Bunce
Os Bunce
 
Yuicss R7
Yuicss R7Yuicss R7
Yuicss R7
 
Performance Whack A Mole
Performance Whack A MolePerformance Whack A Mole
Performance Whack A Mole
 
Os Fogel
Os FogelOs Fogel
Os Fogel
 
Os Lanphier Brashears
Os Lanphier BrashearsOs Lanphier Brashears
Os Lanphier Brashears
 
Os Tucker
Os TuckerOs Tucker
Os Tucker
 
Os Fitzpatrick Sussman Swp
Os Fitzpatrick Sussman SwpOs Fitzpatrick Sussman Swp
Os Fitzpatrick Sussman Swp
 
Os Furlong
Os FurlongOs Furlong
Os Furlong
 
Os Berlin Dispelling Myths
Os Berlin Dispelling MythsOs Berlin Dispelling Myths
Os Berlin Dispelling Myths
 
Os Kimsal
Os KimsalOs Kimsal
Os Kimsal
 
Os Pruett
Os PruettOs Pruett
Os Pruett
 
Os Alrubaie
Os AlrubaieOs Alrubaie
Os Alrubaie
 
Os Keysholistic
Os KeysholisticOs Keysholistic
Os Keysholistic
 
Os Jonphillips
Os JonphillipsOs Jonphillips
Os Jonphillips
 
Os Urnerupdated
Os UrnerupdatedOs Urnerupdated
Os Urnerupdated
 

Dernier

Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
amitlee9823
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...
Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...
Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...
Sheetaleventcompany
 
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai KuwaitThe Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
daisycvs
 
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
amitlee9823
 
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
dollysharma2066
 
Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...
Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...
Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...
Anamikakaur10
 
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
amitlee9823
 
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...
lizamodels9
 

Dernier (20)

Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
 
PHX May 2024 Corporate Presentation Final
PHX May 2024 Corporate Presentation FinalPHX May 2024 Corporate Presentation Final
PHX May 2024 Corporate Presentation Final
 
(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7
(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7
(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Falcon Invoice Discounting: Unlock Your Business Potential
Falcon Invoice Discounting: Unlock Your Business PotentialFalcon Invoice Discounting: Unlock Your Business Potential
Falcon Invoice Discounting: Unlock Your Business Potential
 
Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...
Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...
Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...
 
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai KuwaitThe Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
 
Cheap Rate Call Girls In Noida Sector 62 Metro 959961乂3876
Cheap Rate Call Girls In Noida Sector 62 Metro 959961乂3876Cheap Rate Call Girls In Noida Sector 62 Metro 959961乂3876
Cheap Rate Call Girls In Noida Sector 62 Metro 959961乂3876
 
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
 
Malegaon Call Girls Service ☎ ️82500–77686 ☎️ Enjoy 24/7 Escort Service
Malegaon Call Girls Service ☎ ️82500–77686 ☎️ Enjoy 24/7 Escort ServiceMalegaon Call Girls Service ☎ ️82500–77686 ☎️ Enjoy 24/7 Escort Service
Malegaon Call Girls Service ☎ ️82500–77686 ☎️ Enjoy 24/7 Escort Service
 
Business Model Canvas (BMC)- A new venture concept
Business Model Canvas (BMC)-  A new venture conceptBusiness Model Canvas (BMC)-  A new venture concept
Business Model Canvas (BMC)- A new venture concept
 
Falcon Invoice Discounting: The best investment platform in india for investors
Falcon Invoice Discounting: The best investment platform in india for investorsFalcon Invoice Discounting: The best investment platform in india for investors
Falcon Invoice Discounting: The best investment platform in india for investors
 
Falcon Invoice Discounting: Empowering Your Business Growth
Falcon Invoice Discounting: Empowering Your Business GrowthFalcon Invoice Discounting: Empowering Your Business Growth
Falcon Invoice Discounting: Empowering Your Business Growth
 
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
 
How to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League CityHow to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League City
 
Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...
Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...
Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...
 
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort ServiceEluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
 
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
 
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...
 
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRLBAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
 

Os Leventhal

  • 1. USE IMPROVE EVANGELIZE Observability Matters: How DTrace Helped Twitter Adam Leventhal Brendan Gregg FishWorks Sun Microsystems a version of this presentation with the demo materials will be available shortly after the conference at http://blogs.sun.com/ahl
  • 2. USE IMPROVE EVANGELIZE This Talk Twitter performance meltdown ● Introduction to DTrace ● DTrace on the case ● Solutions and results ● DTrace for your application ● Q&A ● 2
  • 3. USE IMPROVE EVANGELIZE What Is Twitter? Social networking/RSS/SMS ● Ruby on Rails application ● Horizontally scaled ● Centralized MySQL backend ● 3
  • 4. USE IMPROVE EVANGELIZE Twitter's Problem Started with a few users ● Didn't scale with their success ● High latencies could make it unusable ● Many possible suspects: ● The OS: kernel, libraries, etc. – Ruby, MySQL, Apache – The Twitter application itself – 4
  • 5. USE IMPROVE EVANGELIZE Enter DTrace Luckily: Twitter had DTrace ● Solaris 10, Mac OS X 10.5, FreeBSD* – Systemic observability ● Ruby, Java, JavaScript, C/C++, kernel ... – Concise answers to arbitrary questions ● Designed for production systems ● Architected to always be safe – No overhead when not in use – Also great for developers ● 5
  • 6. USE IMPROVE EVANGELIZE DEMO 6
  • 7. USE IMPROVE EVANGELIZE The Investigation High latencies under load ● What could cause these latencies? ● on-CPU time: slow/numerous functions, ... – off-CPU time: I/O, lock contention, ... – 7
  • 8. USE IMPROVE EVANGELIZE DEMO 8
  • 9. USE IMPROVE EVANGELIZE Investigation: Steps 1. Started with a broad look at the system using familiar tools mpstat, ... ● 2. DTrace profiling to sample processes 3. DTrace profiling to sample user stacks 9
  • 10. USE IMPROVE EVANGELIZE Investigation: So Far What we knew: ● High application latency (from somewhere) – What we learned: ● Latency may be due to high CPU load – CPU load is due to some Ruby component: – Twitter application ● Standard Ruby libraries ● Interpreter itself ● 10
  • 11. USE IMPROVE EVANGELIZE DEMO 11
  • 12. USE IMPROVE EVANGELIZE Investigation: Steps 4. Function call counts 5. ustack() for memcpy() 6. Time spent in backtrace() What we learned: ● 40% of CPU time spent in backtrace() – 12
  • 13. USE IMPROVE EVANGELIZE DEMO 13
  • 14. USE IMPROVE EVANGELIZE Investigation: Steps 7. Located source of backtrace() calls in Ruby code What we learned: ● Several instances of code like this: – @string = (str.string rescue str) 14
  • 15. USE IMPROVE EVANGELIZE Results: No Exceptions Rather than blithely calling the method: ● @string = (str.string rescue str) ... check first: ● @string = str.responds_to?(:string) ? str.string : str Result: 30% drop in CPU utilization ● 15
  • 16. USE IMPROVE EVANGELIZE Ruby Provider Joyent built DTrace-enabled Ruby ● Trace function entry and return ● Probes for line execution, memory ● allocation, etc. 16
  • 17. USE IMPROVE EVANGELIZE DEMO 17
  • 18. USE IMPROVE EVANGELIZE Results: CRC32 in C Precision optimization ● Rewrite the CRC32 computation in C ● Estimated result: 15% drop in CPU ● utilization 18
  • 19. USE IMPROVE EVANGELIZE DTrace Your Application Get your application on an OS with ● DTrace Start with the tools you know and dive ● deeper with DTrace If you can do it today or tomorrow, find ● Adam and Brendan: we'll help you investigate DTrace sees all ● 19
  • 20. USE IMPROVE EVANGELIZE Q&A (and links) DTrace home page – http://www.opensolaris.org/os/community/dtrace ● DTrace-enabled Ruby – http://dtrace.joyent.com ● Getting started with DTrace – http://blogs.sun.com/ahl/entry/dtrace_boot_camp ● Exception problem: – http://dev.rubyonrails.org/ticket/8159 ● http://dev.rubyonrails.org/changeset/6571 ● Joyent's blog post on this subject – http://joyeur.com/2007/04/24/solaris-dtrace-and-rails 20 ●
  • 21. USE IMPROVE EVANGELIZE Observability Matters: How DTrace Helped Twitter Adam Leventhal http://blogs.sun.com/ahl Brendan Gregg http://blogs.sun.com/brendan