Boost your Wordpress blog performance with CDN Rewrites plugin

Finally a nice plugin has been released called CDN Rewrites. It does rewrite static content URL to custom URL. This does allow you to use remote Content Delivery Network (CDN) to distribute static content much faster (the cache edge nodes are much closer to the end user) and increase your site performance.

This plugin works with thrid party caching plugins (wp super cache for example) and does it what it has to do – rewrites images, style sheet files, javascript files and any other static file URLs to the content delivery network url – for example: http://static.yoursite.com or even http://static.contentdeliverynetworkcompany.com

Comments

Nginx worker_processes configuration and recommendations

From the many posts around the Internet and our own experience worker_processes value is recommended to be set to the number of cores your server has.
For example, if you have two dual core CPU you should set worker_processes 4;

Original worker_processes help from Nginx page:

worker_processes 4;

nginx has the ability to use more than one worker process for several reasons:

1. to use SMP
2. to decrease latency when workers blockend on disk I/O
3. to limit number of connections per process when select()/poll() is used

The worker_processes and worker_connections from the event sections allows you to calculate maxclients value:

max_clients = worker_processes * worker_connections

Comments

Increase your wordpress performance with W3 Total Cache plugin

We have been using memcached for quite long time with a very great success. It’s fast, it’s quite easy to use and incorporate in existing code. Furthermore, it’s totally free. Memcached caches value/key pair in RAM, thus giving fast access to it when you require.

Now, if you want to boost performance of your Wordpress blog it’s quite easy – get a W3-total-cache plugin, configure it and you are set (remember, you will need a memcached server running otherwise you can’t use memcached “storage” from W3-total-cache plugin).

In our tests it boosted our Wordpress blog performance from 20-200% depending on different scenarios. Very nice plugin and it’s quite easy to set-up. Get it now.

Comments

Installing high-performance Nginx for first time

I have been somewhat lazy nowadays (hey it’s a summer!), but I thought I need to post a quick guide about installing high performance Nginx daemon. It’s a super fast web serving daemon that is the best choice for static content serving at very high speeds. It requires small hardware resources and places very small load on the hardware.

Download the latest stable version 0.7.61 or fetch a newer version from nginx.net.

Installing nginx:
(depending on the required modules, I prefer to disable all modules that are not needed, for example if you do not wish to host SSL pages, don’t enable SSL and so on).

tar zxvf nginx-0.7.61.tar.gz
cd nginx-0.7.61
./configure

(you can also specify –prefix value if you wish to install nginx in a different folder)

Now you will need to configure nginx.conf file before firing up Nginx daemon.

For better security run Nginx under a non-privileged user:

user nobody;

For medium to high load sites I suggest increasing worker_processes to 5 to 15, or even more if your hardware allows it.

worker_processes 10;

To increase max allowed clients that can access your site increase worker_connections. A good value for start is 256 and higher if you have a more powerful hardware.

events {
worker_connections 512;
}

Please note! If you run a Nginx in reverse proxy configuration you will need to divide this value by 4 because two connections will be opened to client and two to the back-end. If you have worker_processes set to 10 and worker_connections set to 256, then max clients that can access your site will be worker_processes * worker_connections / 2, thus 10 * 512 / 2 becomes 2560 connections.

Now in http {} section you will need to define some settings like mime.types, default_type, log_format, access_log, sendfile, tcp_nopush, keepalive_timeout. That’s pretty self explaining. Just a quick note: Nginx requires very low hardware requirements for keeping keepalive connections active and it’s well know to take less than 30Mb of RAM for 10000 active keepalive connections. Make sure you have correctly calculated max client settings using the formulas above.

Now comes the server {} section were you define Listen to address, ports and custom settings, like redirects etc.

Example:

server {
listen      10.10.10.10:80;
server_name  localhost;

access_log  logs/host.access.log  main;

location / {
root   html;
index  index.html index.htm;
}

error_page  404              /404.html;

error_page   500 502 503 504  /50x.html;
location = /50x.html {
root   html;
}

10.10.10.10 IP is just an example, you will need to specify your allocated server IP.

I hope this quick guide helped you out a little. We will soon publish more in-depth guide about configuring Nginx.

Comments (2)

Monitoring your Linux server load

You can easily monitor your Linux server load using built-in bash commands like

w

free

top

However, many folks prefer sysstat package (can be downloaded here, or from your Linux distribution site) package that provides even further performance monitoring utilities:

iostat

sar

vmstat

——

Login into your Linux server shell and execute the above commands. iostat, sar, vmstat can be run like

vmstat 1 10

where 1 is the time between monitoring load, 10 is the count  how many times the data need to be read.

Comments

Linux server management and tuning services

Many of our blog readers ask if we offer tuning services and support remote server management. At this time we do not offer server management services and we do not offer blog tuning either. However, from time to time we work with a nice company called LinuxAdmin guys and they do high-load and critical blog set-up,  configuration,  load balancing, management and of course full optimization. So if you are looking for a quality and very affordable remote server management or Wordpress blog hosting and management company – contact LinuxAdmin and I am sure you guys can work something out.

Comments (3)

Digg effect vs Yahoo front page listing

Many website owners are dreaming about hundreds of thousands of web visitors and thousands in ad profits, but will your web site handle the load and keep up the file serving? Probably not.

Digg frontpage listing usually sends 120.000  to 170.000 web visitors in two to three hours. It depends for how long you are listed on Digg’s frontpage and what is the topic.  In over 95% of cases this will probably be too much for simple dedicated server – if you are hosting Wordpress blog with some plugins activated (that require some extra load) and without tuning the server box.

You can activate some caching plugins (wp-cache, wp-super-cache, 1blogcacher), configure more efficient content distribution (for example, use lightweight web daemon to serve static files), use less includes and optimize plugin code for performance. This will probably handle the Digg frontpage load.

What if you land Yahoo! frontpage listing? This will be a real challenge for your systems and system administrator. Yahoo! is very popular and if your site gets listed in frontpage they can easily “send you” a few million of web visitors. Once again, depends for how long the listing will stay on the front page. Yahoo! traffic burst will definitely make your web server unreachable and I am saying this with 99.9999% confidence. You need multiple servers to handle  the load and do load balancing, and of course have upstream bandwidth available to serve the content. You need to employ perfect caching architecture, preferable keeping the page 100% static and load it in the server memory for super fast serving to web visitors. If you read it from the hard drive – your servers will experience very high IO and load, thus slowing down web responses.

Last time when one of our client’s got listed on Yahoo! frontpage the site (actually a blog) got around ~900.000 unique visitor landings, over 200.000 visitors browsed site further reading other articles and comments.  The traffic burst from two web front-end servers serving the content was close to 195Mbps (2 x 100Mbps links were fully maxed out) and I am talking about serving HTML/PHP content, not the images from these servers.

This is why you need to plan architecture to be scalable (horizontally) and easily affordable. One server box will not make it even if you get top-notch mega box for 20k USD, period.

Comments (2)

Wordpress caching plugin – 1 Blog Cacher

Ok folks, I have some great news for you – we just spot a promising wordpress caching plugin named 1 Blog Cacher.  From the list of features it looks very awesome including the file and directory structure emulation, thus you can easily remove cached directories or file cache that you require. This is a nice feature if you are using  scripts  (e.g. you want to wipe out all cache files for /2006/ directory).

Expire header option is also a very nice feature – you have full control when to expire the cache.

I am sure we will use this plugin for some in-house tests and then use it on some high load blogs we manage for our clientele. We will keep you posted!

Comments

Free live migration hypervisor based on XEN

In a previous post server virtualization vs dedicated server we discussed about increasing availability using virtual servers – hypervisors that offer Live migration in case of one virtual server failure.

Citrix has released free XenServer product that includes Live Migration feature free of charge. Very good news for low budget and small sites that require high-availability at no cost. You just need two hypervisor servers and configure Live Migration feature and you have high-availability. Check it out it’s free and you can download it straight away for in-house testing.

Comments

Server virtualization vs dedicated server

I would still love to see virtualized server in a high bandwidth environment hosting a large site with thousands of concurrent connections. I guess there is not much use for very large sites to use virtualization unless it provides advanced features like:

  • live migration
  • fail-over
  • snapshots
  • load balancing

However, virtualization software with the above features usually cost thousands of dollars and it’s out of reach for many folks that need to make some bucks from own sites and still survive occasional Digg or Yahoo frontpage landings. Dedicated servers offer 100% performance and doesn’t have any overhead… unless of course you run many servers and want to consolidate hardware.

If you have a small site or site that doesn’t generate normal income don’t worry about virtualization and high-availability ;) You can still do high-availability without virtualization. For much less, err…. almost for free – you just need to pay for the hardware and someone to set-up and run the server farm for you.

Comments