Increasing Drupal Performance by 265% in 10 Minutes

in

PHPInstalling a PHP accelerator can be an easy and effective way to speed up your applications.

PHP is a scripting language, meaning your code must be parsed, compiled on-the-fly, and finally executed for every page request. It's not difficult to see how this approach is less-than-optimal.

A PHP accelerator (or opcode cache) like APC works by keeping that compiled code in memory. The result can be a boost in performance anywhere from 2 to 7 times.

I installed APC on my Ubuntu 1.8GHz VPS with 1GB of memory from VPS.NET with a few short commands:

aptitude install php-pear
aptitude install php5-dev
aptitude install apache2-dev
pecl install apc
echo "extension=apc.so" > /etc/php5/apache2/conf.d/apc.ini
/etc/init.d/apache2 restart

I ran Apache benchmark before and after to get an idea of the gains. With 10 concurrent users requesting 100 pages each, my page loads jumped from 23 to 86 per second. 265% faster. Not bad for the default configuration!

Comments

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account associated with the e-mail address you provide, it will be used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Twitter-style @usersnames are linked to their Twitter account pages.
  • Twitter-style #hashtags are linked to search.twitter.com.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.