Growing your solution – Part 2

In the first part we looked at adding an additional server to your solution which took on the role of being a a dedicated database server.

More Web Servers – Adding a dedicated database server should free up resources from your web server, though depending on the amount of traffic you are getting you might find that the newly available resources are quickly used. At this point you should consider scaling your site sideways by adding additional web servers, before you do this there are some considerations you need to take into account;

  • Media files; any media files which can be uploaded via your website (product images, avatars etc) will need to be on all of the web servers, this can be done via a file share (normally NFS) from a server which the web servers can all see, in most occasions this can be from the database server as there is very little CPU and RAM overhead in presenting a file share.
  • Updates to your code; how easy is it going to be to update your code on multiple servers? Most people use a version control service such as Subversion or GIT to save them having to manually FTP files to and from multiple servers
  • Logs; if you have any sort of load balancing in place, especially ones which allow content to be cached then you will need to move away from generating traffic statistics from the local access logs, instead external tools such as Google Analyitcs should be used.
  • Once you have a plan in place for the considerations above you need to make a choice about how you are going to distribute your traffic between the web servers.

This is traditionally done via a load balancer, you have a few options here;

  • Server acting as a load balancer – while you can buy dedicated network appliances to distribute your traffic between your web servers there are open source solutions which can do this, these normally offer fault tolerance meaning that if for any reason one of your web servers stops responding then the load balancer will stop sending traffic for that machine.
  • Proxy / caching server – This is a server which sits in front of your web servers not only distributing traffic from but it also serves static content, normally from an in RAM cache. This content can range from images, JavaScript and CSS all the way to fully rendered pages. Alot of consideration will need to be taken when configuring a caching server as it may not be suitable for all code bases.

Both of the options above require additional dedicated hardware to sit in front of your web servers, normally sending traffic to a dedicated internal network. It is possible to do load balancing with nothing more than a few additional DNS records, this is called Round Robin DNS. While in most cases it will be fine it does not allow you to automatically take servers in and out of the load balancing, depending on local caching of DNS it could unevenly split traffic between machines.

In the next blog post we will look at securing your newly expanded solution.

This entry was posted in Managed Hosting. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>