Drupal Performance and Scalability
- Performance Matters
- Blazing Drupal Site Speeds
- Varnish In Depth
- Drupal Performance/Scalability
Why Performance Matters
How fast do your Web pages load? According to Google, which is still by far the leading search engine provider, page speed helps your rankings. If your pages are loading super fast, then you get an extra SEO boost for free! It also helps with the overall user experience. How many times have you clicked a link and watched the spinning wheel for upwards of five seconds? Often, if a site takes longer than that to come up, visitors are likely to leave. We live in a "microwave" mentality; we want results now.
See also: Performance & Scalability Case Study: Online Magazine
What can I do to speed up my Drupal site?
- Using Drupal's "normal" caching option will help some, but if your site is already doing so, what then? In Drupal 6, there is a distribution of the Drupal project called Pressflow. It’s a scalable version of the Drupal project that has some Drupal Core performance enhancements, and if you've set up your Drupal site correctly (putting all custom code and contributed code under your site’s directory), the migration from Drupal to Pressflow is relatively simple. However, where you’ll really see the improvement is when you run an external cache like Varnish in front of your Apache Web server. We have set up many Pressflow/Varnish configurations in which we’ve seen the requests per second go up from 130 (the average with Drupal's "normal" caching mode enabled) to somewhere in the range of 3,000 to 5,000 requests per second, depending on your server configuration.
- If you’re having problems with your page load speed, one of the questions you have to ask yourself is whether or not most of your traffic comes from anonymous or authenticated users. If most of your traffic is authenticated traffic, you’ll probably want to consider adding Memcache into the mix to cache your sessions, and whatever else you'd like to cache (see dgo.to/memcache). To run both Varnish and Memcache on the same server, you'll need a healthy amount of RAM (4GB minimum).
Varnish In Depth
When delivering content on the Web, speed is key. The faster your site can respond to user requests, the better the experience for users. And when a user’s experience is positive, he or she is more likely to spend a lot of time on your site, thereby increasing your organic search rankings.
Varnish is an “HTTP Accelerator”, a technology that hastens the delivery of a Web page requested from a browser. This “reverse proxy” strategy employs cached Web pages to serve close to 100,000 requests per second.
In the course of a user requested URL, Varnish interrupts the usual Drupal “bootstrap” (that is, the default chain of events that Drupal uses to load core, modules, and return content) to check to see if there is a cached entry for that URL. A cached entry is simply a full page of HTML markup saved as a string of text in the Drupal database. If Varnish finds an entry, then that saved HTML page gets returned to the browser and the Drupal bootstrap is allowed to halt its progress.
In the event that Varnish doesn’t have a page stored, Drupal completes the bootstrap and delivers the page, and Varnish saves the page as a new entry.
Where You Should Use Varnish
Anonymous page requests (i.e., page requests for end-users who are not logged into your site) most clearly benefit from this technology. All static assets, like pictures and the theme output, are returned immediately.
The reduced load on Apache, MySQL and CPU Processing is considerable; freeing up resources is the digital equivalent of “a penny saved is a penny earned.”
Why You Need an Expert to Implement Varnish
Anyone can install, enable, and configure Varnish. However, you might find that your site seems to be operating as it did before. The reason might be that not all Drupal implementations support the use of a reverse proxy cache natively.
Also, unlike the majority of Drupal modules, all Varnish installs require custom implementations. Certain exceptions may need to be considered when your site should not be cached.
As Expert Drupal Developers, we know the ins-and-outs of Varnish and server configurations. We have built servers from the ground up, tweaked Apache config files, and optimized Drupal’s cache settings. Profit from our experience and give your end-users a better experience by talking to our Varnish experts today!
Drupal Performance / Scalability Worth Noting
- Project Mercury - Project Mercury is an Amazon EC2 AMI that sets Pressflow and Varnish (among other things) up for you! If you have an Amazon EC2 account, you can search the community AMIs for "Mercury" and it will set this up.
- Pantheon - Pantheon is a company working on Project Mercury cloud implementation as a fully-hosted Drupal stack that is designed specifically for super high-performance Drupal sites. It is currently in beta.
The Bottom Line
Drupal Connect's experts at Drupal Performance can make your Web pages load lightning-fast! Feel free to contact us to have one of our experts consult with you on making your Drupal site perform better.





