why drupal is so slow

171

Upload: bert-boerland

Post on 06-Dec-2014

8.746 views

Category:

Technology


5 download

DESCRIPTION

A short intro in to the chain of performance for PHP/Drupal websites

TRANSCRIPT

Page 1: Why Drupal Is So Slow
Page 2: Why Drupal Is So Slow
Page 3: Why Drupal Is So Slow

Why Drupal is so SLOW ...?!!!

Page 4: Why Drupal Is So Slow

Why Drupal is so SLOW ...?!!!

Page 5: Why Drupal Is So Slow
Page 6: Why Drupal Is So Slow

• long term drupal user (2001)

Page 7: Why Drupal Is So Slow

• long term drupal user (2001)

• schenker domain d.o

Page 8: Why Drupal Is So Slow

• long term drupal user (2001)

• schenker domain d.o

• Permanent Member Drupal Association

Page 9: Why Drupal Is So Slow

• long term drupal user (2001)

• schenker domain d.o

• Permanent Member Drupal Association

• bertboerland op elk sociaal netwerk(hint: @bertboerland op twitter :-)

Page 10: Why Drupal Is So Slow

• long term drupal user (2001)

• schenker domain d.o

• Permanent Member Drupal Association

• bertboerland op elk sociaal netwerk(hint: @bertboerland op twitter :-)

• werkzaam DOP (“we are hiring”)

Page 11: Why Drupal Is So Slow

“Thank you #ATOS for hosting the #phpbnl meeting”

Page 12: Why Drupal Is So Slow
Page 13: Why Drupal Is So Slow

• Hashtag #phpbnl

Page 14: Why Drupal Is So Slow

• Hashtag #phpbnl

• Subhastag @bertboerland #fail :-)

Page 15: Why Drupal Is So Slow
Page 16: Why Drupal Is So Slow
Page 17: Why Drupal Is So Slow
Page 18: Why Drupal Is So Slow
Page 19: Why Drupal Is So Slow
Page 20: Why Drupal Is So Slow

• Wie heeft Drupal geïnstalleerd?

Page 21: Why Drupal Is So Slow

• Wie heeft Drupal geïnstalleerd?

• Wie heeft high volume PHP websites gebouwd?

Page 22: Why Drupal Is So Slow

• Wie heeft Drupal geïnstalleerd?

• Wie heeft high volume PHP websites gebouwd?

• Wie heeft high volume Drupal websites gebouwd?

Page 23: Why Drupal Is So Slow

• Wie heeft Drupal geïnstalleerd?

• Wie heeft high volume PHP websites gebouwd?

• Wie heeft high volume Drupal websites gebouwd?

• Wie is ooit tegen Drupal performance aangelopen?

Page 24: Why Drupal Is So Slow
Page 25: Why Drupal Is So Slow

• Google: +0,4 seconde = -0,6% verkeer

Page 26: Why Drupal Is So Slow

• Google: +0,4 seconde = -0,6% verkeer

• Yahoo! +0,4 seconde = -7% verkeer

Page 27: Why Drupal Is So Slow

• Google: +0,4 seconde = -0,6% verkeer

• Yahoo! +0,4 seconde = -7% verkeer

• Bing: -2 seconde = +4% verkeer

Page 28: Why Drupal Is So Slow

• Google: +0,4 seconde = -0,6% verkeer

• Yahoo! +0,4 seconde = -7% verkeer

• Bing: -2 seconde = +4% verkeer

• Shopzilla: -5 seconde = +12% omzet, 50% minder bandbreedte

Page 29: Why Drupal Is So Slow

• Google: +0,4 seconde = -0,6% verkeer

• Yahoo! +0,4 seconde = -7% verkeer

• Bing: -2 seconde = +4% verkeer

• Shopzilla: -5 seconde = +12% omzet, 50% minder bandbreedte

Page 30: Why Drupal Is So Slow

• Google: +0,4 seconde = -0,6% verkeer

• Yahoo! +0,4 seconde = -7% verkeer

• Bing: -2 seconde = +4% verkeer

• Shopzilla: -5 seconde = +12% omzet, 50% minder bandbreedte

• Sneller = beter UX, meer verkeer, meer omzet, minder kosten!

Page 31: Why Drupal Is So Slow
Page 32: Why Drupal Is So Slow

• Keten

Page 33: Why Drupal Is So Slow

• Keten

• Drupal

Page 34: Why Drupal Is So Slow

• Keten

• Drupal

• Proces

Page 35: Why Drupal Is So Slow
Page 36: Why Drupal Is So Slow

• NCRV.nl en RNW.nl

• Honderduizendenden hits per dag, Tienduizend artikelen per maand

Page 37: Why Drupal Is So Slow

• RNW.nl

Page 38: Why Drupal Is So Slow
Page 39: Why Drupal Is So Slow

user > browser > network > site

Page 40: Why Drupal Is So Slow

user > browser > network > site

Page 41: Why Drupal Is So Slow

user > browser > network > site

Page 42: Why Drupal Is So Slow
Page 43: Why Drupal Is So Slow
Page 44: Why Drupal Is So Slow
Page 45: Why Drupal Is So Slow

• Juiste gestructureerde informatie verkrijgen; “het is langzaam” vs tijd, browser, actie, URL etc...

Page 46: Why Drupal Is So Slow

• Juiste gestructureerde informatie verkrijgen; “het is langzaam” vs tijd, browser, actie, URL etc...

• Redacteur stemt niet met zijn voeten.

Page 47: Why Drupal Is So Slow

• Juiste gestructureerde informatie verkrijgen; “het is langzaam” vs tijd, browser, actie, URL etc...

• Redacteur stemt niet met zijn voeten.

• Ingelogd of niet?

Page 48: Why Drupal Is So Slow

• Juiste gestructureerde informatie verkrijgen; “het is langzaam” vs tijd, browser, actie, URL etc...

• Redacteur stemt niet met zijn voeten.

• Ingelogd of niet?

Page 49: Why Drupal Is So Slow

• Juiste gestructureerde informatie verkrijgen; “het is langzaam” vs tijd, browser, actie, URL etc...

• Redacteur stemt niet met zijn voeten.

• Ingelogd of niet?

Page 50: Why Drupal Is So Slow
Page 51: Why Drupal Is So Slow
Page 52: Why Drupal Is So Slow
Page 53: Why Drupal Is So Slow
Page 54: Why Drupal Is So Slow
Page 55: Why Drupal Is So Slow

• Progressive rendering (HTML en plaatjes)

Page 56: Why Drupal Is So Slow

• Progressive rendering (HTML en plaatjes)

• Externe Javascript (extern domain als CDN)

Page 57: Why Drupal Is So Slow

• Progressive rendering (HTML en plaatjes)

• Externe Javascript (extern domain als CDN)

• CSS Sprites

Page 58: Why Drupal Is So Slow

• Progressive rendering (HTML en plaatjes)

• Externe Javascript (extern domain als CDN)

• CSS Sprites

• Reduce DNS lookups (Google analytics, online AJAX scripts as a service)

Page 59: Why Drupal Is So Slow

• Progressive rendering (HTML en plaatjes)

• Externe Javascript (extern domain als CDN)

• CSS Sprites

• Reduce DNS lookups (Google analytics, online AJAX scripts as a service)

• ....

Page 60: Why Drupal Is So Slow

• Progressive rendering (HTML en plaatjes)

• Externe Javascript (extern domain als CDN)

• CSS Sprites

• Reduce DNS lookups (Google analytics, online AJAX scripts as a service)

• ....

Page 61: Why Drupal Is So Slow
Page 62: Why Drupal Is So Slow

Tools:

Page 63: Why Drupal Is So Slow

Tools:

• YSlow

Page 64: Why Drupal Is So Slow

Tools:

• YSlow

• JSLint

Page 65: Why Drupal Is So Slow

Tools:

• YSlow

• JSLint

• NET

Page 66: Why Drupal Is So Slow

Tools:

• YSlow

• JSLint

• NET

• CSS Sprite generatoren

Page 67: Why Drupal Is So Slow

Tools:

• YSlow

• JSLint

• NET

• CSS Sprite generatoren

• HTML, CSS, RSS validatie

Page 68: Why Drupal Is So Slow

Tools:

• YSlow

• JSLint

• NET

• CSS Sprite generatoren

• HTML, CSS, RSS validatie

Page 69: Why Drupal Is So Slow
Page 70: Why Drupal Is So Slow
Page 71: Why Drupal Is So Slow

• Asymetrische routering is een feit (en niet te zien!)

Page 72: Why Drupal Is So Slow

• Asymetrische routering is een feit (en niet te zien!)

• BGP is niet voor watjes

Page 73: Why Drupal Is So Slow

• Asymetrische routering is een feit (en niet te zien!)

• BGP is niet voor watjes

• Bandbreedte meet je niet in Mbps (“it’s the latency stupid!”)

Page 74: Why Drupal Is So Slow

• Asymetrische routering is een feit (en niet te zien!)

• BGP is niet voor watjes

• Bandbreedte meet je niet in Mbps (“it’s the latency stupid!”)

• Locatie maakt uit (100ms roundtrip normaal)

Page 75: Why Drupal Is So Slow

• Asymetrische routering is een feit (en niet te zien!)

• BGP is niet voor watjes

• Bandbreedte meet je niet in Mbps (“it’s the latency stupid!”)

• Locatie maakt uit (100ms roundtrip normaal)

• Gebruik CDN pas als het een oplossing is (duur, ingewikkeld, USA centric)

Page 76: Why Drupal Is So Slow
Page 77: Why Drupal Is So Slow

Tools

Page 78: Why Drupal Is So Slow

Tools

• AS Looking glasses

Page 79: Why Drupal Is So Slow

Tools

• AS Looking glasses

• MTR

Page 80: Why Drupal Is So Slow

Tools

• AS Looking glasses

• MTR

Page 81: Why Drupal Is So Slow
Page 82: Why Drupal Is So Slow

• Doe maar geen Source / Destiantie hash op je loadbalancers :-)

Page 83: Why Drupal Is So Slow

• Doe maar geen Source / Destiantie hash op je loadbalancers :-)

• Least connections kan beste zijn

Page 84: Why Drupal Is So Slow

• Doe maar geen Source / Destiantie hash op je loadbalancers :-)

• Least connections kan beste zijn

• Route static direct naar andere webserverphpworkers voor echte werk.

Page 85: Why Drupal Is So Slow

• Doe maar geen Source / Destiantie hash op je loadbalancers :-)

• Least connections kan beste zijn

• Route static direct naar andere webserverphpworkers voor echte werk.

• lighttp is een betere vriend dan Apache

Page 86: Why Drupal Is So Slow

• Doe maar geen Source / Destiantie hash op je loadbalancers :-)

• Least connections kan beste zijn

• Route static direct naar andere webserverphpworkers voor echte werk.

• lighttp is een betere vriend dan Apache

• Varnish is een veeeel betere vriend dan Squid

Page 87: Why Drupal Is So Slow

• Doe maar geen Source / Destiantie hash op je loadbalancers :-)

• Least connections kan beste zijn

• Route static direct naar andere webserverphpworkers voor echte werk.

• lighttp is een betere vriend dan Apache

• Varnish is een veeeel betere vriend dan Squid

• Filesysteem kan al uitmaken, inodes, swapspace, netwerkkaarten...

Page 88: Why Drupal Is So Slow

• Doe maar geen Source / Destiantie hash op je loadbalancers :-)

• Least connections kan beste zijn

• Route static direct naar andere webserverphpworkers voor echte werk.

• lighttp is een betere vriend dan Apache

• Varnish is een veeeel betere vriend dan Squid

• Filesysteem kan al uitmaken, inodes, swapspace, netwerkkaarten...

Page 89: Why Drupal Is So Slow
Page 90: Why Drupal Is So Slow

• Apache tunen is een kunst, PHP tunen is een martial art

Page 91: Why Drupal Is So Slow

• Apache tunen is een kunst, PHP tunen is een martial art

• PHP 16 MB is niets, 128 bijna norm (modules vreten geheugen)

Page 92: Why Drupal Is So Slow

• Apache tunen is een kunst, PHP tunen is een martial art

• PHP 16 MB is niets, 128 bijna norm (modules vreten geheugen)

• Keepalive en pipelining helpen (HTTP/1.1)

Page 93: Why Drupal Is So Slow

• Apache tunen is een kunst, PHP tunen is een martial art

• PHP 16 MB is niets, 128 bijna norm (modules vreten geheugen)

• Keepalive en pipelining helpen (HTTP/1.1)

• Filesysteem (hdparm) optimaliseren

Page 94: Why Drupal Is So Slow

• Apache tunen is een kunst, PHP tunen is een martial art

• PHP 16 MB is niets, 128 bijna norm (modules vreten geheugen)

• Keepalive en pipelining helpen (HTTP/1.1)

• Filesysteem (hdparm) optimaliseren

• Log enkel in error reporting wat je nodig hebt

Page 95: Why Drupal Is So Slow

• Apache tunen is een kunst, PHP tunen is een martial art

• PHP 16 MB is niets, 128 bijna norm (modules vreten geheugen)

• Keepalive en pipelining helpen (HTTP/1.1)

• Filesysteem (hdparm) optimaliseren

• Log enkel in error reporting wat je nodig hebt

• Gzip pages op webserver, niet door Drupal :-)

Page 96: Why Drupal Is So Slow

• Apache tunen is een kunst, PHP tunen is een martial art

• PHP 16 MB is niets, 128 bijna norm (modules vreten geheugen)

• Keepalive en pipelining helpen (HTTP/1.1)

• Filesysteem (hdparm) optimaliseren

• Log enkel in error reporting wat je nodig hebt

• Gzip pages op webserver, niet door Drupal :-)

• Schrijf logging naar raw sockets naar syslog server

Page 97: Why Drupal Is So Slow

• Do use opcode cachers! (APC)

Page 98: Why Drupal Is So Slow

• Do use opcode cachers! (APC)

Page 99: Why Drupal Is So Slow

• Do use opcode cachers! (APC)

Page 100: Why Drupal Is So Slow

• Do use opcode cachers! (APC)

Page 101: Why Drupal Is So Slow

• Do use opcode cachers! (APC)

Page 102: Why Drupal Is So Slow
Page 103: Why Drupal Is So Slow

• Standaard caching in database

Page 104: Why Drupal Is So Slow

• Standaard caching in database

• Helemaal aan het einde van de keten

Page 105: Why Drupal Is So Slow

• Standaard caching in database

• Helemaal aan het einde van de keten

• Beter dan niets

Page 106: Why Drupal Is So Slow

• Standaard caching in database

• Helemaal aan het einde van de keten

• Beter dan niets

• Daar is alles mee gezegd...

Page 107: Why Drupal Is So Slow
Page 108: Why Drupal Is So Slow

• Standaard module

Page 109: Why Drupal Is So Slow

• Standaard module

• “Bijna geen issues”

Page 110: Why Drupal Is So Slow

• Standaard module

• “Bijna geen issues”

• Alle anon bezoek cachen

Page 111: Why Drupal Is So Slow

• Standaard module

• “Bijna geen issues”

• Alle anon bezoek cachen

• Hit rate vaak rond 90%

Page 112: Why Drupal Is So Slow

• Standaard module

• “Bijna geen issues”

• Alle anon bezoek cachen

• Hit rate vaak rond 90%

• Load database

Page 113: Why Drupal Is So Slow

• Standaard module

• “Bijna geen issues”

• Alle anon bezoek cachen

• Hit rate vaak rond 90%

• Load database

• Installatie 2 uur max

Page 114: Why Drupal Is So Slow
Page 115: Why Drupal Is So Slow

• Standaard module

Page 116: Why Drupal Is So Slow

• Standaard module

• Database 1,5 GB waarvan 800MB search

Page 117: Why Drupal Is So Slow

• Standaard module

• Database 1,5 GB waarvan 800MB search

• Geen spider (W.I.P)

Page 118: Why Drupal Is So Slow

• Standaard module

• Database 1,5 GB waarvan 800MB search

• Geen spider (W.I.P)

• Standaard search geeft veel Slow Queries

Page 119: Why Drupal Is So Slow

• Standaard module

• Database 1,5 GB waarvan 800MB search

• Geen spider (W.I.P)

• Standaard search geeft veel Slow Queries

• Search niet meer ‘echt’ geupdate sinds 4.7

Page 120: Why Drupal Is So Slow

• Standaard module

• Database 1,5 GB waarvan 800MB search

• Geen spider (W.I.P)

• Standaard search geeft veel Slow Queries

• Search niet meer ‘echt’ geupdate sinds 4.7

• Veel betere stemming, AJAX, extensies

Page 121: Why Drupal Is So Slow

• Standaard module

• Database 1,5 GB waarvan 800MB search

• Geen spider (W.I.P)

• Standaard search geeft veel Slow Queries

• Search niet meer ‘echt’ geupdate sinds 4.7

• Veel betere stemming, AJAX, extensies

• het blijft Java :-)

Page 122: Why Drupal Is So Slow
Page 123: Why Drupal Is So Slow

• Ook als service te “koop”

Page 124: Why Drupal Is So Slow

• Ook als service te “koop”

• Autocomplete modules

Page 125: Why Drupal Is So Slow

• Ook als service te “koop”

• Autocomplete modules

• Faceted search modules

Page 126: Why Drupal Is So Slow

• Ook als service te “koop”

• Autocomplete modules

• Faceted search modules

• CCK integration

Page 127: Why Drupal Is So Slow

• Ook als service te “koop”

• Autocomplete modules

• Faceted search modules

• CCK integration

• Views integration

Page 128: Why Drupal Is So Slow

• Ook als service te “koop”

• Autocomplete modules

• Faceted search modules

• CCK integration

• Views integration

• UTF8

Page 129: Why Drupal Is So Slow

• Ook als service te “koop”

• Autocomplete modules

• Faceted search modules

• CCK integration

• Views integration

• UTF8

• Bloedsnel

Page 130: Why Drupal Is So Slow
Page 131: Why Drupal Is So Slow

• Redelijk goed te doen

Page 132: Why Drupal Is So Slow

• Redelijk goed te doen

• Start met MySQLAdmin

Page 133: Why Drupal Is So Slow

• Redelijk goed te doen

• Start met MySQLAdmin

• MySQLOptimize is symptoom bestrijding (but so is duckttape)

Page 134: Why Drupal Is So Slow

• Redelijk goed te doen

• Start met MySQLAdmin

• MySQLOptimize is symptoom bestrijding (but so is duckttape)

• Persistent db connecties

Page 135: Why Drupal Is So Slow

• Redelijk goed te doen

• Start met MySQLAdmin

• MySQLOptimize is symptoom bestrijding (but so is duckttape)

• Persistent db connecties

• InnoDb beats MyIsam (but not always)

Page 136: Why Drupal Is So Slow

• Redelijk goed te doen

• Start met MySQLAdmin

• MySQLOptimize is symptoom bestrijding (but so is duckttape)

• Persistent db connecties

• InnoDb beats MyIsam (but not always)

• Elke my.cnf is specifiek

Page 137: Why Drupal Is So Slow

• Redelijk goed te doen

• Start met MySQLAdmin

• MySQLOptimize is symptoom bestrijding (but so is duckttape)

• Persistent db connecties

• InnoDb beats MyIsam (but not always)

• Elke my.cnf is specifiek

• Kijk naar andere databases

Page 138: Why Drupal Is So Slow
Page 139: Why Drupal Is So Slow
Page 140: Why Drupal Is So Slow

• Javascript aggregatie

Page 141: Why Drupal Is So Slow

• Javascript aggregatie

• CSS aggregatie

Page 142: Why Drupal Is So Slow

• Javascript aggregatie

• CSS aggregatie

• Logging uit of naar syslog

Page 143: Why Drupal Is So Slow

• Javascript aggregatie

• CSS aggregatie

• Logging uit of naar syslog

• Caching normaal 5 minuten (block cache als mogelijk)

Page 144: Why Drupal Is So Slow

• Javascript aggregatie

• CSS aggregatie

• Logging uit of naar syslog

• Caching normaal 5 minuten (block cache als mogelijk)

• cron.php 5 minuten

Page 145: Why Drupal Is So Slow

• Javascript aggregatie

• CSS aggregatie

• Logging uit of naar syslog

• Caching normaal 5 minuten (block cache als mogelijk)

• cron.php 5 minuten

• Anti spam dienst als Captcha of mollom

Page 146: Why Drupal Is So Slow

• Javascript aggregatie

• CSS aggregatie

• Logging uit of naar syslog

• Caching normaal 5 minuten (block cache als mogelijk)

• cron.php 5 minuten

• Anti spam dienst als Captcha of mollom

• XML sitemap en Google news views

Page 147: Why Drupal Is So Slow

• Javascript aggregatie

• CSS aggregatie

• Logging uit of naar syslog

• Caching normaal 5 minuten (block cache als mogelijk)

• cron.php 5 minuten

• Anti spam dienst als Captcha of mollom

• XML sitemap en Google news views

• Devel uit :-)

Page 148: Why Drupal Is So Slow
Page 149: Why Drupal Is So Slow

• SOLR/Memcache

Page 150: Why Drupal Is So Slow

• SOLR/Memcache

• Boost

Page 151: Why Drupal Is So Slow

• SOLR/Memcache

• Boost

• Cacherouter

Page 152: Why Drupal Is So Slow

• SOLR/Memcache

• Boost

• Cacherouter

• Block caching

Page 153: Why Drupal Is So Slow

• SOLR/Memcache

• Boost

• Cacherouter

• Block caching

Page 154: Why Drupal Is So Slow

• SOLR/Memcache

• Boost

• Cacherouter

• Block caching

• DOP: views optimalisatie

Page 155: Why Drupal Is So Slow

• SOLR/Memcache

• Boost

• Cacherouter

• Block caching

• DOP: views optimalisatie

Page 156: Why Drupal Is So Slow
Page 158: Why Drupal Is So Slow
Page 159: Why Drupal Is So Slow

• Groups http://groups.drupal.org/high-performance

Page 160: Why Drupal Is So Slow

• Groups http://groups.drupal.org/high-performance

• Drupal Handbook http://drupal.org/node/326504

Page 161: Why Drupal Is So Slow

• Groups http://groups.drupal.org/high-performance

• Drupal Handbook http://drupal.org/node/326504

• Drupal Modules http://drupal.org/project/modules?filters=tid:123

Page 163: Why Drupal Is So Slow
Page 164: Why Drupal Is So Slow

Use real data!

Page 165: Why Drupal Is So Slow

Verander een ding ter gelijke tijd

Page 166: Why Drupal Is So Slow

Sluit niets uit, Denk buiten de doos!

Page 167: Why Drupal Is So Slow

Geen twee trajecten zijn het zelfde!

Page 168: Why Drupal Is So Slow

Verleidelijk om op laureren te rusten als is opgelost...... maar het is nooit opgelost

Page 169: Why Drupal Is So Slow

• ab / jmeter

• develop module

• Yslow

• PHP logging

• MyTop

• Explain

• BRAIN

Page 171: Why Drupal Is So Slow