It's been a bit over a year now since we switched Synotrip over to Drupal. The site is both:
- A travel information site, where users can add their own content such as reviews, photos and events.
- A place to find independent Chinese tour guides.
We originally decided to use an open-source CMS such as Drupal or Joomla or Wordpress to speed up development. After pissing around with Joomla for a couple weeks with no success, I found that Drupal has two incredibly powerful modules that would really be useful for us: Views and CCK. With these modules, one can do so much!
The way we built the site would take too long to explain due to all the modules and customizations we made. Instead, I'm going to focus on what we did to boost site performance. We've found performance issues to be a problem all along. I'm not sure if this is common with many Drupal sites, or only with sites that have a certain amount of traffic and/or installed modules. In this case, we're getting about 500,000 'hits' on the server each month and 350,000 page views. This includes traffic from people - both guests and logged-in users - as well as search engines. Some of the big modules we use:
- All those localization/internationalization/translation modules. (I'm not even sure how those work.)
- CCK
- Views
- Node Comment
- Date (For our events section.)
- Node Profile (To build our profiles with)
Here's How We Improved Performance
admin/settings/performance
The first, and simplest way to improve performance is to enable the performance-enhancing options on admin/settings/performance. (Administer --> Site Configuration --> Performance)
Boost
Boost is an amazing module that greatly enhanced speed for us for anonymous users (users that aren't logged-in). It takes dynamic pages and caches them as static HTML pages. This is an awesome module for any high-traffic site with many anonymous users.
Mem Cache
Memcache makes the site faster for users that are logged in. This module interfaces with some Memcache thing on the server to cache database queries.
DB Maintenance
Seems some Drupal tables get full of a whole bunch of data that isn't needed. This data should be automatically removed, but isn't. We had tables with gigs of data! DB Maintenance fixes this by optimizing tables on every cron run.
Use Fewer Modules
When I first set the site up, I just started installing any module, with no regard to performance issues. I didn't realize that could slow the site down so much. Later, we removed as many non-essential modules as possible.
Upgrade Modules
Now upgrades often come out for modules. I've made it a habit of upgrading most modules whenever time permits (once every 1 or 2 months). Why? There are often bugs with the modules that inhibit performance. The way the releases are recorded, somebody that isn't a programmer can't even understand if a new release may help performance or not. So, I just always install the upgraded versions for important modules.
SuperCron
SuperCron allows you to set the order in which cron tasks are run. This is useful if you have some cron tasks that are causing problems. In our case, we found the Simplenews module was causing cron to crash, meaning the other cron tasks weren't being run, which caused further problems.
Raw Hosting Power
We upgraded our hosting. We're now on a VPS with 1400MB of RAM. Does this help? I hope so.
Database and PHP Tweaks
I've had a couple people help me by making some changes to the database and PHP. This is over my head, so I'm not really sure what this means.
Robots.txt
Drupal's default robot.txt file disallows search engines from viewing some of these pages. On our site, Google crawls 7,000 pages per day - that's a lot, and by using Watchdog, we found it was accessing a lot of the localized pages for adding comments. We disallowed access to translated versions of these pages.
ImageAPI Optimize?
Haven't installed this yet, but ImageAPI Optimize says it will help optimize images to improve performance.
DB Tuner?
Haven't installed this yet either, but DB Tuner seems to include several functions that will help improve performance.
Comments
Pressflow version of Drupal core
Pressflow has some optimized SQL, uses pure php 5.x and has some tweaks for non-authenticated users. I've found incredible difference in speed between a plain vanilla Drupal and a Pressflow Drupal, suddenly I feel comfortable of recommending it for some of my freelance friends when submitting pitches for sites.
Paul K Egell-Johnsen