Optimizing Your Wordpress Site
My colleague wrote an excellent article the other week on making your web sites load faster by leveraging the Rackspace Cloud Files & CDN platform to serve all static content on your site. I want to take this a step further for those of you who leverage the Wordpress platform which is one of the most popular open-source web applications in existence.
In the Wordpress community there are countless plugins that can be used for optimization, so how do you know which ones to use? Well I’m about to tell you and save you many hours or days of searching and experimenting.
The first plugin I want to mention is already one of the most popular – Wordpress Super Cache. This tool generates static HTML files from your dynamic pages produced by WP. Once the HTML version of the page is generated your hosting platform will serve this in place of the dynamic PHP pages which causes increased server load and longer page load times. The vast majority of your visitors will be served static content by default but WP Super Cache knows to switch back to the standard PHP pages for users who are leaving comments (or have left a comment), users that are logged in, and users who are reading a password protected blog post.
What does this do for you exactly? There are two significant benefits:
- Reduced server resource utilization: Having your web server serve static content instead of dynamic content decreases CPU and memory utilization significantly and result in smaller hardware/resource requirements or allow your current hardware to handle many more concurrent connections to your site(s). On platforms such as Cloud Sites from the Rackspace Cloud this will have a large impact on your compute cycle usage.
- Decreased page load times: Decreasing page load times makes for a better end-user experience on your web site and is shown to reduce bounce and improve overall stickiness on your pages.
Installation
- Download WP Super Cache here
- Upload to your Wordpress /wp-content/plugins/ directory
- Modify the /wp-content/wp-cache-config.php file: Uncomment “$use_flock = true;” (if using Rackspace Cloud Sites)
- Login to your Wordpress admin console and navigate to ‘Plugins’
- Activate the WP Super Cache plugin
- Before turning on WP Super Cache you MUST enable permalinks (Settings –> Permalinks)
- Navigate to Settings –> WP Super Cache
- Set WP Super Cache status to ‘On’
- Make sure that “Super Cache Compression” is set to “Disabled”
- Leave all other options default unless you know specifically how this will affect your site
- Click ‘Update Status’
- Scroll down and copy the updated mod_rewrite rules
- Paste these new rules into the .htaccess file within your Wordpress root directory
- Depending on how your permissions are set there is a button you can click which may be able to do this automatically for you
- Done!
- To verify that WP Super Cache is working properly visit your site directly (you may need to logout depending on your settings. Pull up a page/post and use your web browsers ‘View Source’ feature. Scroll to the bottom of the page and you should be something like this:
<!-- Dynamic page generated in 0.380 seconds. --> <!-- Cached page generated by WP-Super-Cache on 2010-02-16 17:36:22 --> <!-- super cache -->
You are all set and now your Wordpress site can handle much more traffic and operate much more efficiently.
The next plugin I want to talk about also has a big impact on site performance and can further reduce server load. CDN Tools (developed by Paul Kehrer) is a plugin that allows you to load your sites javascript and media files to an external CDN platform such as Cloud Files from the Rackspace Cloud. Even if you don’t have or want to use the Cloud Files storage and CDN platform you can load your larger JS libraries (prototype and jquery) for free from Google’s servers.
If you are not familiar with platforms such as Cloud Files, what this allows for is global distribution of your static media files (images, video, documents, etc) over a Content Delivery Network or CDN. Cloud Files offers seamless integration with Limelight Network’s CDN platform that is the second largest in the world allowing your static data to be distributed across 50+ nodes around the globe. When a user from a specific geographic location requests one of the files you have cached on Limelight’s CDN, they are served this data from the closest possible data center to them, vastly reducing network latency which is critical for a global audience. Serving data from a single US data center may work great for a mainly North American audience, but when it comes to sending large files across the ocean, that is a different story entirely.
Some might ask why you would want to pay an additional cost to use a platform such as Cloud Files and this really just depends on your needs. If you have a small family blog it may not be necessary, but if you are running a popular site with a lot of static media typically the reduction in CPU/memory from your server or platform having to load this static content anyways more than makes up for the low CDN cost of $0.22/GB and the benefit of a much better end-user experience.
Installation
Installing CDN Tools is incredibility simple and only requires a few clicks after uploading.
- Download CDN Tools here
- Upload to your Wordpress /wp-content/plugins/ directory
- Login to your Wordpress admin console and navigate to ‘Plugins’
- Activate the CDN Tools plugin
- Navigate to Settings –> CDN Tools
- Enable ‘Use Google AJAX CDN’
- If you have a Cloud Files account choose Cloud Files from the ‘Primary CDN’ drop down menu
- Enter your Rackspace Cloud control panel username and account API key (located in the control panel at ‘Your Account à API Access’
- Save Changes
- Click ‘Load Files’ (this side loads all your static data to Cloud Files and moving forward it will do it automatically)
- Done!
Note: The developer for CDN Tools has carefully crafted this plugin allowing you to easily disable. If you ever need to turn off CDN Tools it will automatically update your file paths without you having to do anything manually. This is a big plus!
Optimizing Your Drupal Site
Drupal is a widely used open-source CMS platform that is becoming increasingly popular by the day. I have personally used Drupal on/off since v4 and have seen it mature over the years into my preferred content management system. Here at the Rackspace Cloud we speak to hundreds if not thousands of new customers and prospects every month that either want to migrate their existing Drupal sites into the Cloud or start fresh with Drupal.
Improving performance is always a concern with any site and after working with countless Drupal installs I have identified a few tools and options that can very quickly make a very noticeable difference in your sites performance. These tweaks are not specific to the Rackspace Cloud platforms and should be considered by any Drupal site admin on any hosting solution. They will not only improve the performance of your site but also reduce back-end resource utilization such as CPU and memory or lower compute cycles on Cloud Sites for example. This is achieved through various levels of static page caching and a highly optimized database. Let’s take a look at the options.
Before we look at any third party modules lets examine what Drupal has built-in that can help. Navigate to Administer –> Site Configuration –> Performance. This section allows users to enable/disable specific caching functions included in Drupal CORE. Here are my recommendations for a typical Drupal site:
- Caching Mode: Normal
- Page Compression: Enabled
- Block Cache: Enabled
- Optimize CSS Files: Enabled (use in production only, not during theme development or customization)
- Optimize JavaScript Files: Enabled (use in production only, not during theme development or customization)
Next I highly recommend setting up a cron job to run the Drupal cron.php file regularly, I typically run it once per day but it depends on your site (heavy traffic sites might want to run it more often). While this may not have a direct performance impact it is good general practice as executing this script performs many maintenance tasks including cleaning up old log files and checking for updates. Setting up a cron job is pretty simple and some hosting platforms such as Cloud Sites can make this a point/click configuration. Reference this page for more information on how Drupal uses cron and setup instructions.
Now, lets take a look at two third party modules that I have used for sometime that can have a dramatic impact on your site:
Boost
Boost provides static page caching for Drupal, similar to how WP Super Cache works for Wordpress. This module works extremely well if your site received mostly anonymous traffic. The developers make this module a breeze to set up and configure and I’ve tested it across many platforms including a dedicated Linux server, Rackspace Cloud Sites & Cloud Servers and even a few shared hosting platforms. Boost also includes partial support for Nginx, Lighthttpd and even IIS 7 (Apache is fully supported). Let’s walk-through the set up:
*Note, Boost requires cron and clean-URLs to be enabled FIRST*
- Download Boost here: http://drupal.org/project/boost
- Extract and upload to your Drupal /modules folder
- Navigate to Administer –> Site Building –> Modules
- Enable Boost
- Navigate to Administer –> Site Configuration –> Performance
- Notice the new options for ‘Boost’ on the top navigation menu, click Boost Settings
- Review and adjust any settings necessary (I generally stick to the defaults)
- Click ‘Boost htaccess rules generation’ in the top nav menu
- Copy the automatically generated htaccess rules and paste them in your htaccess file, see below:
# RewriteBase /
INSERT BOOST CODE HERE
#Rewrite URLs of the form ‘x’ to the form ‘index.php?q=x’
Boost should now be up and running. Be sure to check your Administer –> Reports –> Status Report page for any errors.
DB Maintenance
The DB Maintenance module optimizes administrator selected tables in your Drupal sites database during the regular cron.php executions. Keeping your database optimized is one of the easiest ways to ensure a smoothly operating site on any platform and is essential if you want to scale your site effectively for high traffic. Installation is fairly quick and easy:
- Download DB Maintenance here: http://drupal.org/node/41588
- Extract and upload to your Drupal /modules folder
- Navigate to Administer –> Site Building –> Modules
- Enable DB Maintenance
- Navigate to Administer –> Site Configuration –> DB Maintenance
- Select tables in the Drupal database that you wish to optimize during the regular cron execution and enable logging if you prefer
- Save and thats it!
It is suggested to keep your selections to tables where there is a lot of data movement such as accesslog, cache, sessions, and watchdog. You can always make a separate and more infrequent cron as part of your regular server management if you want/need to optimize your node tables.
CDN Integration
The final tip I’ll leave you with is one of the most important and that is serving your static content from a CDN platform. There are many options and one of the easiest and most cost effective to leverage is Cloud Files from the Rackspace Cloud, which has built in CDN integration from Limelight Networks. Off-loading your static content such as images, video, audio, documents, etc to a global content distribution network not only decreases even more load on your hosting platform but it makes site load times significantly faster by serving this content as close as geographically possible to your site visitors (local or close to local data centers).
Uploading content to Cloud Files and enabling CDN distribution takes only a few seconds and is the preferred method for embedding static content, especially large video and audio files. Currently there are a few Drupal modules in development that support Cloud Files and other storage/CDN platforms on varying degrees but none that I’m comfortable mentioning just yet. Once these mature it will only make using these platforms even easier.
Deploying these tips and modules should have a significant impact on your sites performance. There are countless other ways to further optimize your site in addition to this so don’t hesitate to explore other options as well. I hope this is helpful to new Drupal users and even seasoned noders alike.
If you found this article helpful or have anything to add please leave a comment below, I’d love the feedback!
P.S. Looks like I’m going to miss DrupalCon this year for the first time in a few years, I’ll be enjoying my Honeymoon instead. Too bad they moved it to late April. I’ll look forward to 2011!
The Rackspace Cloud Control Panel – Why It's Better
If you have been in the hosting business or simply hosting your own web sites for any length of time, you are probably familiar with the most popular commercial control panels on the market: Plesk, cPanel & Ensim. These control panels, while powerful in many respects often introduce more trouble than they are worth in the form of increased resource overhead, buggy implementations, cost, usability, etc.
The Rackspace Cloud has taken a different approach and decided to design and develop their own control panel in house from the beginning. Today, the Cloud control panel is an extremely powerful tool that is built specifically for the three product offerings from the Rackspace Cloud (Cloud Sites, Cloud Servers & Cloud Files). This control panel has many benefits over using a generic commercial CP, for example:
- Developed and built specifically for the Rackspace Cloud architecture
- Internal development means it can be more tightly integrated and we can be more nimble to customer feedback and feature requests
- Years of workflow improvements based on feedback
- Light and efficient
- Infrastructure runs separate from your Cloud environment so it does not utilize resources within your hosting platform and consequently cannot impact your sites performance/uptime
- Near real-time reporting on Cloud specific usage metrics (bandwidth, storage, compute cycles)
- Custom reseller functionality (Cloud Sites)
- Advanced built-in ticketing platform
- Web based file-manager utilities for Cloud Sites & Cloud Files
The Rackspace Cloud control panel offers different features for each product, so lets take a look at these individually.
Cloud Sites
- Quick view listing of all domains and sub-domains (searchable)
- 3 step linear process to add a new site (Linux or Windows)
- Near real-time reporting on bandwidth, compute cycles and storage
- Raw web server access logs
- Internal testing URL for each domain
- Multiple FTP user management
- Quick view for website features (email, databases, logs, advanced features)
- Domain Management (renewal, transfer, whois, nameservers)
- DNS Management (quickly add or change any custom DNS records needed)
- MX Record Management
- SPF Record Management
- SSL Certificate Management
- Email Management (free Rackspace Mail accounts with Cloud Sites)
- Spam Filtering & Handling Customization (per domain)
- Database Creation & Management (MySQL and MS SQL Server)
- TrueHybrid Technology Platform Management
- Scheduled Tasks & Cron Job Management
- Full Server-Side Paths
- Client/Reseller Management (Client List, Client Plans, Client Products, Client Messaging)
- Integrated file-manager offering FTP like functionality
View a video demonstration below:
Cloud Servers
- Quick view listing of all provisioned Cloud Servers (searchable)
- 1 step process to create a new Cloud Server
- Custom server names for easy server identification
- Near real-time reporting for bandwidth utilization
- Quick view for server information: current action, age, RAM, disk space, IP, data center, backups
- 1 step process to initiate a Cloud Server resize
- Web based AJAX console for logging into your server instances
- Soft & Hard Reboot Capabilities
- Rescue Mode (allows you to debug system issues that are preventing a server from booting to a usable state)
- Easy rebuild from a default OS image or backup server image
- Ability to reset server instance root password
- Delete server (stops your hourly billing at that exact time)
- DNS and Reverse DNS Record Management
- Backup Management (set schedule for daily/weekly backups and perform a variable backup on the spot)
- Server Diagnostics (server state, swap i/o and root i/o usage, server load, disk i/o and network i/o usage, CPU % utilization, CPU time, PING from multiple globals locations)
- API Access
View a video demonstration below:
Get the Flash Player to see this content.
Cloud Files
- Integrated file-manager for managing containers & uploading data
- 1 click CDN publish capability
- Ability to apply a custom CDN TTL per container (default is 24 hours)
- Metadata editor
- Multiple file upload capability
- API Access
View a video demonstration below:
Get the Flash Player to see this content.
General Features
- Quick view reporting upon login for each product
- Detailed reporting section for each product
- Billing Reports (overview, current invoice, billing history, billing settings)
- Account Contacts
- API Access
- Integrated Live Chat Support
- Developer Resources
- Cloud System Status
- Knowledge Base
- Customer Forums
- Support Ticketing
- Direct Support Phone Numbers
If you have any questions about any of the information listed don’t hesitate to ask me or head over to www.rackspacecloud.com and initiate a live chat (or simply give them a call).
[VIDEO] Installing JungleDisk Server Edition on Cloud Servers
Just a few weeks ago the JungleDisk team announced their entirely new product lineup including the highly anticipated server edition. For those unfamiliar, JungleDisk develops a custom backup application which can store your local system data in the Cloud on platforms like Rackspace Cloud Files or Amazon S3. It supports many advanced features such as block level updates, compression, de-duplication, AES-256 encryption and much more. There are three different editions available for a variety of use cases including: Personal Edition, Workgroup Edition & Server Edition. The pricing ranges anywhere from $2/month per user to $5/month per user or server depending on the edition plus storage fees ($0.15/GB on Rackspace Cloud Files).
I recorded a video tutorial showing the process of installing JungleDisk Server Edition on a Rackspace Cloud Server. Many customers ask about the best way to do file-level backups on Cloud Servers and now the answer is simple: JungleDisk Server Edition. This is a great supplement to the snapshot based image backups that are already available with the Cloud Servers platform.
Check out the video below and if you have any questions or want further information about JungleDisk, head over to their site at www.jungledisk.com. For more information on the Rackspace Cloud and Cloud Server, head over to www.rackspacecloud.com.
Get the Flash Player to see this content.
If you have any feedback or thoughts please leave a comment – thanks!





