Boost your discussion forum performance

A simple blog, like this one, isn’t going to experience significant performance gains from a CDN. Sure, the images are replicated on a few geographically advantageous locations but it doesn’t have that many images to begin with. I’m also taking advantage of CDN-supported html optimization and compression, which makes me feel better but the few bytes it saves isn’t going to wildly impress either.

Circumstances change quickly for more complex sites. The layout of a typical online forum, especially for sites with a lot of content, can result in slow-loading sites. Even with good user adoption page-per-visit statistics don’t improve for the majority of users due to site performance.

These suggestions are applied on my sites:

  • CDN – Initially limit to images, javascript, and css to a CDN. Online Forums are highly-interactive sites and some CDN services may impact proper operation. Reverse-Proxy CDNs are easiest to start with, but many applications include configuration options that can take advantage of the manual (but effective) services.
  • Libraries – JQuery, YUI, and Fontawesome are examples of common resources that can served from either your server or from a CDN that alreay hosts those resources. If you are already using a reverse-proxy CDN, there may be benefit in hosting these resources yourself and letting them propogate on your CDN. If you aren’t using a CDN, or a service that isn’t as fast, utilizing externally-hosted libraries may improve performance. Try it both ways.
  • Advertising Code – Responsive site designs isn’t helping in this area, but pay special attention to how you are serving ad code. Large blocks of javascript-based innvocation code may not be noticeable to most web users, but they may slow down the user experience. Single-line innvocation code solutions are preferred, but check them to ensure that they aren’t linking to external script code that is slower. One way to verify is to add the code and then check it using Google’s Pagespeed checker.
  • Hosts – All aspects of the host are important, but disk I/O is critical for online forums. Shared Hosts that run customers on high-performance disk arrays. Dedicated Hosts that offer options using SASS, SATA3, or SSD drives. I run my largest forum on a server with eight-core CPU and 32G of RAM, but it’s most significant benefit is SSD drives.
  • Pagespeed – Google’s pagespeed technology has come a long way and is obtainable both as a service and as a downloadable mod that can be run on your server. Some CDN providers integrate modpagespeed in their own infrastructures as well. If your server doesn’t have fast drives, or limited CPU threads, modpagespeed may overwhelm your server if installed with default settings. If you aren’t sure, consider trying the pagespeed service first.
  • OptCode Cache – Sometimes called PHP Accelerators. I’m still partial to xCache but there are other options. Many hosts provide their preferred option with their service, or will provide suggestions if your running your own server. Taking advantage of this option will reduce the processing overhead on your server. Most forum packages have particular settings that require enablement in order to fully utilize this benefit.
  • Switch from GD to ImageMagick – Most online forums allow it’s users to upload pictures as either attachments or to build picture galleries. ImageMagick can be utilized by most forum software packages and allows for better utilization of your server’s resources. As digital images continue to represent large pictures uploaded over faster connections, ImageMagick has become more of a necessity than a luxury. Later I’ll share my process for installing ImageMagick from source and compiling with PECL.
  • Limit Transitions – Javascript and/or Ajax features that create interactive user experiences are nice, but limit them to pull-down menus and other navigation necessities. CSS is better, but still it is best to limit transitions altogether in order to generate pages quicker. Computing devices have improved, but many mobile devices still stuggle with sites in this area. This blog currently uses a jQuery transition that is very nice, but shows the age of older computers.
  • Limit External Attachments – Inserted images on forum posts that are hosted elsewhere. It saves your disk storage requirements, but can slow your site down. An uploaded image would take up your server storage, but could be served from your CDN and optimized from your server settings. If your forum is new, disabling the means to externally-link images may be a worthwhile consideration if your file upload features are robust.
  • Minify HTML – Most web server configurations support GZIP compression, but the debate on limiting excessive code comments or spacing represents diverse opinions on their benefits versus the additional time and/or server utilization this topic may create. Personally, I think comments shouldn’t show to the user if they aren’t needed; and all unecessary spacing should be removed. One way to accomplish this is to go through your templates and remove these yourself. I’ve had success with Google’s ModPagespeed module. Alternatives have started to show, if you don’t like Google’s option.
  • Javascript Optimization – Minifying Javascript isn’t as challenging as it once was. The precarious thing happens when we are able to see our sites work without javascript, and realize how much overhead we are creating. Many external libraries are usually in minified form now, and common applications are starting to combine their necessary scripts. Pay special attention to add-ons or modifications that you choose to add your application, this is where most of the slow-down occurs in forums.
  • Security – Hosting your site on an shared service isn’t going to afford you the same level of control that you would have managing your own server. However, many sites running on dedicated servers (or cloud instances) are hacked as well for the same lack of attention given to security. A proper strategy will lead to lower server utilization and allow resources to provide a better user experience.
  • Linux – There are many flavors out there. At the time of this writing CentOS and Ubuntu Server appear to be the common distributions; but ultimately it comes down to what you prefer to learn. Your users will appreciate it.
  • Server RAM – Some forum applications are a bit intensive on this when they become large or have several add-ons. I tend to use a large amount, but improving forum performance can be as simple as ensuring that your site isn’t doing disk activity that could be minimized by adding more RAM. OptCode Caching will also affect this.

Addressing the issues above can usually be accomplished cost-effectively.

References:

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.