Upload
alan-lok
View
258
Download
0
Embed Size (px)
Citation preview
PERFORMANCE MANAGEMENTAlan Lok
WHY SHOULD I CARE?
• Save money?
• Look better?
• Keep clients!
COMPUTER PERFORMANCEComputer performance is characterized by the amount of work accomplished by a computer system or computer network compared to the time and resources used. Depending on the context, high computer performance may involve one or more of the following:
• Short response time for a given piece of work
• High throughput (rate of processing work)
• Low utilization of computing resource(s)
• High availability of the computing system or application
• Fast (or highly compact) data compression and decompression
• High bandwidth
• Short data transmission time
As defined by Wikipediahttps://en.wikipedia.org/wiki/Computer_performance
HOW DOES ONE MANAGE PERFORMANCE
Monitor after release
Monitor before release
Monitor before your
client calls you
MONITOR BEFORE RELEASE
• PHP profiling (for plugin and theme developers)
• Database analysis (for plugin developers)
• Load testing
PHP PROFILING
• Analyze your application with a PHP profiler such as BlackFire.io, New Relic, or xdebug/cachegrind
• Look for high number of calls, especially apply_filters, mysql calls, and wp_cache_get
PAGE PROFILING
• Page weight
• CSS weight
• JS execution
DATA ACCESS
• Use a tool such as New Relic to look through number of calls to database
• Optimize calls when rolling out your own table structures and ensure there are proper indexes
• Reduce number of plugins, widgets and shortcodes can cut down on database access
LOAD TESTING
• wrk (https://github.com/wg/wrk)
• Siege (https://www.joedog.org/siege-home/)
• http_load (http://acme.com/software/http_load/)
The simple ones
BUT WAIT, WHAT ABOUT WEBDRIVER…
• Great tool for real world and/or transactional testing
• Need lots of computing power
• Harder to script
IT’S LIVE!
Monitor your server
Monitor your users
Monitor your app
BEAT YOUR CLIENT TO RESOLUTION
• Set up application-based alerts via New Relic
• Set up server monitoring via DataDog or New Relic
• Set up 3rd party monitoring (New Relic, Pingdom)
PRODUCTION METRICS
• Response times / latencySpecifically for dynamic content serving
• Error rate For both server and client
• Process availabilityIs my Apache, Nginx, PHP-FPM, MySQL or memcached up?
• Number of connections Every machine has its limits, play within it
• Memory utilization You do not want to use swap
• Database QPS
that actually matter
BEST WAY TO AVOID DOWNTIME IS…
add redundancy
add redundancy
test your redundancy
SOME CHEAP WAYS TO SPEED UP YOUR WORDPRESS SITE
• Google mod_pagespeed
• Varnish
• W3TC or WP SuperCache
• fewer plugins
Caveat: not a one size fits all solution, so test and measure
Prevention is the best kind of performance management
me
@alan_lok
Thanks!