Server side optimizations

Optimizing Apache, PHP, and MySQL is beyond the scope of this book, but if you are expecting large amounts of traffic or simply want to squeeze as much power as possible out of your existing server setup, then the topic is worth investigating.

Many webmasters have found that using lighttpd or nginx instead of Apache offers a performance boost. Also, tweaking the settings for MySQL and PHP may help you. If you need advice about how to do this, I would recommend contacting your web host.

Some tweaks are possible only on a VPS hosting plan or better. It is possible to run WordPress MU and BuddyPress on a shared hosting plan; however, if you find yourself hitting the limits of such a plan, the best option is to upgrade to a VPS. If you have difficulty on a smaller VPS plan (for example, 256MB RAM), again an upgrade may be the easiest fix. However, for plans bigger than that, you can most likely earn yourself some headroom by optimizing the server's setup.

Swapping from Apache to an alternative server type such as lighttpd or nginx is a good option for improving your dedicated server or VPS's performance. You should think carefully before changing your http server, and make the change only if you are familiar with the intricacies of running a server.

You can read more about the most popular alternatives to Apache here:

♦ Lighttpd: http://redmine.lighttpd.net

♦ Nginx: http://nginx.net

A good comparison of the two servers can be found at http://www.wikivs.com/wiki/ Lighttpd_vs_nginx.

While both the servers mentioned above have smaller footprints than Apache and should offer better performance, there are some issues you should be aware of.

Firstly, Apache often comes preconfigured on most servers, and it has most of the configuration options you would need set out of the box. Lighttpd and Nginx require more configuration, and it can be difficult for inexperienced system administrators to troubleshoot certain issues with the server's configuration.

Secondly, Lighttpd and Nginx do not use the . htaccess file. This means you will need to convert the mod_rewrite rules used by WordPress MU and bbPress to the format used by your server. For example, the Lighttpd rewrite rules for WordPress MU look like the following:

server.error-handler-4 04 = "/index.php" url.rewrite-once = (

"*V(.*/)?files/$" => "/index.php",

"*V(.*/)?files/(.*)" => "/wp-content/blogs.php?file=$2", "^(/wp-admin/.*)" => "$1",

"*/([_0-9a-zA-Z-]+/)?(wp-.*)" => "/$2",

"*/([_0-9a-zA-Z-]+/)?(.*\.php)$" => "/$2",

If your site is performing well, but you're nearing your bandwidth limit, check that your theme files are set up in such a way that images and CSS files are cached by the browser. Also, look at using gzip compression with Apache.

If you are interested in improving your web server's performance, you can find some good information at the following URLs:

http://www.serverwatch.com/tutorials/article.php/34 3 6 911

http://httpd.apache.org/docs/2-0/misc/perf-tuning.html

You can test your server's performance using JMeter available at http://jakarta. apache.org/jmeter/.

Was this article helpful?

0 0

Post a comment