Optimizing Drupal Performance. Benchmark Results



Similar documents
The importance of Drupal Cache. Luis F. Ribeiro Ci&T Inc. 2013

Performance for Site Builders

Drupal Performance Tuning


Trainer name is P. Ranjan Raja. He is honour of and he has 8 years of experience in real time programming.

Content Management Software Drupal : Open Source Software to create library website

Building Library Website using Drupal

MAGENTO HOSTING Progressive Server Performance Improvements

Open Source Content Management System for content development: a comparative study

Drupal and Search Engine Optimization

Simple Tips to Improve Drupal Performance: No Coding Required. By Erik Webb, Senior Technical Consultant, Acquia

Using your Drupal Website Book 1 - Drupal Basics

A Close Look at Drupal 7

Ensuring scalability and performance with Drupal as your audience grows

A Practical Guide to Data Caching with Zend Server

Zend Server 4.0 Beta 2 Release Announcement What s new in Zend Server 4.0 Beta 2 Updates and Improvements Resolved Issues Installation Issues

Content Management Systems: Drupal Vs Jahia

HOW TO BUILD A VMWARE APPLIANCE: A CASE STUDY

Software Development & Education Center PHP 5

Drupal. open source^ community experience distilled. 7 Business Solutions. Build powerful website features for your business. Trevor James.

Site Audit ( /site_audit) Generated on Fri, 22 Aug :14:

Drupal.

The truth about Drupal

by

Faichi Solutions. The Changing Face of Drupal with Drupal 8

CentOS Linux 5.2 and Apache 2.2 vs. Microsoft Windows Web Server 2008 and IIS 7.0 when Serving Static and PHP Content

MAKE YOUR WEB PRESENCE FELT WITH MOVABLE TYPE. WE MAKE IT SIMPLE TO CREATE AND EASY TO MANAGE YOUR CONTENT. Six Apart Movable Type

Drupal Flyover (There s a Module for That) Emma Jane Hogbin Author, Drupal User's Guide

E-commerce is also about

Bring your intranet to the IBM i With Drupal and Zend Server

BUILDING MULTILINGUAL WEBSITES WITH DRUPAL 7

(An) Optimal Drupal 7 Module Configuration for Site Performance JOE PRICE

Zend Server 5.x Reference Manual

GETTING STARTED WITH DRUPAL. by Stephen Cross

Administering Jive for Outlook

Question 3. Do you have a list of modules in use?

Acquia Introduction December 9th, 2009

BUILDING WEB JOURNAL DIRECTORY AND ITS ARTICLES WITH DRUPAL

Drupal 6 to Drupal 7 Migration Worksheet

The easy way to a nice looking website design. By a total non-designer (Me!)

Additional information >>> HERE <<< Online Book Premium WordPress Plugin Developer - Plugin Dynamo

Graphviz Website Installation, Administration and Maintenance

The Devil is in the Details. How to Optimize Magento Hosting to Increase Online Sales

9 Tried and Tested Tips to Increase the Power of your Magento Store

Bubble Full Page Cache for Magento

making drupal run fast

LEARNING DRUPAL. Instructor : Joshua Owusu-Ansah Company : e4solutions Com. Ltd.

Choosing a Content Management System (CMS)

PHP web serving study Performance report

4x High Performance for Drupal. Presented by Fabian Franz. Step by Step

Content Management Systems: Drupal Vs Jahia

INTRO TO DRUPAL. February 23, 2013

VIVO Dashboard A Drupal-based tool for harvesting and executing sophisticated queries against data from a VIVO instance

TIBCO Spotfire Web Player 6.0. Installation and Configuration Manual

How We Did It. Unique data model abstraction layer to integrate, but de-couple EHR data from patient website design.

Xtreeme Search Engine Studio Help Xtreeme

Magento & Zend Benchmarks Version 1.2, 1.3 (with & without Flat Catalogs)

COURSE CONTENT FOR WINTER TRAINING ON Web Development using PHP & MySql

Index. AdWords, 182 AJAX Cart, 129 Attribution, 174

a paradigm for reusable drupal features Ian Ward Robert Soden

A 100k Users.. Now What?

State of Drupal Hungary Dries Buytaert

Are You Ready for the Holiday Rush?

Table of Contents. Open-Xchange Authentication & Session Handling. 1.Introduction...3

Bubble Full Page Cache for Magento

There are numerous ways to access monitors:

Oracle9i Application Server: Options for Running Active Server Pages. An Oracle White Paper July 2001

Performance White Paper

Leveraging WebSphere Commerce for Search Engine Optimization (SEO)

Content Management System

Front-End Performance Testing and Optimization

<Insert Picture Here> Oracle Application Express 4.0

Drupal 8 The site builder's release

by Wolfgang Ziegler (fago) and Klaus Purer (klausi) DrupalCon Paris 2009 Rules Leveraging rule based automation!

A (Web) Face for Radio. NPR and Drupal7 David Moore

multiple placeholders bound to one definition, 158 page approval not match author/editor rights, 157 problems with, 156 troubleshooting,

PHP on IBM i: What s New with Zend Server 5 for IBM i

WebSphere Commerce V7 Feature Pack 5

Drupal and the Media Industry. Stéphane Corlosquet EMWRT IX, Sept 2013, Amsterdam

MAGENTO Migration Tools

Web Portal Installation Guide 5.0

PES. TWiki at CERN Service Evolution. Platform & Engineering Services. Terje Andersen, Peter Jones for IT-PES-IS Jan 2014

Additional information >>> HERE <<< Online Book Premium WordPress Plugin Developer - Plugin Dynamo

1 open source' I community experience distilled. Piwik Web Analytics Essentials. Stephan A. Miller

What is Drupal, exactly?

WEB DEVELOPER S GUIDE TO THE DHTS ENVIRONMENT

PrintShop Mail Web. Release Notes

owncloud Architecture Overview

Accelerating and Simplifying Apache

CA Performance Center

Bring your intranet to the IBM i With Drupal and Zend Server

Build it with Drupal 8

Fluke Networks NetFlow Tracker

CMS and Internet Marketing

SEO Suite Pro. User Guide

SERENA SOFTWARE Authors: Bill Weingarz, Pete Dohner, Kartik Raghavan, Amitav Chakravartty

Baidu: Webmaster Tools Overview and Guidelines

Digital Downloads Pro

Testing Automation for Distributed Applications By Isabel Drost-Fromm, Software Engineer, Elastic

Document Freedom Workshop DFW 2012: CMS, Moodle and Web Publishing

Transcription:

Benchmark Results February 2010

Table of Contents Overview 3 Test Environment 3 Results Summary 4 Configurations and Test Details 8 Bytecode Caching 12 Improving Drupal Code with Partial Caching 13 Full Page Caching 14 Super-fast Full Page Caching 15 Performance Optimizations Not Tested 16 About Zend 17 About Acquia 17 2

Overview This paper presents the results of performance benchmarks for comparing several common PHP runtime environments and configurations. The application used for benchmarking is Drupal, the open source social publishing platform. Tested runtime environments included plain PHP, Zend (www.zend.com/products/server), and opensource optimizers, such as APC and WinCache. For the purpose of this benchmark, a simple Drupal-based website was set up and tested in various commonly used Windows and Linux configurations. Test Environment The tests were run on dual 2GHz AMD machines (3988.97 bogomips) with 2GB of memory. Linux Setup For testing performance on Linux, Fedora Linux 11 running Apache version 2.2.11 was used with the following configuration: Starts 50 MinSpares 50 MaxSpares 100 Limit 256 MaxClients 256 The following versions were used: PHP version 5.2.10 (from the Zend installation) APC version 3.1.3p1 WinCache version 1.0.1012.0 Windows Setup For testing performance on Windows, Windows 2008 R2 Enterprise running IIS was used. As in the Linux test, PHP version 5.2.10 (from the Zend installation) was used. Test Setup The test load was generated by 2 client machines running wcat over 1GB Ethernet, and simulating 25 client sessions each (50 parallel connections overall). The test was performed with a 3-minute warm-up (no data collection), a 3-minute duration (data is collected) and a 1-minute cooldown. A test workload script was used to ensure the results were uniform for different Drupal parts. 3

Script URLs: /drupal/ (home page) /drupal/?q=content/hello-blog-entry (blog entry with 2 comments) /drupal/?q=node/1 (top node) /drupal/?q=node/2 (child node) /drupal/?q=archive/200803 (archive containing links to above 3 nodes) /drupal/?q=comments/recent (showing 4 comments) All of the nodes/comments had about 1-1.5Kb of text. Another script for Drupal forum URLs was used: /drupal/?q=forum/1 /drupal/?q=content/forum-topic-1 /drupal/?q=content/forum-topic-2 These URLs gave results that were very close to those of running the first script. Therefore, they will not be addressed separately. Results Summary Performance improvements for the Drupal setup were tested using the following technologies: 1. Plain PHP 5.2.10 2. APC bytecode caching 3. APC bytecode caching + shared memory caching 4. Zend bytecode caching (Optimizer+) 5. Zend bytecode caching + shared memory/disk caching 6. Zend full-page caching Drupal was also tested with "Aggressive" and Normal caching settings. Aggressive caching yielded better performance results but because some Drupal modules were not compatible with it, both modes were tested. On Windows WinCache was used instead of APC due to the lack of a stable APC version for Windows. Since WinCache does not have a shared memory cache module, these tests were not performed on Windows. 4

Linux & Aggressive Caching The following results show the number of Requests Per Second (RPS) for each of the Linux configurations, with Drupal caching set to Aggressive. Note: The higher the number of requests, the better the performance. RPS %PHP %APC %Zend PHP 5.2.10 192 100% APC 629 328% 100% APC+shm 741 386% 118% Zend 706 368% 112% 100% Zend +shm 891 464% 142% 126% Zend +disk 855 445% 136% 121% Zend +page cache 988 515% 157% 140% 1200 1000 800 RPS 600 400 200 0 PHP 5.2.10 APC APC+ shm Zend Zend + shm Zend + Disk Zend + Page Cache 5

Linux & Normal Caching Following are the Linux test results with Drupal caching set to Normal. Here too, the higher the number of requests, the better the performance. RPS %PHP %APC %Zend PHP 5.2.10 126 100% APC 475 377% 100% APC+shm 534 424% 112% Zend 564 448% 119% 100% Zend +shm 647 513% 136% 115% Zend +disk 629 499% 132% 112% Zend +page cache 987 783% 208% 175% 1200 1000 800 RPS 600 400 200 0 PHP 5.2.10 APC APC+ shm Zend Zend + shm Zend + Disk Zend + Page Cache 6

Windows & Aggressive Caching Following are the results of the test conducted on Windows 2008 with Drupal caching set to Aggressive. RPS %PHP %WC %Zend PHP 5.2.10 159 100% WinCache 465 292% 100% Zend 512 322% 110% 100% Zend +shm 584 367% 126% 114% Zend +disk 545 343% 117% 106% Zend +page cache 624 392% 134% 122% 700 600 500 400 RPS 300 200 100 0 PHP 5.2.10 WinCache Zend Zend + shm Zend + Disk Zend + Page Cache 7

Windows & Normal Caching Following are the results of the test conducted on Windows 2008 with Drupal caching set to Normal. RPS %PHP %WC %Zend PHP 5.2.10 105 100% WinCache 323 308% 100% Zend 402 383% 124% 100% Zend +shm 442 421% 137% 110% Zend +disk 421 401% 130% 105% Zend +page cache 628 598% 194% 156% 700 600 500 400 RPS 300 200 100 0 PHP 5.2.10 WinCache Zend Zend + shm Zend + Disk Zend + Page Cache 8

Super-fast Page Caching Following are the results of a test conducted with Pressflow, which includes backported functionality from Drupal 7 that allows for faster full page caching (see a detailed explanation in the following section). The scenario has only been tested only on Linux. Using full page caching resulted in performance equivalent to that of static HTML an astounding 26(!) times faster than plain PHP. Linux %PHP %Zend PHP 171 Zend 758 443% Zend + page cache 4456 2605% 587% 5000 4500 4000 3500 3000 RPS 2500 2000 1500 1000 500 0 PHP Zend Zend + Page Cache 9

Configurations and Test Details The following is a detailed explanation of configurations and code changes that were done for each test. Plain PHP Setup The PHP settings used were mostly defaults with the following changes: realpath_cache_size=256k cgi.check_shebang_line=0 display_errors=0 realpath_cache_ttl=12000 Drupal Modules Drupal 6.13 was used with the following modules installed and enabled: Ajax, Ajax plugin comment, Ajax plugin - disable_redirect, Ajax plugin thickbox, Ajax plugin wysiwyg, Ajax ui, Content, Content Copy, Content Permissions, Fieldgroup, ImageField Tokens, Location CCK, Node Reference, Number, Option Widgets, Text, User Reference, Aggregator, Blog, Blog API, Book, Color, Comment, Contact, Forum, Help, Menu, OpenID, Path, Ping, Poll, Profile, Search, Statistics, Taxonomy, Tracker, Trigger, Update status, Block, Filter, Node, System, User, Nodequeue generate, Google Analytics API, ImageAPI, ImageAPI GD2, GMap, GMap Location, GMap Macro Builder, GMap Taxonomy Markers, Location, Location Add Another, Location Fax, Location Phone, Location Search, Node Locations, User Locations, Nodequeue, Smartqueue taxonomy, Advanced help, Automatic Nodetitles, Global Redirect, Integrated Metatags, Integrated Metatags - CCK, Meta tags, Moderation, Nice Menus, Page Title, Path redirect, Pathauto, Public Preview, Secure Pages, Taxonomy Manager, Token, Token actions, TokenSTARTER, Transliteration, Vocabulary Index, SEO Friend, Wysiwyg, Views, Views exporter, Views UI, XML sitemap, XML sitemap engines, XML sitemap node, XML sitemap taxonomy, XML sitemap user. Performance Settings The following settings were used for APC: apc.shm_size=80 apc.include_once_override=1 apc.lazy_classes=1 apc.lazy_functions=1 The following settings were used for WinCache: wincache.fcenabled=1 wincache.ocenabled=1 wincache.ocachesize=80 wincache.chkinterval=300 10

The following settings were used for Zend (Zend Optimizer+): zend_optimizerplus.revalidate_freq=300 zend_optimizerplus.memory_consumption=80 zend_optimizerplus.consistency_checks=0 zend_optimizerplus.fast_shutdown=1 The remaining settings were left at their default values. Zend modules that were not needed for particular tests were not used (e.g. Zend application monitoring was not activated). Drupal was modified to use a persistent MySQL connection (mysql_pconnect). This was done so as to avoid spending an excessive amount of time establishing connections to the database. The Drupal cache lifetime was set to 10 minutes. 11

Bytecode Caching APC (WinCache on Windows) and Zend bytecode caching were tested with 80MB of memory (sufficient to handle Drupal data). Tests showed that on Linux, Zend provided 3.7 times the performance improvement, compared to 3.3 times the improvement when using APC, i.e. Zend performed 12% better than APC. On Windows, Zend provided better performance in the same order of magnitude: Results with Drupal Aggressive caching (the higher the number, the better): Linux %PHP %APC Windows %PHP %APC PHP 192 159 APC/WC 629 328% 456 287% Zend 706 112% 112% 512 322% 112% Results with Drupal Normal caching (the higher the number, the better): Linux %PHP %APC Windows %PHP %APC PHP 126 105 APC/WC 534 424% 323 308% Zend 564 448% 106% 402 383% 124% Note that performance gains from caching were higher when Drupal was set to Normal caching. When this mode was used, parts of the page were cached, thus requiring a larger number of modules for forming the page on each request. This means that more files were being loaded from the disk, hence more time was saved through bytecode caching. This test did not require any changes to the code. 12

Improving Drupal Code with Partial Caching Our next objective was to modify the Drupal code to take advantage of the shared memory caching capability of both APC and Zend. Two files were changed; bootstrap.inc and cache.inc. This was done in order to change the DB-based Drupal cache into memory or a disk-based cache. The scenarios tested involved virtually only reads from the caches, as it is the most frequent mode of operation for the web site. There was only one request per cache expiry time per page that involved writing to the cache. An attempt was made to preserve the original semantics of the DB cache. However, thorough testing was not done to determine if the semantics of the code matched the semantics of the original Drupal code with regards to expire times, partial cleanups, etc. It is recommended to test the full set of scenarios before using such modifications in production. Only content-generation functionality was tested in this particular case. Testing was performed with bytecode caching enabled. On Windows, WinCache has no shared memory caching module so it was not tested. Following are the results yielded for Aggressive caching: Linux %PHP %APC %Zend PHP 192 159 Windows %PHP %Zend APC/WC 629 328% 456 287% Zend 706 368% 512 322% APC+shm 741 386% 118% Zend +disk 855 445% 121% 579 364% 113% Zend +shm 891 464% 126% 584 367% 114% Test results showed that the use of more efficient caching provided the expected performance gains: - 18% improvement for APC cache (3.9x overall) - 21% improvement for Zend disk cache (4.5x overall) - 26% improvement for Zend memory cache (4.6x overall) Here again, performance gains on Windows were slightly lower than on Linux, especially for a disk-related cache. It is assumed that this is due to a slower file system. 13

Following are the results yielded for Normal caching: PHP 126 105 APC/WC 475 377% 323 308% Zend 564 448% 402 383% APC+shm 534 424% 112% Zend +disk 629 499% 112% 442 421% 110% Zend +shm 647 513% 115% 421 401% 105% As expected, with Normal caching selected, performance gains from caching were lower, since multiple elements were cached separately, and more code was being executed. On Windows, since the file system is slower, disk cache appeared to provide the smallest performance improvement compared to the default Drupal DB cache. Full Page Caching To measure the impact of full page caching (available in the commercial version of Zend ), a scenario was created that caches non-authenticated access to Drupal, while leaving authenticated content uncached (since it might differ from one user to another). User and login pages were also excluded from caching, though they were not featured in the test scenario. The GET query string was chosen as the cache key, and expiry time was set to 30 seconds. The result showed an overall 5.1 times improvement compared to plain PHP and about a 40% improvement compared to using only bytecode caching: Linux %PHP %Zend PHP 192 159 Windows %PHP %Zend Zend 706 368% 512 322% Zend +page cache 988 515% 140% 624 392% 122% Improvements appeared to be more modest on Windows, probably because page cache uses disk as storage and the Windows file system is slower. The results of using page caching were very similar for Normal and Aggressive caching modes, since cached pages were delivered independently of Drupal caching mechanisms. 14

Super-fast Full Page Caching In the tested page caching scenario, a PHP session variable was used to check if the page can be cached. Unfortunately, this requires PHP to start up and for parts of the page to potentially execute until the session is started and its variables become available. Based on recommendation from Dries Buytaert, the original author of Drupal, additional tests were conducted with Pressflow (http://bit.ly/73acph) an API-compatible version of Drupal that includes performance backports from the yet-unreleased Drupal 7 (due to be released during 2010). One of the new features added to Pressflow is a COOKIE variable that can be used to determine whether the current page is being rendered for authenticated access or not. This allows for faster full page caching, completely eliminating any overhead associated with executing PHP for non-authenticated pages. The scenario has only been tested only on Linux. Linux %PHP %Zend PHP 171 Zend 758 443% Zend +page cache 4456 2605% 587% Effectively, using full page caching based on a GET variable results in performance equivalent to that of static HTML an astounding 26(!) times faster than plain PHP. While full page caching cannot always be applied, using it where possible can make a remarkable difference. If this approach is implemented, it is important to configure Zend so that it will not cache pages that include user-specific content. 15

Performance Optimizations Not Tested Memcached One of the best ways to improve caching performance, especially in clustered setups, is to use memcached. Performance gains of memcached will probably be lower than that of shared memory caching, but clustered setups can benefit more from it. Boost Boost is a Drupal module that provides static page caching through mod_rewrite and cron. Similarly to Zend s full page caching, Boost is useful only for pages accessed anonymously. In contrast to Zend, Boost does not retain custom HTTP headers that may be set by Drupal modules. Optimize DB Queries Drupal code uses the UTF-8 character set for a DB connection on every request. Proper configuration of the database, client, and table data may eliminate such need and thus reduce DB access time. Optimize Variables Currently, Drupal variables are being read and written as one block, which can mean slowdown if this is done more than once. With proper individual caching this can be optimized, though the impact of this optimization is not certain. CAPTCHA Captcha modules have a very significant performance penalty because they involve time-consuming image generation upon every request, and are not cached. This problem may be addressed by using partial page caching, by pre-generating images, or by using services like recaptcha or solutions like Anti-Captcha. 16

About Acquia Acquia helps organizations of all sizes build social publishing websites quickly, easily and with a lower total cost of ownership by leveraging Drupal, the open source social publishing platform that blends content and community. Our products, services and support enable companies to leverage the power, technical innovation and economic value of Drupal while simplifying the experience, removing the complexity and minimizing the risk. Please visit http:// www.acquia.com and download Acquia Drupal, the completely free Drupal distribution, at http://acquia.com/ downloads. About Zend Technologies Zend Technologies, Inc., the PHP Company, is the leading provider of products and services for developing, deploying, and managing business-critical PHP applications. PHP runs 35 percent of the world s Web sites and has quickly become the most popular language for building dynamic Web applications. Deployed at more than 30,000 companies worldwide, the Zend family of products is a comprehensive platform for supporting the entire lifecycle of PHP applications. Zend is headquartered in Cupertino, California. Zend is a registered trademark of Zend Technologies, Ltd. Acquia is a registered trademark of Acquia, Inc. All other trademarks are the property of their respective owners. 17