Diese Präsentation wurde erfolgreich gemeldet.
Die SlideShare-Präsentation wird heruntergeladen. ×

Web Performance Culture and Tools at Etsy

Wird geladen in …3

Hier ansehen

1 von 83 Anzeige

Weitere Verwandte Inhalte

Diashows für Sie (20)

Andere mochten auch (20)


Ähnlich wie Web Performance Culture and Tools at Etsy (20)


Web Performance Culture and Tools at Etsy

  1. Web Performance Culture and Tools at Etsy Mike Brittain @mikebrittain Director of Eng., Infrastructure Etsy
  2. All of this started in the last year.
  3. Make Performance Matter
  4. $0.20 per item 3.5% transaction fee
  5. Focus on the marketplace
  6. ecommerce
  7. ecommerce ad supported
  8. ecommerce ad supported subscription
  9. ecommerce ad supported subscription “free”
  10. $$$
  11. “Prove it.”
  12. “Our own years of testing have conclusively shown that when speed of a feature or product improves, usage, quite simply, goes up.” http://googleblog.blogspot.com/2009/12/this-week-in-search-121809.html
  13. 100+ web, api, jobs 40+ databases Many more doing lots of other stuff...
  14. $$$
  15. Performance is fun
  16. I want you to tell me how you feel...
  17. 95th percentile milliseconds Average
  18. e w r! en ste h a 95th percentile w f is go is it h e T d milliseconds m a Average
  19. I am better than you.
  20. Make Performance Matter
  21. Performance Culture
  22. Our perf team is two people...
  23. Measure
  24. Measure Build tools
  25. Measure Build tools Train & Coordinate
  26. Measure Build tools Train & Coordinate Motivate
  27. Measure Build tools Train & Coordinate Motivate Dedicated
  28. Our perf team is two people... But every engineer thinks about performance
  29. Everything is slow. Please fix.
  30. page generation time
  31. 2011 Goal 800 ms on five pages
  32. http://www.etsy.com/blog/news/2011/november-2011-site-performance-report/
  33. http://www.etsy.com/blog/news/2011/november-2011-site-performance-report/
  34. Performance degradation is a P2 bug
  35. WARNING: This part is hard Performance degradation is a P2 bug
  36. 2012 Goal 800 ms for all pages
  37. Engineering Denormalize data Optimize queries Rewrite from scratch Caching (memcache, app code)
  38. Operations Network switches Operating systems Newer hardware Additional hardware capacity
  39. Product Identify concerns early Kill lagging features
  40. Performance Culture
  41. Tools
  42. How do you make the graphs?
  43. Perf-related data belongs in your server logs
  44. apache_note(“custom_field”, $whatever); LogFormat %l %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i" %{custom_field}n
  45. LogFormat "%{True-Client-IP}i %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i" %{etsy_user_id}n %{php_bytes}n %{php_microsec}n %D" combined
  46. $timer_start = microtime(true); ... $timer_diff = microtime(true) - $timer_start; register_shutdown_function() apache_note('php_microsec', $timer_diff);
  47. web0060 - - [24/Aug/2011:04:16:52 +0000] "GET /listing/12189259/tropical-etched- pair-of-lampwork-glass HTTP/1.1" 200 11034 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" - 13399576 505780 554876
  48. Using something else? time, http method, request uri, response code, referer, user-agent, response time, response memory, custom segmentation fields...
  49. Quick averages grep "GET /listing/" access.log | awk '{sum=sum+$(NF-1)} END {print sum/NR}'
  50. Quick graphs grep "GET /listing/" access.log | perl -pe "s/.*[.*d{4}:(d{2}):(d{2}):d{2}.*]/1:2/" | awk '{print $1, $(NF-1)}' > /tmp/pagetimes.dat gives you...
  51. Quick graphs # /tmp/pagetimes.dat 18:37 251.0 18:38 252.1 18:39 253.5 18:40 251.0 18:45 250.0 and then...
  52. Quick graphs # GNUPLOT set terminal png set output 'listings.png' set yrange [0:2000] set xdata time set timefmt "%d/%B/%Y:%H:%M:%S" set format x "%H:%M" plot '/tmp/pagetimes.dat' using 1:2 with points
  53. Quick graphs
  54. Logster Run by cron Maintains a cursor on log files Simple parsing & aggregation Output to Ganglia or Graphite github.com/etsy
  55. Logster & Graphite Signed-in vs. Signed-out
  56. Response times responses (pages) by bucket time (ms)
  57. “Look at your Data” John Rauser, Velocity 2011 http://www.youtube.com/watch?v=coNDCIMH8bk
  58. Idea lifted from http://www.codinghorror.com/blog/2011/06/ performance-is-a-feature.html
  59. Don’t forget the API
  60. Measure performance data in Production
  61. Profiling
  62. “I/O Profiler” Lightweight, inline profiling Start and end times wrapped around service calls databases, memcache, apc, 3rd party services, etc. Enable with query string
  63. “I/O Profiler”
  64. “I/O Profiler”
  65. XHProf github.com/facebook/xhprof Deployed on pre-prod machine Direct access to profiling Enable with query string
  66. Profile against Production
  67. Make performance matter
  68. Start small
  69. Make graphs and reports
  70. Create simple tools
  71. Celebrate performance wins
  72. Thank you codeascraft.etsy.com Mike Brittain mike@etsy.com @mikebrittain
  73. Jobs at Etsy We are currently hiring for a number of positions in engineering and operations. http://www.etsy.com/careers