SLIDE 1 High ¡Performance ¡for ¡Small ¡Sites ¡ ¡
John ¡Bickar, ¡Stanford ¡Web ¡Services ¡
1
SLIDE 2
Small ¡VPS ¡
What ¡is ¡a ¡“small ¡site?” ¡
Shared ¡hos=ng ¡ Limited/no ¡access ¡to ¡Linux/Apache ¡layer ¡ Cannot ¡install ¡Varnish, ¡memcache, ¡etc. ¡
SLIDE 3
What ¡is ¡a ¡“small ¡site?” ¡
If ¡you ¡run: ¡ ¡ $ sudo apt-get install varnish ¡ And ¡it ¡returns, ¡“user ¡not ¡sufficiently ¡super,” ¡you ¡ might ¡have ¡a ¡small ¡site. ¡
SLIDE 4
YOUR ¡SLOW ¡DRUPAL ¡SITE ¡
SLIDE 5
SLIDE 6
SLIDE 7
SLIDE 8
What you want.
SLIDE 9
SLIDE 10
What you can make your users think you have.
SLIDE 11
What you’re still not going to get.
SLIDE 12
The ¡Crea=on ¡of ¡a ¡Slow ¡Drupal ¡Site ¡
A ¡play ¡in ¡four ¡acts ¡
SLIDE 13
ACT ¡I: ¡INCEPTION ¡
SLIDE 14
“We ¡need ¡a ¡Drupal!” ¡
SLIDE 15
ACT ¡II: ¡CREATION ¡
SLIDE 16
Work, ¡work, ¡work ¡
SLIDE 17
ACT ¡III: ¡EXPANSION ¡
SLIDE 18
“That’s ¡great!” ¡ “Can ¡we ¡add…” ¡ Events ¡ Contact ¡form ¡ Restricted ¡content ¡ Room ¡reserva=ons ¡ Seventeen ¡more ¡roles ¡ Publishing ¡workflow ¡ Ten ¡more ¡content ¡types ¡ Slap ¡Chop ¡ George ¡Foreman ¡grill ¡ Custom ¡breadcrumbs ¡ Custom ¡.tpl.php ¡ Custom ¡web ¡app ¡ Mobile ¡device ¡detec=on ¡ Field-‑level ¡permissions ¡ GI ¡Joe ¡with ¡the ¡kung-‑fu ¡grip ¡ Discussion ¡forums ¡
SLIDE 19
ACT ¡IV: ¡DECELERATION ¡
SLIDE 20
SLIDE 21 May ¡5th, ¡2012 ¡ 21
Ini=al ¡Assessment ¡
Hos=ng ¡Op=ons ¡ Traffic ¡ Resources ¡ Priori=es ¡
SLIDE 22 May ¡5th, ¡2012 ¡ 22
Assessing ¡Performance ¡ Bo^lenecks ¡
When? ¡ Where? ¡ What? ¡ Who? ¡ Why? ¡
SLIDE 23 May ¡5th, ¡2012 ¡ 23
General ¡Tips ¡
Delete ¡unnecessary ¡modules ¡ Disable ¡unnecessary ¡modules ¡
SLIDE 24
SLIDE 25
SLIDE 26
SLIDE 27 May ¡5th, ¡2012 ¡ 27
General ¡Tips ¡
Use ¡them ¡ Drupal ¡core ¡performance ¡se`ngs ¡ admin/se`ngs/performance ¡(D6) ¡ admin/config/development/performance ¡(D7) ¡
SLIDE 28 May ¡5th, ¡2012 ¡ 28
Tes=ng ¡Tools ¡
YSlow ¡ Inspector ¡in ¡Chrome, ¡Safari ¡ ApacheBench ¡
SLIDE 29 May ¡5th, ¡2012 ¡ 29
Advanced ¡Performance ¡-‑ ¡Caching ¡
Cache ¡Rules ¡Everything ¡Around ¡Me ¡ Cache ¡gets ¡stale ¡
SLIDE 30 May ¡5th, ¡2012 ¡ 30
Advanced ¡Performance ¡-‑ ¡Caching ¡
cron ¡
32 * * * * curl -sS http://www.example.com/foo > \ /dev/null
SLIDE 31 May ¡5th, ¡2012 ¡ 31
Advanced ¡Performance ¡-‑ ¡Caching ¡
Views ¡caching ¡ Panels ¡caching ¡ Boost ¡ AuthCache ¡
SLIDE 32 Prove ¡it ¡
techcommons.stanford.edu ¡ Homepage ¡load ¡=me ¡with ¡uncached ¡ View: ¡ 9.7 ¡seconds ¡
SLIDE 33 Prove ¡it ¡
techcommons.stanford.edu ¡ Homepage ¡load ¡=me ¡ager ¡enabling ¡ Views ¡caching: ¡ 2.8 ¡seconds ¡
SLIDE 34 Prove ¡it ¡
techcommons.stanford.edu ¡ Homepage ¡load ¡=me ¡ager ¡enabling ¡ Boost ¡caching: ¡ 117 ¡milliseconds ¡
SLIDE 35 May ¡5th, ¡2012 ¡ 35
Advanced ¡Performance ¡-‑ ¡ Debugging ¡
Devel ¡
SLIDE 36
SLIDE 37
SLIDE 38
SLIDE 39 May ¡5th, ¡2012 ¡ 39
Summary ¡
Know ¡thy ¡users ¡ ¡ ¡
Keep ¡Calm ¡ And ¡ DRUPAL ¡ON ¡
Know ¡thy ¡content ¡ Know ¡thy ¡traffic ¡
SLIDE 40 Appendix ¡
Linkies: ¡
- h^p://techcommons.stanford.edu/topics/web-‑development/benchmarking-‑site-‑performance-‑apachebench ¡
- h^p://techcommons.stanford.edu/topics/drupal/boost ¡ ¡
- h^p://techcommons.stanford.edu/topics/drupal/improving-‑drupal-‑performance-‑and-‑speed-‑leland-‑servers ¡ ¡