Load balancing with Nginx

Load balancing, Nginx No Comments »

Are you looking forward to balance HTTP or HTTPS traffic to multiple back-end servers? Nginx is one of the best choices – it’s very lightweight, requires less resources and it’s completely free.

You need to compile the nginx (there are many resources and howto’s) and add the following lines to your nginx.conf file:

upstream webcluster {
server 10.10.10.1;
server 10.10.10.2
server 10.10.10.3;
}

location / {
proxy_pass http://webcluster;
break;
}

Where 10.10.10.1, 10.10.10.2, 10.10.10.3 are the back-end web servers located in internal network defined in upstream settings above. The location / specifies that all URLs should be balanced to back-end servers.

Many folks prefer to serve HTTPS traffic with nginx and then forward all requests via HTTP protocol to the back-end servers. The back-end servers should be located on a safe VLAN or internal network.

Squid cache for web front-end accelerator

Content delivery, Load balancing No Comments »

Squid is very good for putting it in the front of your current web servers, thus accelerating the content that doesn’t change that often. Depending on your web site configuration and hits, I suggest you go for 2GB or even 4GB of RAM for the squid(s) front-end accelerator servers. The best benefit is to have most of the cached content into the memory – this is the best and fastest method. IO is kinda slow and that is why you need a lot of memory.

A lot of folks have been doing this for years and squid has been reliable and fast enough for these needs. Install it on your server and see the performance raising immediately. You may also need to review nginx for proxying. Very good and fast daemon.

WP Theme
Entries RSS Comments RSS Log in