diy synthetic: private webpagetest magic
DESCRIPTION
I gave this talk at Velocity NY 2013, and it covers the installation and use of a private WebPagetest instance, as well as the open source tool wpt-script which Etsy built.TRANSCRIPT
DIY Synthetic: Private WebPagetest MagicVelocity NY 2013Jonathan Klein@jonathanklein
Wednesday, October 16, 13
Slides, Linksjkle.in/wpt
Wednesday, October 16, 13
About Me
Wednesday, October 16, 13
About Me•Performance Engineer At Etsy
Wednesday, October 16, 13
About Me•Performance Engineer At Etsy• I write the Etsy Site Performance Reports
Wednesday, October 16, 13
About Me•Performance Engineer At Etsy• I write the Etsy Site Performance Reports•Organize Boston Web Perf Meetup Group
Wednesday, October 16, 13
Etsy Stats
Wednesday, October 16, 13
Etsy Stats•World’s largest handmade marketplace
Wednesday, October 16, 13
Etsy Stats•World’s largest handmade marketplace• 1.5 billion page views/month
Wednesday, October 16, 13
Etsy Stats•World’s largest handmade marketplace• 1.5 billion page views/month•Almost $1B in sales last year
Wednesday, October 16, 13
+160k to a page = +12% bounce rate
on mobile
Wednesday, October 16, 13
Synthetic Monitoring
Wednesday, October 16, 13
Wednesday, October 16, 13
Synthetic Monitoring Real User Monitoring
Browser Instrumentation Navigation Timing API
Consistent trending over time
Highly variable
Largely in your control Last mile difficulties
Great for identifying regressions
Great for comparing across geographies/browsers
Not super realistic “Real User Monitoring”
Wednesday, October 16, 13
Synthetic Monitoring Real User Monitoring
Browser Instrumentation Navigation Timing API
Consistent trending over time
Highly variable
Largely in your control Last mile difficulties
Great for identifying regressions
Great for comparing across geographies/browsers
Not super realistic “Real User Monitoring”
Wednesday, October 16, 13
Synthetic Monitoring Real User Monitoring
Browser Instrumentation Navigation Timing API
Consistent trending over time
Highly variable
Largely in your control Last mile difficulties
Great for identifying regressions
Great for comparing across geographies/browsers
Not super realistic “Real User Monitoring”
Wednesday, October 16, 13
Synthetic Monitoring Real User Monitoring
Browser Instrumentation Navigation Timing API
Consistent trending over time
Highly variable
Largely in your control Last mile difficulties
Great for identifying regressions
Great for comparing across geographies/browsers
Not super realistic “Real User Monitoring”
Wednesday, October 16, 13
Synthetic Monitoring Real User Monitoring
Browser Instrumentation Navigation Timing API
Consistent trending over time
Highly variable
Largely in your control Last mile difficulties
Great for identifying regressions
Great for comparing across geographies/browsers
Not super realistic “Real User Monitoring”
Wednesday, October 16, 13
Synthetic Monitoring Real User Monitoring
Browser Instrumentation Navigation Timing API
Consistent trending over time
Highly variable
Largely in your control Last mile difficulties
Great for identifying regressions
Great for comparing across geographies/browsers
Not super realistic “Real User Monitoring”
Wednesday, October 16, 13
Wednesday, October 16, 13
$$$$
Wednesday, October 16, 13
Wednesday, October 16, 13
Background
Wednesday, October 16, 13
Wednesday, October 16, 13
Wednesday, October 16, 13
Wednesday, October 16, 13
EC2 Test Agents
Wednesday, October 16, 13
Wednesday, October 16, 13
No Built-in Automation
Wednesday, October 16, 13
Wednesday, October 16, 13
Wednesday, October 16, 13
wpt-script
Wednesday, October 16, 13
Wednesday, October 16, 13
Motivation
Wednesday, October 16, 13
Why We Use It
Wednesday, October 16, 13
Why We Use It•Wanted long term synthetic trending
Wednesday, October 16, 13
Why We Use It•Wanted long term synthetic trending• Automated tests
Wednesday, October 16, 13
Why We Use It•Wanted long term synthetic trending• Automated tests•More control
Wednesday, October 16, 13
Why We Use It•Wanted long term synthetic trending• Automated tests•More control• Low cost
Wednesday, October 16, 13
Easy Configuration
Wednesday, October 16, 13
{ "server": "http://www.yourwptinstall.com", "pending_dir": "private", "locations": ["US_East_wptdriver:Firefox", "US_East_wptdriver:Chrome"], "urls": { "label": "http://www.example.com", "other_label": "http://www.anotherexample.com" }, "graphite": "graphite.example.com", "logging_ns": "webpagetest.private", "splunkLog": "/var/log/webpagetest/results.log"}
Wednesday, October 16, 13
{ "server": "http://www.yourwptinstall.com", "pending_dir": "private", "locations": ["US_East_wptdriver:Firefox", "US_East_wptdriver:Chrome"], "urls": { "label": "http://www.example.com", "other_label": "http://www.anotherexample.com" }, "graphite": "graphite.example.com", "logging_ns": "webpagetest.private", "splunkLog": "/var/log/webpagetest/results.log"}
Wednesday, October 16, 13
{ "server": "http://www.yourwptinstall.com", "pending_dir": "private", "locations": ["US_East_wptdriver:Firefox", "US_East_wptdriver:Chrome"], "urls": { "label": "http://www.example.com", "other_label": "http://www.anotherexample.com" }, "graphite": "graphite.example.com", "logging_ns": "webpagetest.private", "splunkLog": "/var/log/webpagetest/results.log"}
Wednesday, October 16, 13
{ "server": "http://www.yourwptinstall.com", "pending_dir": "private", "locations": ["US_East_wptdriver:Firefox", "US_East_wptdriver:Chrome"], "urls": { "label": "http://www.example.com", "other_label": "http://www.anotherexample.com" }, "graphite": "graphite.example.com", "logging_ns": "webpagetest.private", "splunkLog": "/var/log/webpagetest/results.log"}
Wednesday, October 16, 13
{ "server": "http://www.yourwptinstall.com", "pending_dir": "private", "locations": ["US_East_wptdriver:Firefox", "US_East_wptdriver:Chrome"], "urls": { "label": "http://www.example.com", "other_label": "http://www.anotherexample.com" }, "graphite": "graphite.example.com", "logging_ns": "webpagetest.private", "splunkLog": "/var/log/webpagetest/results.log"}
Wednesday, October 16, 13
# Run Test*/25 * * * * php run.php
Wednesday, October 16, 13
# Run Test*/25 * * * * php run.php -c foo.conf
Wednesday, October 16, 13
# Run Test*/25 * * * * php run.php -c foo.conf
# Get Results* * * * * php get_results.php
Wednesday, October 16, 13
Advanced Features
Wednesday, October 16, 13
{ "server": "http://example.com", "pending_dir": "private", "locations": ["US_East_wptdriver:Firefox", "US_East_wptdriver:Chrome"], "urls": { "label": "http://www.example.com", "other_label": "http://www.webpagetest.org" }, "graphite": "graphite.example.com", "logging_ns": "webpagetest.private", "splunkLog": "/var/log/webpagetest/results.log", "prepend": "Login", "username": "someuser", "password": "somepassword", "run_options": { "video": 0 }}
Wednesday, October 16, 13
{ "server": "http://example.com", "pending_dir": "private", "locations": ["US_East_wptdriver:Firefox", "US_East_wptdriver:Chrome"], "urls": { "label": "http://www.example.com", "other_label": "http://www.webpagetest.org" }, "graphite": "graphite.example.com", "logging_ns": "webpagetest.private", "splunkLog": "/var/log/webpagetest/results.log", "prepend": ["BlockThirdParty", "bypass_cdn.txt"], "run_options": { "video": 0 }}
Wednesday, October 16, 13
foreach ($prepends as $prepend) { if (file_exists($scripts_dir . $prepend)) { $script .= file_get_contents($scripts_dir . $prepend); } elseif (method_exists($this, $prepend)) { $script .= $this->$prepend(); }}
Wednesday, October 16, 13
setDns site.etsystatic.com 38.106.64.123setDns img0.etsystatic.com 38.106.64.125setDns img1.etsystatic.com 38.106.64.125setDns img2.etsystatic.com 38.106.64.125setDns img3.etsystatic.com 38.106.64.125setDns ny-image0.etsy.com 38.106.64.125setDns ny-image1.etsy.com 38.106.64.125setDns ny-image2.etsy.com 38.106.64.125setDns ny-image3.etsy.com 38.106.64.125
bypass_cdn.txt
Wednesday, October 16, 13
Gathering Results
Wednesday, October 16, 13
<?php
// Splunk$splunkLogger = new SplunkLogger($config['splunkLog'], $logging_ns);foreach ($results as $result) { $splunkLogger->log($result);}
// Graphite$grapher = new Grapher($config['graphite'], $logging_ns);$grapher->graphResults($results);
Wednesday, October 16, 13
Wednesday, October 16, 13
Wednesday, October 16, 13
Wednesday, October 16, 13
https://sites.google.com/a/webpagetest.org/docs/using-webpagetest/metricsWednesday, October 16, 13
Wednesday, October 16, 13
Wednesday, October 16, 13
Wednesday, October 16, 13
Disadvantages vs. Paid Tools
Wednesday, October 16, 13
Disadvantages vs. Paid Tools•Harder to set up/maintain
Wednesday, October 16, 13
Disadvantages vs. Paid Tools•Harder to set up/maintain• Functionality
Wednesday, October 16, 13
Disadvantages vs. Paid Tools•Harder to set up/maintain• Functionality•Regions
Wednesday, October 16, 13
Disadvantages vs. Paid Tools•Harder to set up/maintain• Functionality•Regions• Full page oriented
Wednesday, October 16, 13
Disadvantages vs. Paid Tools•Harder to set up/maintain• Functionality•Regions• Full page oriented• Less consistent
Wednesday, October 16, 13
Advantages vs. Paid Tools
Wednesday, October 16, 13
Advantages vs. Paid Tools•Cost
Wednesday, October 16, 13
Advantages vs. Paid Tools•Cost• Flexibility
Wednesday, October 16, 13
Advantages vs. Paid Tools•Cost• Flexibility•People know the tool
Wednesday, October 16, 13
Advantages vs. Paid Tools•Cost• Flexibility•People know the tool•Multi-page flows
Wednesday, October 16, 13
Advantages vs. Paid Tools•Cost• Flexibility•People know the tool•Multi-page flows• Scripting
Wednesday, October 16, 13
Our Use Cases
Wednesday, October 16, 13
WebPagetest Catchpoint
Wednesday, October 16, 13
WebPagetest Catchpoint•Multi-page flows
Wednesday, October 16, 13
WebPagetest Catchpoint•Multi-page flows• Scripted tests
Wednesday, October 16, 13
WebPagetest Catchpoint•Multi-page flows• Scripted tests• High volume testing
Wednesday, October 16, 13
WebPagetest Catchpoint•Multi-page flows• Scripted tests• High volume testing• Ad-hoc tests
Wednesday, October 16, 13
WebPagetest Catchpoint•Multi-page flows• Scripted tests• High volume testing• Ad-hoc tests
• DNS
Wednesday, October 16, 13
WebPagetest Catchpoint•Multi-page flows• Scripted tests• High volume testing• Ad-hoc tests
• DNS• API
Wednesday, October 16, 13
WebPagetest Catchpoint•Multi-page flows• Scripted tests• High volume testing• Ad-hoc tests
• DNS• API• Single Object Tests
Wednesday, October 16, 13
WebPagetest Catchpoint•Multi-page flows• Scripted tests• High volume testing• Ad-hoc tests
• DNS• API• Single Object Tests•Multiple locations
Wednesday, October 16, 13
WebPagetest Catchpoint•Multi-page flows• Scripted tests• High volume testing• Ad-hoc tests
• DNS• API• Single Object Tests•Multiple locations• Comparisons
Wednesday, October 16, 13
Future Work
Wednesday, October 16, 13
Improving the Process
Wednesday, October 16, 13
Improving the Process•Manage disk space
Wednesday, October 16, 13
Improving the Process•Manage disk space•Multiple regions
Wednesday, October 16, 13
Improving the Process•Manage disk space•Multiple regions•More canned scripts
Wednesday, October 16, 13
Improving the Process•Manage disk space•Multiple regions•More canned scripts•Automate upgrades
Wednesday, October 16, 13
Leveraging WebPagetest
Wednesday, October 16, 13
Leveraging WebPagetest• Front-end SPOF
Wednesday, October 16, 13
Leveraging WebPagetest• Front-end SPOF•User Timings (AFT)
Wednesday, October 16, 13
Leveraging WebPagetest• Front-end SPOF•User Timings (AFT)• Speed Index
Wednesday, October 16, 13
Wednesday, October 16, 13
Improving WebPagetest
Wednesday, October 16, 13
WebPagetest + Vagrant
Wednesday, October 16, 13
WebPagetest + Vagrant• Install VirtualBox
Wednesday, October 16, 13
WebPagetest + Vagrant• Install VirtualBox• Install Vagrant
Wednesday, October 16, 13
WebPagetest + Vagrant• Install VirtualBox• Install Vagrant• https://gist.github.com/jklein/6992296
Wednesday, October 16, 13
WebPagetest + Vagrant• Install VirtualBox• Install Vagrant• https://gist.github.com/jklein/6992296•vagrant up
Wednesday, October 16, 13
WebPagetest + Vagrant• Install VirtualBox• Install Vagrant• https://gist.github.com/jklein/6992296•vagrant up
• http://localhost:8080
Wednesday, October 16, 13
Wednesday, October 16, 13
800MB
Wednesday, October 16, 13
webpagetest-api
Wednesday, October 16, 13
Wednesday, October 16, 13
Both Are Good Options
Wednesday, October 16, 13
Results > Tools
Wednesday, October 16, 13
Thanks!
Wednesday, October 16, 13
@jonathanklein
www.etsy.com/careers
Get in Touch
Wednesday, October 16, 13