51
towards a Drupal performance benchmark Beat the Devil

Beat the devil: towards a Drupal performance benchmark

Embed Size (px)

DESCRIPTION

Slides from the session we (@perusio @rodricels @NITEMAN_es) gave on Drupal Developer Days Barcelona 2012: http://barcelona2012.drupaldays.org/sessions/beat-devil-towards-drupal-performance-benchmark

Citation preview

Page 1: Beat the devil: towards a Drupal performance benchmark

towards a Drupal performance benchmark

Beat the Devil

Page 2: Beat the devil: towards a Drupal performance benchmark

http://drupal.org/user/770300@rodricels

http://drupal.org/user/8859@perusio

http://drupal.org/user/39078@NITEMAN_es

Page 3: Beat the devil: towards a Drupal performance benchmark

We'll kill a lot of sacred cows

Page 4: Beat the devil: towards a Drupal performance benchmark
Page 5: Beat the devil: towards a Drupal performance benchmark

the murder weapon will be

Occam's razor

Page 6: Beat the devil: towards a Drupal performance benchmark

which amounts to theprinciple of least effort

Page 7: Beat the devil: towards a Drupal performance benchmark

laziness is good

Page 8: Beat the devil: towards a Drupal performance benchmark

hopefully in the end you'llbe puzzled

Page 9: Beat the devil: towards a Drupal performance benchmark

good things happen topuzzled people who

obsess

Page 10: Beat the devil: towards a Drupal performance benchmark

simplest

laziesteasiest

Page 11: Beat the devil: towards a Drupal performance benchmark

performance is for everyone

Page 12: Beat the devil: towards a Drupal performance benchmark

do you have performance issues?

Page 13: Beat the devil: towards a Drupal performance benchmark

system thinking

http://www.flickr.com/photos/irisheyes/148134965/sizes/o/in/photostream/

Page 14: Beat the devil: towards a Drupal performance benchmark

mathematics is for everyone

Page 15: Beat the devil: towards a Drupal performance benchmark

request per secondvs

seconds per request

Page 16: Beat the devil: towards a Drupal performance benchmark

MTTR Mean Time To

Recovery vs

MTBF Mean Time Between

Failure

Page 17: Beat the devil: towards a Drupal performance benchmark

do you monitor live system

performance?

Page 18: Beat the devil: towards a Drupal performance benchmark

live monitoring tools

Munin

Cacti

Page 19: Beat the devil: towards a Drupal performance benchmark

drupal accesslog table has tons of useful data

Page 20: Beat the devil: towards a Drupal performance benchmark

beware the logslogstash / graylog

aggregate them

Page 21: Beat the devil: towards a Drupal performance benchmark

economicscosts per

request/volume/peek

operational costsReturn On Investment

Page 22: Beat the devil: towards a Drupal performance benchmark

we're talking about $peed

$peed = cost_effective_performance

Page 23: Beat the devil: towards a Drupal performance benchmark

slowness downtimeoperations

costs you money

Page 24: Beat the devil: towards a Drupal performance benchmark

it's not the tools you have

it's the use you make of them

Page 25: Beat the devil: towards a Drupal performance benchmark

have you benchmarked your Drupal?

Page 26: Beat the devil: towards a Drupal performance benchmark

complex is easy and fragile

simple is hard and resilient

Keep It Simple Stupid

Page 27: Beat the devil: towards a Drupal performance benchmark

Know your stackKnow your targets

Monitor your performance

Page 28: Beat the devil: towards a Drupal performance benchmark

find where the problems aredon't fix things that aren't broken

the worse the firstone change a time

&keep a log of your actions

Page 29: Beat the devil: towards a Drupal performance benchmark

dissecting

frontend vs backend

backendstatic vs dynamic

dynamic

processing vs data gather

Page 30: Beat the devil: towards a Drupal performance benchmark

beyond development & operations

good developers are those that take all aspects in consideration

Page 31: Beat the devil: towards a Drupal performance benchmark

keep everything as close as possible to production

test systems

Page 32: Beat the devil: towards a Drupal performance benchmark

take advantage of configuration management

to reproduce your live infrastructure

test systems

Page 33: Beat the devil: towards a Drupal performance benchmark

some software has its performance directly

tied to the number of cores and/or

the amount of RAM

test systems

Page 34: Beat the devil: towards a Drupal performance benchmark

sacred cow of frontend

CDN (expiration logic)cloud servers

Page 35: Beat the devil: towards a Drupal performance benchmark

number of req. / parallelization blocking events data side: DNS resolutiondata side: download timedata side: size / weightorder matters

frontend vs backend

Page 36: Beat the devil: towards a Drupal performance benchmark

frontend vs backend tools

FirebugChrome tools

Google Speed TracerYslow

Web services [*] [*] [*] [*]

Page 37: Beat the devil: towards a Drupal performance benchmark

sacred cow of backend

load balancing: how? failover strategy?more webheads: cache consistency?another server: what for?

Page 38: Beat the devil: towards a Drupal performance benchmark

anonymous vs registered

cacheable vs non cacheable

backend: static vs dynamic

Page 39: Beat the devil: towards a Drupal performance benchmark

abJmeterHttperf

wrkGatling

TCP copy

HTTP benchmarking tools

Page 40: Beat the devil: towards a Drupal performance benchmark

sacred cow of PHP

HipHop (hacked libs)

PHP Extensions (C / PECL)

Page 41: Beat the devil: towards a Drupal performance benchmark

sacred cow of PHP

APC Tuningprofile, profile, profile and profile

upgrading PHP version (if you're brave)

Page 42: Beat the devil: towards a Drupal performance benchmark

locksdifficult to dissect

devel

dynamicprocessing vs data gather

Page 43: Beat the devil: towards a Drupal performance benchmark

benchmarking / profiling PHP

XdebugWebgrindXhprof

don't even try without an opcode cache

& remember the hard disk

Page 44: Beat the devil: towards a Drupal performance benchmark

sacred cow of databases

NoSQLdenormalizationsharding

http://www.flickr.com/photos/rebeccaselah/3942904359/sizes/l/in/photostream/

Page 45: Beat the devil: towards a Drupal performance benchmark

sacred cow of databases

NoSQL => helps with writesdenormalization => helps with HUGE DBssharding => helps with Big DBs

Page 46: Beat the devil: towards a Drupal performance benchmark

https://tools.percona.com/ Percona toolkit [*] (formerly maat-kit) tcpdump + Percona toolkitLogs are vital! Every engine has strongs & weakness

Better on bare metal!

MySQL Tune & Benchmarking tools

Page 47: Beat the devil: towards a Drupal performance benchmark

root hardware causes

network & DNS play a role

static content depends mainly on I/O

dynamic content (php) depends on CPU

database server mainly depends on RAM

Page 48: Beat the devil: towards a Drupal performance benchmark

Drupal known issues (DB): Watchdog, sessions, accesslog... history... Please do stress, load & stability tests regularly in your live system

extra balls:

Page 49: Beat the devil: towards a Drupal performance benchmark

This is our way, what is yours?

(no cows were harmed in the making of this presentation)

Page 50: Beat the devil: towards a Drupal performance benchmark

¿Questions?Pablo Picasso [speaking of computers]:

"But they are useless. They can only give you answers."

Page 51: Beat the devil: towards a Drupal performance benchmark