drupal and varnish reverse proxy
Post on 16-Apr-2017
4.903 Views
Preview:
TRANSCRIPT
Scalability is the new black
Scalability is a desirable property of a system, a network, or a process, which indicates its ability to either handle growing amounts of work in a graceful manner or to be enlarged.
What is scalability?
-Wikipedia
Pressflow
The performance aware and scalable fork of Drupal
Pressflow
ProsDrops support for old PHP versions ( < 5.2 )
Better session handling
Reverse Proxy support
More info: https://wiki.fourkitchens.com/display/PF/Comparison+-+Pressflow+versus+Drupal
Pressflow
ConsLess users => less feedback => more unpredictable behavior
Delay between corresponding prefflow forks and vanilla Drupal
Patch compatibility is not 100% guaranteed
Pressflow
Should I use Pressflow?Yesif you need the features of PF
Pressflow
Should I use Pressflow?Yesif you need the features of PF
Noif you are afraid of experimental and 3rd party code for the site
seixorP esreveR
What is it? Gate keeper / intermediary for incoming requests. Should be able to handle multiple backends with active load balancing. Can act as a caching frontend and a buffer for slow clients.
Reverse Proxies
Notable examplesApache 2 with modules
Squid most used proxy
Varnish mostly used with Drupal sites
Nginx http and proxy server in one
Varnish
ProsHighly recommended from most of the people within the Drupal community
Almost out of the box compatibility with Pressflow (and Drupal 7)
Surpassed only by nginx with a very small margin
Very helpful tools (varnishtop, varnishhist etc)
Varnish
ConsNot as widely used as squid (the defacto standard in proxies)
Configuration looks difficult at first
A little slower than nginx
Needs a backend
Varnish Installation
Debian based distributions# apt-get -t testing install varnish
Configure diffrent listening port for apache if they share the same environment
Configure Varnish to forward traffic to the Apache's server IP and Port
Pressflow Settings
Add the following lines to settings.php
$conf = array( 'reverse_proxy' => TRUE, 'reverse_proxy_addresses' => array( '10.0.0.1', // Reverse proxy host A '10.0.0.2', // Reverse proxy host B '10.0.0.3', // Reverse proxy host C [...] ), );
Enable Drupal's page cache in 'admin/settings/performance' Set the Caching Mode to External Set the Page Cache Maximum Age > 0
Varnish Optimizations
Optimize Apache with only PHP in mind
Static files should have expire headers for correct varnish cache life
Avoid non 2xx request status, like 3xx redirects.
Choose carefully the Minimum cache lifetime in Pressflow
backend default { .host = "
top related