SlideShare uma empresa Scribd logo
1 de 38
Performance metrics
for a social network
About Me

•   Thierry Schellenbach
•   Founder/ CTO Fashiolista
•   Author of Django Facebook
•   Github/tschellenbach

• Blog: mellowmorning.com
• @tschellenbach
Global Fashion Discovery
5.000.000+
8.000.000+
Growth

2nd largest fashion community

• 1mln members
• 17mln loves/month
• 94mln non-bot pageviews
Powered By

•   Django/Python
•   PostgreSQL
•   Solr
•   Redis
•   Celery
•   AWS/ Ubuntu
•   Nginx/ Gunicorn/ Supervisor
Sexy Metrics driven optimization
Hard Because

• All content is personalized

• Activity is clustered around a few
  users (>100k followers)

• Individual users are insanely
  active (7 hours in a day is
  normal)

• Social network, can’t easily shard
  data
Speed is a Feature
Metrics across the board
• Development
  – Spot things early on, wrong usage of ORM etc
• System Health
  – Is my DB healthy, my Redis cluster etc
• Page level
  – Why is my page slow
  – What is the average speed of the components
    (DB, Redis, Solr etc)
Tools we use
  Development               System Health           Page Level

                        •    Cloudwatch          • New Relic
• Debug toolbar
                        •    Munin
   – Cache calls                                 • Graphite
                        •    Nagios
   – Graphite
     Timings            •    DB slow log
   – Queries and        •    Redis slow log
     their explains     •    Integration Tests
   – Duplicate query    •    PgFouine
     detection
Development


                                   StatsD

              Duplicates




                           Cache Calls
Today’s Presentation
    New Relic            Graphite           PgFouine

• Dashboard, High   • Stash all data,    • Understand
  level insights      query it any way     what keeps
                      you want             your DB busy
                    • Tool, not a
                      dashboard
New Relic

• Frontend -> App ->
  Components (DB, Solr, etc.)
• Breaks page performance
  down into it’s components
• Tracks deploys and compares
  before and after
Are you Supported?

•   Ruby              •   Pip install newrelic
•   Java              •   Edit the .ini
•   .NET              •   Add the WSGI middleware
•   PHP               •   Wait for Magic
•   Python
End user load times
• Drill down all the way to Database calls
• The purple line is our app, the rest frontend
                                  Frontend
                                   (97%)




                                                  App
Global page loads
Page Level
• Average frontend performance per page
• Click to view App level breakdown

                 Page. Not URL.           To App Level
Drill down/ App overview

 History




                          Memcached
               DB Query
Database
        • See which tables are
          under most load
        • See which pages cause the
          load




• Development over time
Deploys
Deploys part Two
Response Time Pre & Post




                           Memory Utilization
Background Task

Number of Task
calls (sample)
Graphite Insights
• NewRelic has the overview,
  Graphite the detail
• Open Source!

• Throw data at it via UDP

• Popularized by Etsy
  (see mellowmorning.com for
  link)
It’s Complicated
Tracks Everything
Setup
• Track using StatsD
  – Support for (PHP, Python, Ruby, Node, Java)

• Hierarchy (python example)
• get.<app>.<view>.<component>
  with request.timings('get.user.profile_page.sql'):
     print ‘database query here’
Data tool/ Not a dashboard

• Wildcards
  – get.<app>.<view>.*.upper_90

  – get.<app>.*.redis.zadd.upper_90

  – limit(sortByMaxima(get.<app>.<view>.*.up
    per_90),4)
/style/<user>/ performance



                   Memcached
                   Slowdown




            ZADD


                       Set Many
Including Functional parts of Pages

• More like this part is
  tracked

• Solr & Redis Cache
What we Track

•   Loadtime per bit of functionality
•   Database calls per DB
•   90th percentile load times
•   Task broker roundtrip times
•   Facebook API calls
PgFouine
• Run on samples of all queries (say 5m)
• Not just slow queries
• Repeating a simple query many times is also
  wrong, PgFouine finds it

• See Instagram’s fabric snippet
• https://gist.github.com/2307647
PgFouine Continued
Queries that took up
the most time (N)

• Spots issues with
  many small queries                Normalized

Compare multiple
reports
PgFouine Tips

• My colleague wrote a fast C++ version
• github.com/WoLpH/pg_query_analyser

  Also look at:
• Pg Stat Statement
• Pg Badger
Concluding
    New Relic            Graphite           PgFouine

• Dashboard, High   • Stash all data,    • Understand
  level insights      query it any way     what keeps
                      you want             your DB busy
                    • Tool, not a
                      dashboard
Q&A

We’re Searching for Django Developers & Linux
system administrators!

              Fashiolista.com/jobs

Open source projects:

            Github.com/tschellenbach
               Try Django Facebook!

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

SQL Server In-Memory OLTP Migration Overview
SQL Server In-Memory OLTP Migration OverviewSQL Server In-Memory OLTP Migration Overview
SQL Server In-Memory OLTP Migration Overview
 
Azkaban
AzkabanAzkaban
Azkaban
 
Untangling - fall2017 - week 9
Untangling - fall2017 - week 9Untangling - fall2017 - week 9
Untangling - fall2017 - week 9
 
Resolving problems & high availability
Resolving problems & high availabilityResolving problems & high availability
Resolving problems & high availability
 
Urbanesia - Development History
Urbanesia - Development HistoryUrbanesia - Development History
Urbanesia - Development History
 
WebDev Crash Course
WebDev Crash CourseWebDev Crash Course
WebDev Crash Course
 
SenchaCon 2016: Oracle Forms Modernisation - Owen Pagan
SenchaCon 2016: Oracle Forms Modernisation - Owen PaganSenchaCon 2016: Oracle Forms Modernisation - Owen Pagan
SenchaCon 2016: Oracle Forms Modernisation - Owen Pagan
 
Architecture Patterns - Open Discussion
Architecture Patterns - Open DiscussionArchitecture Patterns - Open Discussion
Architecture Patterns - Open Discussion
 
A Day of REST
A Day of RESTA Day of REST
A Day of REST
 
Road to database automation: database source control
Road to database automation: database source controlRoad to database automation: database source control
Road to database automation: database source control
 
Road to database automation - Database source control
Road to database automation - Database source controlRoad to database automation - Database source control
Road to database automation - Database source control
 
Engage 2019: Modernising Your Domino and XPages Applications
Engage 2019: Modernising Your Domino and XPages Applications Engage 2019: Modernising Your Domino and XPages Applications
Engage 2019: Modernising Your Domino and XPages Applications
 
Plone pas.plugins.ldap user/group search
Plone pas.plugins.ldap user/group searchPlone pas.plugins.ldap user/group search
Plone pas.plugins.ldap user/group search
 
Make Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speedMake Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speed
 
Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021
 
7 Stages of Scaling Web Applications
7 Stages of Scaling Web Applications7 Stages of Scaling Web Applications
7 Stages of Scaling Web Applications
 
Database Source Control: Migrations vs State
Database Source Control: Migrations vs StateDatabase Source Control: Migrations vs State
Database Source Control: Migrations vs State
 
Lessons from Highly Scalable Architectures at Social Networking Sites
Lessons from Highly Scalable Architectures at Social Networking SitesLessons from Highly Scalable Architectures at Social Networking Sites
Lessons from Highly Scalable Architectures at Social Networking Sites
 
Qcon
QconQcon
Qcon
 
Zapping ever faster: how Zap sped up by two orders of magnitude using RavenDB
Zapping ever faster: how Zap sped up by two orders of magnitude using RavenDBZapping ever faster: how Zap sped up by two orders of magnitude using RavenDB
Zapping ever faster: how Zap sped up by two orders of magnitude using RavenDB
 

Destaque (8)

Template To Music Video
Template To Music VideoTemplate To Music Video
Template To Music Video
 
Easter week
Easter weekEaster week
Easter week
 
Presentación tipos de consulas copia
Presentación tipos de consulas  copiaPresentación tipos de consulas  copia
Presentación tipos de consulas copia
 
Diccionario de-hebreo-biblico-by-moises-chavez
Diccionario de-hebreo-biblico-by-moises-chavezDiccionario de-hebreo-biblico-by-moises-chavez
Diccionario de-hebreo-biblico-by-moises-chavez
 
Rules for crossing over 4 27-11a
Rules for crossing over 4 27-11aRules for crossing over 4 27-11a
Rules for crossing over 4 27-11a
 
Ante una intrusión ¿qué hacer?
Ante una intrusión ¿qué hacer?Ante una intrusión ¿qué hacer?
Ante una intrusión ¿qué hacer?
 
Dancing generation
Dancing generationDancing generation
Dancing generation
 
God is great
God is greatGod is great
God is great
 

Semelhante a Fashiolista

My site is slow
My site is slowMy site is slow
My site is slow
hernanibf
 
Automating Web Application Deployment
Automating Web Application DeploymentAutomating Web Application Deployment
Automating Web Application Deployment
Mathew Byrne
 
5 Common Mistakes You are Making on your Website
 5 Common Mistakes You are Making on your Website 5 Common Mistakes You are Making on your Website
5 Common Mistakes You are Making on your Website
Acquia
 

Semelhante a Fashiolista (20)

My Site is slow - Drupal Camp London 2013
My Site is slow - Drupal Camp London 2013My Site is slow - Drupal Camp London 2013
My Site is slow - Drupal Camp London 2013
 
Profiling and Tuning a Web Application - The Dirty Details
Profiling and Tuning a Web Application - The Dirty DetailsProfiling and Tuning a Web Application - The Dirty Details
Profiling and Tuning a Web Application - The Dirty Details
 
My site is slow
My site is slowMy site is slow
My site is slow
 
Tuenti Release Workflow
Tuenti Release WorkflowTuenti Release Workflow
Tuenti Release Workflow
 
Ship It ! with Ruby/ Rails Ecosystem
Ship It ! with Ruby/ Rails EcosystemShip It ! with Ruby/ Rails Ecosystem
Ship It ! with Ruby/ Rails Ecosystem
 
Does Your Stuff Scale?
Does Your Stuff Scale?Does Your Stuff Scale?
Does Your Stuff Scale?
 
Picnic Software - Developing a flexible and scalable application
Picnic Software - Developing a flexible and scalable applicationPicnic Software - Developing a flexible and scalable application
Picnic Software - Developing a flexible and scalable application
 
USG Summit - September 2014 - Web Management using Drupal
USG Summit - September 2014 - Web Management using DrupalUSG Summit - September 2014 - Web Management using Drupal
USG Summit - September 2014 - Web Management using Drupal
 
How to Do a Performance Audit of Your .NET Website
How to Do a Performance Audit of Your .NET WebsiteHow to Do a Performance Audit of Your .NET Website
How to Do a Performance Audit of Your .NET Website
 
Navigating SAP’s Integration Options (Mastering SAP Technologies 2013)
Navigating SAP’s Integration Options (Mastering SAP Technologies 2013)Navigating SAP’s Integration Options (Mastering SAP Technologies 2013)
Navigating SAP’s Integration Options (Mastering SAP Technologies 2013)
 
From Pilot to Product - Morning@Lohika
From Pilot to Product - Morning@LohikaFrom Pilot to Product - Morning@Lohika
From Pilot to Product - Morning@Lohika
 
Redundant devops
Redundant devopsRedundant devops
Redundant devops
 
Key alias dev standard final
Key alias   dev standard finalKey alias   dev standard final
Key alias dev standard final
 
Drupalmonitor.com - Drupal User Group Meetup Basel
Drupalmonitor.com - Drupal User Group Meetup BaselDrupalmonitor.com - Drupal User Group Meetup Basel
Drupalmonitor.com - Drupal User Group Meetup Basel
 
Automating Web Application Deployment
Automating Web Application DeploymentAutomating Web Application Deployment
Automating Web Application Deployment
 
Auditing Drupal Sites for Performance, Content and Optimal Configuration - SA...
Auditing Drupal Sites for Performance, Content and Optimal Configuration - SA...Auditing Drupal Sites for Performance, Content and Optimal Configuration - SA...
Auditing Drupal Sites for Performance, Content and Optimal Configuration - SA...
 
5 Common Mistakes You are Making on your Website
 5 Common Mistakes You are Making on your Website 5 Common Mistakes You are Making on your Website
5 Common Mistakes You are Making on your Website
 
Web development with Python
Web development with PythonWeb development with Python
Web development with Python
 
Front End page speed performance improvements for Drupal
Front End page speed performance improvements for DrupalFront End page speed performance improvements for Drupal
Front End page speed performance improvements for Drupal
 
Make It Cooler: Using Decentralized Version Control
Make It Cooler: Using Decentralized Version ControlMake It Cooler: Using Decentralized Version Control
Make It Cooler: Using Decentralized Version Control
 

Mais de nlwebperf

Mais de nlwebperf (11)

MeasureWorks - eCommerce Live - Designing Time & Conversion
MeasureWorks -  eCommerce Live - Designing Time & ConversionMeasureWorks -  eCommerce Live - Designing Time & Conversion
MeasureWorks - eCommerce Live - Designing Time & Conversion
 
Aaron Peters aug2012
Aaron Peters aug2012Aaron Peters aug2012
Aaron Peters aug2012
 
Jinspired june2012
Jinspired june2012Jinspired june2012
Jinspired june2012
 
Usabilla june2012
Usabilla june2012Usabilla june2012
Usabilla june2012
 
Steve Souders
Steve SoudersSteve Souders
Steve Souders
 
Nimbuzz march2012
Nimbuzz march2012Nimbuzz march2012
Nimbuzz march2012
 
Aspects of Modern APM Solutions
Aspects of Modern APM SolutionsAspects of Modern APM Solutions
Aspects of Modern APM Solutions
 
Nimsoft Web performance monitoring
Nimsoft Web performance monitoringNimsoft Web performance monitoring
Nimsoft Web performance monitoring
 
Hyves: Mobile app development with HTML5 and Javascript
Hyves: Mobile app development with HTML5 and JavascriptHyves: Mobile app development with HTML5 and Javascript
Hyves: Mobile app development with HTML5 and Javascript
 
NLCMG - Performance is good, Understanding performance is better
NLCMG - Performance is good, Understanding performance is better NLCMG - Performance is good, Understanding performance is better
NLCMG - Performance is good, Understanding performance is better
 
2deHands.be - Tuning a Big Classifieds Site
2deHands.be - Tuning a Big Classifieds Site2deHands.be - Tuning a Big Classifieds Site
2deHands.be - Tuning a Big Classifieds Site
 

Último

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
 

Último (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
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...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
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...
 
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
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

Fashiolista

  • 1. Performance metrics for a social network
  • 2. About Me • Thierry Schellenbach • Founder/ CTO Fashiolista • Author of Django Facebook • Github/tschellenbach • Blog: mellowmorning.com • @tschellenbach
  • 4.
  • 5.
  • 6.
  • 8. Growth 2nd largest fashion community • 1mln members • 17mln loves/month • 94mln non-bot pageviews
  • 9. Powered By • Django/Python • PostgreSQL • Solr • Redis • Celery • AWS/ Ubuntu • Nginx/ Gunicorn/ Supervisor
  • 10. Sexy Metrics driven optimization Hard Because • All content is personalized • Activity is clustered around a few users (>100k followers) • Individual users are insanely active (7 hours in a day is normal) • Social network, can’t easily shard data
  • 11. Speed is a Feature
  • 12. Metrics across the board • Development – Spot things early on, wrong usage of ORM etc • System Health – Is my DB healthy, my Redis cluster etc • Page level – Why is my page slow – What is the average speed of the components (DB, Redis, Solr etc)
  • 13. Tools we use Development System Health Page Level • Cloudwatch • New Relic • Debug toolbar • Munin – Cache calls • Graphite • Nagios – Graphite Timings • DB slow log – Queries and • Redis slow log their explains • Integration Tests – Duplicate query • PgFouine detection
  • 14. Development StatsD Duplicates Cache Calls
  • 15. Today’s Presentation New Relic Graphite PgFouine • Dashboard, High • Stash all data, • Understand level insights query it any way what keeps you want your DB busy • Tool, not a dashboard
  • 16. New Relic • Frontend -> App -> Components (DB, Solr, etc.) • Breaks page performance down into it’s components • Tracks deploys and compares before and after
  • 17. Are you Supported? • Ruby • Pip install newrelic • Java • Edit the .ini • .NET • Add the WSGI middleware • PHP • Wait for Magic • Python
  • 18. End user load times • Drill down all the way to Database calls • The purple line is our app, the rest frontend Frontend (97%) App
  • 20. Page Level • Average frontend performance per page • Click to view App level breakdown Page. Not URL. To App Level
  • 21. Drill down/ App overview History Memcached DB Query
  • 22. Database • See which tables are under most load • See which pages cause the load • Development over time
  • 24. Deploys part Two Response Time Pre & Post Memory Utilization
  • 25. Background Task Number of Task calls (sample)
  • 26. Graphite Insights • NewRelic has the overview, Graphite the detail • Open Source! • Throw data at it via UDP • Popularized by Etsy (see mellowmorning.com for link)
  • 29. Setup • Track using StatsD – Support for (PHP, Python, Ruby, Node, Java) • Hierarchy (python example) • get.<app>.<view>.<component> with request.timings('get.user.profile_page.sql'): print ‘database query here’
  • 30. Data tool/ Not a dashboard • Wildcards – get.<app>.<view>.*.upper_90 – get.<app>.*.redis.zadd.upper_90 – limit(sortByMaxima(get.<app>.<view>.*.up per_90),4)
  • 31. /style/<user>/ performance Memcached Slowdown ZADD Set Many
  • 32. Including Functional parts of Pages • More like this part is tracked • Solr & Redis Cache
  • 33. What we Track • Loadtime per bit of functionality • Database calls per DB • 90th percentile load times • Task broker roundtrip times • Facebook API calls
  • 34. PgFouine • Run on samples of all queries (say 5m) • Not just slow queries • Repeating a simple query many times is also wrong, PgFouine finds it • See Instagram’s fabric snippet • https://gist.github.com/2307647
  • 35. PgFouine Continued Queries that took up the most time (N) • Spots issues with many small queries Normalized Compare multiple reports
  • 36. PgFouine Tips • My colleague wrote a fast C++ version • github.com/WoLpH/pg_query_analyser Also look at: • Pg Stat Statement • Pg Badger
  • 37. Concluding New Relic Graphite PgFouine • Dashboard, High • Stash all data, • Understand level insights query it any way what keeps you want your DB busy • Tool, not a dashboard
  • 38. Q&A We’re Searching for Django Developers & Linux system administrators! Fashiolista.com/jobs Open source projects: Github.com/tschellenbach Try Django Facebook!