Download - SANDcamp 2014 - A Perfect Launch, Every Time

Transcript
Page 1: SANDcamp 2014 - A Perfect Launch, Every Time

A Prefect Lunch…Evry Tim

#SANDcramp 2014

Page 2: SANDcamp 2014 - A Perfect Launch, Every Time

A Perfect Launch…Every Time#SANDcamp 2014

Page 3: SANDcamp 2014 - A Perfect Launch, Every Time

Challenges for a perfect launch● On time● On budget● On Plan

Page 4: SANDcamp 2014 - A Perfect Launch, Every Time

Encourage self-sufficient users● Reduce cost● Easier to work and learn● Maintain good communication

Page 5: SANDcamp 2014 - A Perfect Launch, Every Time

OnboardingConverting Newbies to Pros

Page 6: SANDcamp 2014 - A Perfect Launch, Every Time

How we prepare for launch● Aim: Get rid of all the “uh-oh” moments● Recipe: Set clients up for success● Stakeholders:

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

Page 7: SANDcamp 2014 - A Perfect Launch, Every Time

Have a system and tools● Specify common workflow requirements

○ Repeatable tasks, delegatable● Project management - Wrike, JIRA, etc.● Orientation logistics

○ Scheduling - calendar, deadlines○ Real-time communication

■ Phone, Video Conference, GoToMeeting, IRC○ Training - documentation, Slides, Videos

Page 8: SANDcamp 2014 - A Perfect Launch, Every Time

Mapping the territory● Scoping 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: SANDcamp 2014 - A Perfect Launch, Every Time
Page 10: SANDcamp 2014 - A Perfect Launch, Every Time

Site AuditLandmines, acid pools, and dead weight.

Page 11: SANDcamp 2014 - A Perfect Launch, Every Time

Why audit sites?● Ensure optimal configuration● Every site is unique, but…● Built with the same framework● Similar architectural requirements● One size fits most.

Page 12: SANDcamp 2014 - A Perfect Launch, Every Time

What is static program analysis?● Performance & behavior gathering● Does not execute● Non-intrusive● Automated

Page 13: SANDcamp 2014 - A Perfect Launch, Every Time

Why use static program analysis?● Fast● Repeatable● Detects common problems

Page 14: SANDcamp 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 15: SANDcamp 2014 - A Perfect Launch, Every Time

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

Page 16: SANDcamp 2014 - A Perfect Launch, Every Time

What does it not analyze?● DOM / front-end performance● Usability and site experience● Aesthetics● Content

Page 17: SANDcamp 2014 - A Perfect Launch, Every Time

Drush format

Page 18: SANDcamp 2014 - A Perfect Launch, Every Time

HTML format with optional Bootstrap

Page 19: SANDcamp 2014 - A Perfect Launch, Every Time

JSON format

Page 20: SANDcamp 2014 - A Perfect Launch, Every Time

Launch Check● Site Audit in the Pantheon dashboard

○ Uses --vendor=pantheon config● Most actionable checks● Runs automatically

Page 21: SANDcamp 2014 - A Perfect Launch, Every Time
Page 22: SANDcamp 2014 - A Perfect Launch, Every Time

Best practices

Page 23: SANDcamp 2014 - A Perfect Launch, Every Time

Drupal caching settings

Page 24: SANDcamp 2014 - A Perfect Launch, Every Time

Drupal cron

Page 25: SANDcamp 2014 - A Perfect Launch, Every Time

Drupal’s database

Page 26: SANDcamp 2014 - A Perfect Launch, Every Time

Extensions (modules & themes)

Page 27: SANDcamp 2014 - A Perfect Launch, Every Time

Drupal’s System Status

Page 28: SANDcamp 2014 - A Perfect Launch, Every Time

Users

Page 29: SANDcamp 2014 - A Perfect Launch, Every Time

Views

Page 30: SANDcamp 2014 - A Perfect Launch, Every Time

Watchdog

Page 31: SANDcamp 2014 - A Perfect Launch, Every Time

● 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

Page 32: SANDcamp 2014 - A Perfect Launch, Every Time

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

Page 33: SANDcamp 2014 - A Perfect Launch, Every Time

Good configuration matters.

Page 34: SANDcamp 2014 - A Perfect Launch, Every Time

Load TestingObliterate surprises with actionable results

Page 35: SANDcamp 2014 - A Perfect Launch, Every Time

What does a load test measure?● Performance● Smoke● Spike● Stress● Capacity

Page 36: SANDcamp 2014 - A Perfect Launch, Every Time

Why load test?● Resource planning● A/B testing● Budgeting

Page 37: SANDcamp 2014 - A Perfect Launch, Every Time

When should I load test?● Before you write your first line of code!

○ Xdebug, Webgrind, Devel, Syslog, Watchdog, New Relic

● Incrementally during development● Prior to launch

Page 38: SANDcamp 2014 - A Perfect Launch, Every Time

Caching● Opcode Cache

○ APC, Zend Opcache, eAccelerator● Backends

○ Memcached, Redis, MongoDB, file system, APC● Front-end caching

○ Varnish, Squid, reverse-proxy CDNs

Page 39: SANDcamp 2014 - A Perfect Launch, Every Time

Testing Varnish with cURL

Page 40: SANDcamp 2014 - A Perfect Launch, Every Time

What to expect during & after● Benchmark often (datapoints vs aggregate)● Be reasonable● Numbers should dictate expectations (back-

end not just Google analytics)

Page 41: SANDcamp 2014 - A Perfect Launch, Every Time
Page 42: SANDcamp 2014 - A Perfect Launch, Every Time

PHP Slow Log

Page 43: SANDcamp 2014 - A Perfect Launch, Every Time

Nginx error log

Page 44: SANDcamp 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 45: SANDcamp 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 46: SANDcamp 2014 - A Perfect Launch, Every Time

New Relic

Page 47: SANDcamp 2014 - A Perfect Launch, Every Time

Who should execute the test● Developers execute● Involve stakeholders

Page 48: SANDcamp 2014 - A Perfect Launch, Every Time

Where to perform the test● Live environment

○ Bandwidth● Resource limitations● SaaS

Page 49: SANDcamp 2014 - A Perfect Launch, Every Time

Tools for load testing● DIY and simple

○ Apache Bench● Complex / dynamic

○ Apache JMeter○ Load Impact○ Load Storm

Page 50: SANDcamp 2014 - A Perfect Launch, Every Time

Interpreting results● Hard numbers● Business impact

Page 51: SANDcamp 2014 - A Perfect Launch, Every Time

Load Test report

Page 53: SANDcamp 2014 - A Perfect Launch, Every Time

@getpantheonirc.freenode.net #pantheon

getpantheon.com

Thank you! Questions?