Drupal
High Availability
High Performance
Drupal
High Availability
High Performance
How to sleep without the
    server-crash-fear
High Availability
High Availability



• no „Single Point of Failure“
High Availability



• no „Single Point of Failure“
• Redundancy
High Performance
High Performance
• Response times
High Performance
• Response times
• Caching
High Performance
• Response times
• Caching
 • HTML
High Performance
• Response times
• Caching
 • HTML
 • Data (serialized)
High Performance
• Response times
• Caching
 • HTML
 • Data (serialized)
• Scalable
High Performance
• Response times
• Caching
 • HTML
 • Data (serialized)
• Scalable
 • adding easy and fast more
   servers
Scalable & Redundancy
    Server System
starting position
Goal

Varnish    Varnish
starting position
Two Webserver
Apache/PHP
Apache/PHP


• APC
Apache/PHP


• APC
 • precompiled
Apache/PHP


• APC
 • precompiled
 • keeps files in memory
nginx?
nginx?

• lightweight Webserver
nginx?

• lightweight Webserver
• Reverse Proxy
nginx?

• lightweight Webserver
• Reverse Proxy
• Loadbalander
nginx?

• lightweight Webserver
• Reverse Proxy
• Loadbalander
• can be faster
nginx?

• lightweight Webserver
• Reverse Proxy
• Loadbalander
• can be faster
• more knowledge needed
Two Webserver




 MySQL?
starting position
dedicated MySQL
second Webserver
How to Access?


     ?
Loadbalancer
Loadbalancer
Loadbalancer



• passes through request
Loadbalancer



• passes through request
 • „Man in the middle“
Loadbalancer
second Loadbalancer
second Loadbalancer




         files?
NFS




      NFS
NFS




            NFS
fallback?
GlusterFS
GlusterFS
GlusterFS

• Distributed Filesystem
GlusterFS

• Distributed Filesystem
 • multiple Server/Clients
GlusterFS

• Distributed Filesystem
 • multiple Server/Clients
• auto-heal
GlusterFS

• Distributed Filesystem
 • multiple Server/Clients
• auto-heal
• split-brain
GlusterFS

• Distributed Filesystem
 • multiple Server/Clients
• auto-heal
• split-brain
• Not so fast
GlusterFS
second GlusterFS
MySQL




fallback?
MySQL Master/Slave
MySQL Master/Slave

• Master
MySQL Master/Slave

• Master
 • WRITE
MySQL Master/Slave

• Master
 • WRITE
• Slave
MySQL Master/Slave

• Master
 • WRITE
• Slave
 • READ
MySQL Master/Slave

• Master
 • WRITE
• Slave
 • READ
• Hot Spare
MySQL Master/Slave

• Master
 • WRITE
• Slave
 • READ
• Hot Spare
 • Slave becomes Master
MySQL
MySQL
Memcache



     memcache?
memcache
memcache

• Replaces “_cache“ tables
memcache

• Replaces “_cache“ tables
• Key / Value Store
memcache

• Replaces “_cache“ tables
• Key / Value Store
• Fast
memcache

• Replaces “_cache“ tables
• Key / Value Store
• Fast
• Memory only
memcache

• Replaces “_cache“ tables
• Key / Value Store
• Fast
• Memory only
• own Server
Memcache
Varnish

Varnish      Varnish
Varnish
Varnish
• Reverse Proxy
Varnish
• Reverse Proxy
• Hates Cookies/Sessions
Varnish
• Reverse Proxy
• Hates Cookies/Sessions
• No SSL
Varnish
• Reverse Proxy
• Hates Cookies/Sessions
• No SSL
• Drupal 6
Varnish
• Reverse Proxy
• Hates Cookies/Sessions
• No SSL
• Drupal 6
 • Pressflow
Varnish
• Reverse Proxy
• Hates Cookies/Sessions
• No SSL
• Drupal 6
 • Pressflow
• Drupal 7/8
Varnish
• Reverse Proxy
• Hates Cookies/Sessions
• No SSL
• Drupal 6
 • Pressflow
• Drupal 7/8
 • in Core
tadaa!

Varnish     Varnish
Questions!

    Michael Schmid
michael@amazeelabs.com
      @schnitzel

Drupal High Availability High Performance 2012