Drupal, along with Joomla, is one of the heavyweights in the CMS realm today. It is feature-filled, robust, and customizable with tons of user-created modules that enhance and add functionality to it.
It is also, however, subject to that CMS problem that plagues every sysadmin: Speed. CMSs like Drupal suffer from being complex pieces of software; the number of functions and queries the system uses is far greater, naturally, than a straight HTML page or a simple PHP site. As a result, the performance may suffer, especially when running on a VPS or shared hosting and responding to many hits per day. Unfortunately, not everyone who runs Drupal can afford to simply upgrade the hardware every time their Drupal install starts to slow down: for many sysadmins, scaling out reaches that critical point where they need the traffic but don’t quite have the resources to bump up the hardware their web servers reside on. Recognizing that need, here are some simple tips to get Drupal running quite a bit quicker on your system!
1. Use MySQL Instead of PostgreSQL
I’m sorry to all the Postgres fans out there, but the hype about MySQL’s speed is true (at least in this case). Using MySQL with MyISAM tables, performance against PostgreSQL is measurably faster: it can shave tens of milliseconds off your page load time, which can be crucial when a site is under heavy load.
I know there is the Postgres contingent out there that will come back at me with all sorts of reasons why Postgres is better than MySQL, and they may be right, but the fact of the matter is that when it comes to wringing out every last bit of speed from Drupal, MySQL’s your database of choice.
2. Disable/Remove Modules You Don’t Need
Drupal is a wonderfully customizable CMS, but that “customizability” can come at a price: a ton of third-party modules can seriously bog down your system, especially if they are shoddily written or don’t scale out well. Every now and then, go through your module list and check out what modules you have enabled; chances are, you’ve got more enabled than you really use and you’re wasting precious system resources for a module you downloaded and forgot.
3. Enable Drupal’s Cache
Drupal has a really friendly cache system that you can enable right from the administration screen. Enabling both page cache and block cache will speed up your site considerably!
Drupal also has options for aggressive caching. This will eke out all the performance possible from your Drupal site, but at the cost of compatibility: many modules aren’t compatible with aggressive caching, and Drupal kindly informs you about them if you try and enable aggressive caching. For those needing the speed, enable it, but don’t say I didn’t warn you: any bugs or instability afterwards is probably a symptom of a module not playing well with aggressive caching.
4. Use a PHP Accelerator (APC or eAccelerator)
This entry is maybe a cheat, as it’s not Drupal-specific, but it’s worth to mention all the same. PHP op-code accelerators, such as eAccelerator and APC, are vital for a busy Drupal site. In some cases, you can almost double or triple the amount of requests your Drupal site can handle by implementing an op-code accelerator.
In practice, all of the accelerators are more or less the same: APC tends to be the fastest, but not by much, and so I recommend you go with whatever accelerator you’re most comfortable with. Installing one is key to handling more load on a Drupal server, and if you’re watching your load averages inch up I highly recommend getting one of these in as soon as possible!
5. Enable Bandwidth Optimization
So there you have it – 5 tips to speed up your Drupal install! None of them are, by themselves, a silver bullet for speed problems; however, if you combine all five tips, it’s very likely you’ll see a great deal more speed and performance roaring out of your Drupal box, a blessing for any beleaguered sysadmin who doesn’t have the funds to throw more hardware at the problem!
Help us spread the word!
If you liked this article, consider enrolling in one of these related courses:
|Jun 22-23||Drupal Site Building|
|Jun 29-30||Drupal Module Development|
|Jul 01-02||Drupal for Beginners|
|- Classroom - Online|