Error message

Deprecated function: The each() function is deprecated. This message will be suppressed on further calls in menu_set_active_trail() (line 2405 of /var/www/html/includes/menu.inc).

02 Performance

  • Posted on: 9 February 2004
  • By: agittins

Slooowwww...
My current server is a Pentium200-MMX, with 128MB and little else. With about 4-second page loads in Drupal (my old hand-coded db-driven pages took less than 1sec) I figured I was probably looking at having to put a better CPU/Mobo in the server.

Drupal Caching
Turn it on. Simple as that. This only works for views by anonymous users though, so it did not help with the time it takes to build menus, load modules etc when I am logged in. It's still an important first-step however, and regardless of the other steps you take to improve performance, this one will still make a difference should you get slashdotted (heh... not that I'm much worried of that myself).

PHP Caching/Optimisers
Upgrading is not a good option right now though, so I dug around for some optimisations. There were a few pointers around, but the only one that seems likely to fit my situation was some form of caching mechanism. Note this is to cache the compiled php scripts, not the pages themselves.

The Players
There are several options around for this. Some popular ones seemed to be

Well, Turk's site seems to have disappeared, APC doesn't look like it's been touched in years (well, months - for 4.1.0 you have to use CVS), Afterburner looks similarly neglected and Zend... well, I've used it before and it seemed to work well, but I am concerned (perhaps needlessly) about the ability to run other extensions at the same time - regardless, it was time to try something new anyway.

If I've missed the mark in my impressions on any of these packages, by all means let me know. To some, rather than try flaming me, how about you release something this year? :-P

PHP-Accelerator has releases for current versions of php, and although they don't provide source (come on guys, don't say "maybe" - yay or nay) it seemed like as good an option as any.

Installing PHP-Accelerator
Really straight-forward. I'm using php-4.1.2, so I had to grab the phpa 4.1.0 release. It works fine so far. Only modifications required - in php.ini add the zend_extension line to load the module, and set my own path for the cache dir.

Results
Very nice indeed. Page loads have gone from a consistent 4 seconds down to about 2 seconds, give or take a second or so. Granted, this is still slow, but a 100% increase in performance is still a great result. I'm still looking at a CPU upgrade in the near term, but at least this should make things bearable until I can arrange some upgrade rotations.

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.