Upload
pantheon
View
404
Download
0
Tags:
Embed Size (px)
DESCRIPTION
Launching websites is hard. In the rush of last-minute changes, something always breaks. How could you have known the caching settings were mis-configured? Or maybe it’s the database. Your team is working overtime, but it’s already too late. Don’t let your site be one of the 60% of Drupal sites that launch late. Take steps now to lock in a perfect launch, every time. The Pantheon Launch Team launches several enterprise sites everyday, and supports hundreds of self-serve customers daily. In this platform-agnostic session, you’ll learn best practices and tools for rooting out problems and doubling site performance by launch day (whether you use PaaS, shared hosting, or your own hardware). You’ll learn: How to lead an agile, coordinated launch with project managers, stakeholders, developers, sysadmins—without spending months herding cats What causes 80% of website slowdowns and other problems—and how to obliterate surprises Top tools for benchmarking your performance and capacity Why you need a cache strategy if you care about performance—and specific things to think about before you configure your settings When to automate the launch prep—and when to call on an expert pair of eyes
Citation preview
A Perfect Launch,
Every Time
DrupalCon Austin 2014
What is a perfect launch?
● Schedule - On Time
● Cost - On Budget
● Scope - On Plan
Why should you care?
A Perfect Launch Recipe
● Launch Team - Onboarding
● Launch Check - Best Practices
● Load Test - Performance Tuning
Launch Team
Onboarding
How we prepare for launch
● Goal: Get rid of all the “uh-oh” moments
● Method: Launch Team
● Stakeholders:
o Project Manager - scheduling, best practices
o Developer - platform knowledge, integration
o Sys Admin - responsibilities, delegation
o Business owner - flawless launch
Have a system and tools
● Specify common workflow requirements
o Repeatable tasks, delegatable
● Project management - Wrike, JIRA, Redmine
● Orientation logistics
o Scheduling - calendar, deadlines
o Real-time communication
Phone, Video Conference, GoToMeeting, IRC
o Training - documentation, Slides, Videos
Mapping the terrain
● Scoping of responsibilities
o Reduce confusion, set stage
● Channels of communication
o Define emergency procedures
o Issue tracking as primary inbox
● Staying in touch
o Available, open, and regular
o Proactive
Launch Check
Best Practices
What is Site Audit?
● Drupal 7 static analysis
o https://drupal.org/project/site_audit
● Best practices
● Actionable report
● Vendor agnostic
o Optional Pantheon specific recommendations
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
Drupal caching settings
Drupal cron
Drupal’s database
Extensions (modules & themes)
Views
Watchdog
● Simple 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
Test Configuration
Result? Doubled performance.
Bad config, errors
● 20 min, 52 sec
● Requests per second: 7.98
● Time per request: 626.192 ms
Good config, no errors
● 10 min, 25 sec
● Requests per second: 15.99
● Time per request: 312.780 ms
Good configuration matters.
Load Testing
Performance Tuning
Why load test?
● Validate response times under peak load
● Smoke - operations under normal load
● Stress - behavior past peak load
o Spike - short bursts
● Capacity - plan for growth
Who should execute load tests?
● Developers execute
● Involve stakeholders
Tools for load testing
● DIY and simple
o Apache Bench
● Complex / dynamic
o Apache JMeter
o Load Impact
o Load Storm
When should I load test?
● Baseline
● Tools
o Xdebug, Webgrind, Devel, Syslog, Watchdog, New Relic
● Incrementally during development
● Prior to launch
Where do I perform load tests?
● Live environment
o Bandwidth
● Resource limitations
● SaaS load testing solutions
What to expect during & after
● Benchmark often (datapoints vs aggregate)
● Be reasonable
● Numbers should dictate expectations (back-end not just Google analytics)
Caching
● Opcode Cache
o APC, Zend Opcache, eAccelerator
● Backends
o Memcached, Redis, MongoDB, file system, APC
● Front-end caching
o Varnish, Squid, reverse-proxy CDNs
Back-end caching
Redis: Engage!
Front-end caching
Anonymous page caching: Disabled!
Testing Varnish with cURL
PHP Slow Log
Nginx error log
MySQL slow log
# Tim e: 130320 7:30:26
# User@ Host: db_user[db_database] @ localhost []
# Q uery_tim e: 4.545309 Lock_tim e: 0.000069 Row s_sent: 219 Row s_exam ined: 254
SET tim estam p= 1363779026;
SELECT option_nam e, option_value FRO M w p_options
W HERE autoload = 'yes';
Pay attention to watchdog
6652 11/O ct 15:05 w arning php W arning: Cannot m odify header inform ation - headers already sent by (output started
at /srv/w w w /code/includes/com m on.inc:2700) in drupal_goto() (line
6643 11/O ct 14:21 notice php Notice: Trying to get property of non-object in cap_ui_preprocess_page() (line 27 of
/srv/w w w /code/sites/all/them es/cap_ui/tem plate.php).
6595 11/O ct 13:00 notice php Notice: Unknow n: Can not authenticate to IM AP server: [AUTHENTICATIONFAILED] Invalid
credentials (Failure) (errflg= 2) in m ain() (line of ).
Good load test
Bad load test
Interpreting results
● Hard numbers
● Business impact
A Perfect Launch, Every Time
@ getpantheon
irc.freenode.net # pantheon
getpantheon.com
Thank you! Questions?