43
A Perfect Launch, Every Time DrupalCamp LA 2014

DrupalCamp LA 2014 - A Perfect Launch, Every Time

Embed Size (px)

DESCRIPTION

Launches are tough on a new developer. Everyone remembers the lump in their throats around launch time; the rush to finish content, make final theme tweaks, adjust for sudden browser weirdness. As momentum picks up, the odd change request always appears, databases are slingshot hither and yon, while everyone scrambles to resolve merge conflicts like a Tokyo train at rush hour. We emerge scarred but smarter, intent on making the next launch less painful. But with different teams launching different sites, it can be hard to establish an iterative process. Especially as new work accumulates in the backlog, we reap what we sow in technical debt from rushed launches, quick & dirty choices made under the gun, and unimplemented ideas from retrospectives. Pantheon, however, has the same Customer Success team launching several enterprise sites per week, while assisting hundreds of self serve customers when they need a hand. Because we need to work effectively, we have developed the tools and process to ensure: * Great Site Performance - On Day One * Less problems over the long run * Clear Expectations from Informed Stakeholders The session will cover other key areas: * Preparing For Launch for the PM, Stakeholder, Developer & Sys Admin * Auditing the Site for landmines, carnivorous acid pool islands, and deadweight * Load Testing to obliterate surprises with actionable results This session is Platform Agnostic; whether you use PAAS, shared hosting, or wield your own hardware, PMs, developers, and clients will leave with new tools in their belt to launch with less agita. We will share some of our challenges and how we overcame them, and hopefully hear from you about how you overcame yours!

Citation preview

Page 1: DrupalCamp LA 2014 - A Perfect Launch, Every Time

A Perfect Launch, Every TimeDrupalCamp LA 2014

Page 2: DrupalCamp LA 2014 - A Perfect Launch, Every Time

What is a perfect launch?• Schedule - On Time • Cost - On Budget • Scope - On Plan

Page 3: DrupalCamp LA 2014 - A Perfect Launch, Every Time

Why should you care?

Page 4: DrupalCamp LA 2014 - A Perfect Launch, Every Time

A Perfect Launch RecipeLaunch Team

• Onboarding Launch Check

• Best Practices Load Test

• Performance Tuning

Page 5: DrupalCamp LA 2014 - A Perfect Launch, Every Time

Launch TeamOnboarding

Page 6: DrupalCamp LA 2014 - A Perfect Launch, Every Time

How we prepare for launchGoal: Get rid of all the “uh-oh” moments Method: Launch Team Stakeholders:

• Project Manager - scheduling, best practices • Developer - platform knowledge, integration • Sys Admin - responsibilities, delegation • Business owner - flawless launch

Page 7: DrupalCamp LA 2014 - A Perfect Launch, Every Time

Have a system and toolsSpecify common workflow requirements

• Repeatable tasks, delegatable Project management - Wrike, JIRA, Redmine, Trello Orientation logistics

• Scheduling - calendar, deadlines • Real-time communication

• Phone, Video Conference, GoToMeeting, IRC • Training - documentation, Slides, Videos

Page 8: DrupalCamp LA 2014 - A Perfect Launch, Every Time

Mapping the terrainScoping of responsibilities

• Reduce confusion, set stage Channels of communication

• Define emergency procedures • Issue tracking as primary inbox

Staying in touch • Available, open, and regular • Proactive

Page 9: DrupalCamp LA 2014 - A Perfect Launch, Every Time
Page 10: DrupalCamp LA 2014 - A Perfect Launch, Every Time

Launch CheckBest Practices

Page 11: DrupalCamp LA 2014 - A Perfect Launch, Every Time

What is Site Audit?Drupal 7 static analysis

• https://drupal.org/project/site_audit Best practices Actionable report Vendor agnostic

• Optional Pantheon specific recommendations

Page 12: DrupalCamp LA 2014 - A Perfect Launch, Every Time

What can an audit analyze?• Drupal caching settings • Codebase and file size • Database structure • Modules, including duplicate / missing • Non-standard code structures • Views caching • Watchdog logs

Page 13: DrupalCamp LA 2014 - A Perfect Launch, Every Time
Page 14: DrupalCamp LA 2014 - A Perfect Launch, Every Time

Drupal caching settings

Page 15: DrupalCamp LA 2014 - A Perfect Launch, Every Time

Drupal cron

Page 16: DrupalCamp LA 2014 - A Perfect Launch, Every Time

Drupal’s database

Page 17: DrupalCamp LA 2014 - A Perfect Launch, Every Time

Extensions (modules & themes)

Page 18: DrupalCamp LA 2014 - A Perfect Launch, Every Time

Views

Page 19: DrupalCamp LA 2014 - A Perfect Launch, Every Time

Watchdog

Page 20: DrupalCamp LA 2014 - A Perfect Launch, Every Time

Test ConfigurationSimple Drupal 7 site Apache Bench

• 10,000 requests to home page (5 concurrent) Warmed cache, cleared watchdog Comparison

• Bad config, 1 PHP notice and warning in theme • Good config, no PHP notices or warnings

Page 21: DrupalCamp LA 2014 - A Perfect Launch, Every Time

Result? Doubled performance.

Performance Comparison Bad Config Good Config

Load Time (min) 20:52 10:25

Requests per second 7.98 15.99

Time per request (ms) 626.192 312.780

Page 22: DrupalCamp LA 2014 - A Perfect Launch, Every Time

Good configuration matters.

Page 23: DrupalCamp LA 2014 - A Perfect Launch, Every Time

Load TestingPerformance Tuning

Page 24: DrupalCamp LA 2014 - A Perfect Launch, Every Time

Why load test?Validate response times under peak load Smoke - operations under normal load Stress - behavior past peak load

• Spike - short bursts Capacity - plan for growth

Page 25: DrupalCamp LA 2014 - A Perfect Launch, Every Time

Who should execute load tests?Developers execute Involve stakeholders

Page 26: DrupalCamp LA 2014 - A Perfect Launch, Every Time

Tools for load testingDIY and simple

• Apache Bench - http://httpd.apache.org/docs/2.2/programs/ab.html

Complex / dynamic • Apache JMeter - https://jmeter.apache.org/ • Load Impact - https://loadimpact.com/ • Load Storm - http://loadstorm.com/

Page 27: DrupalCamp LA 2014 - A Perfect Launch, Every Time

When should I load test?Baseline Tools

• Xdebug - http://xdebug.org/ • Webgrind - https://github.com/jokkedk/webgrind • Devel - https://drupal.org/project/devel • Syslog • Watchdog • New Relic - http://newrelic.com/

Incrementally during development

Page 28: DrupalCamp LA 2014 - A Perfect Launch, Every Time

Where do I perform load tests?Live environment

• Bandwidth Resource limitations SaaS load testing solutions

Page 29: DrupalCamp LA 2014 - A Perfect Launch, Every Time

What to expect during & after• Benchmark often

• Datapoints • Aggregate

• Be reasonable • Numbers should dictate expectations • Back-end

• Google Analytics

Page 30: DrupalCamp LA 2014 - A Perfect Launch, Every Time

CachingOpcode Cache

• APC, Zend Opcache, eAccelerator Backends

• Memcached, Redis, MongoDB, file system, APC Front-end caching

• Varnish, Squid, reverse-proxy CDNs

Page 31: DrupalCamp LA 2014 - A Perfect Launch, Every Time

Redis: Engage!

Page 32: DrupalCamp LA 2014 - A Perfect Launch, Every Time

Anonymous page caching: Disabled!

Page 33: DrupalCamp LA 2014 - A Perfect Launch, Every Time

Testing Varnish with cURL

Page 34: DrupalCamp LA 2014 - A Perfect Launch, Every Time
Page 35: DrupalCamp LA 2014 - A Perfect Launch, Every Time

PHP Slow Log

Page 36: DrupalCamp LA 2014 - A Perfect Launch, Every Time

Nginx error log

Page 37: DrupalCamp LA 2014 - A Perfect Launch, Every Time

MySQL slow log# Time: 130320 7:30:26 # User@Host: db_user[db_database] @ localhost [] # Query_time: 4.545309 Lock_time: 0.000069 Rows_sent: 219 Rows_examined: 254 SET timestamp=1363779026; SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes';

Page 38: DrupalCamp LA 2014 - A Perfect Launch, Every Time

Pay attention to watchdog6652 11/Oct 15:05 warning php Warning: Cannot modify header information - headers already sent by (output started at /srv/www/code/includes/common.inc:2700) in drupal_goto() (line !6643 11/Oct 14:21 notice php Notice: Trying to get property of non-object in cap_ui_preprocess_page() (line 27 of /srv/www/code/sites/all/themes/cap_ui/template.php). !6595 11/Oct 13:00 notice php Notice: Unknown: Can not authenticate to IMAP server: [AUTHENTICATIONFAILED] Invalid credentials (Failure) (errflg=2) in main() (line of ).

Page 39: DrupalCamp LA 2014 - A Perfect Launch, Every Time

Good load test

Page 40: DrupalCamp LA 2014 - A Perfect Launch, Every Time

Bad load test

Page 41: DrupalCamp LA 2014 - A Perfect Launch, Every Time

Interpreting resultsHard numbers Business impact

Page 42: DrupalCamp LA 2014 - A Perfect Launch, Every Time

A Perfect Launch, Every Time

Page 43: DrupalCamp LA 2014 - A Perfect Launch, Every Time

Thank you! Questions?@SuzanneAldrich @GetPantheon

irc.freenode.net #pantheon getpantheon.com