Matthew Cox Team : Web Development Tags : Web Development Umbraco

Using Umbraco in a load balanced environment

Matthew Cox Team : Web Development Tags : Web Development Umbraco

We all agree that Umbraco is a great platform for building content rich .net websites, but when it comes to building a serious website you need to start thinking about scalability. So the first question that comes to mind when you begin to consider scalability is “how easy is it to get an Umbraco site up and running in a load balanced environment?”.

Obviously, you start the same way you start load balancing any other site, you get a bunch of boxes and a load balancer. Then you get your centralised file store, be that a SAN or DFS etc. But then the real question becomes, how do you make sure that all the boxes are serving the same content? The SAN/DFS handles all the physical files, but what happens to website cache? Do we just update content and wait for the cache timeout on each box to slowly allow changes to trickle out? Thankfully no.

Umbraco has support baked into the main trunk for ensuring that updates are pushed out to all the servers in your cluster and setting it up couldn’t be easier. First, give all your sites unique hostnames, something like server1.umbracosite.com, server2.umbracosite.com etc. Next, select one box to be the admin box and simply block or disable access to /umbraco/ on all the other boxes. Then on your admin box edit the umbracosettings.config file in the /config directory. Locate the distributedCall section, set enable to “true” and add all your servers to the servers section.

    <distributedCall enable="true">
        <user>0</user>
        <servers>
            <server>server1.umbracosite.com</server>
            <server>server2.umbracosite.com</server>
        </servers>
    </distributedCall>

That’s it, you’re done. Of course if you are serious about setting up a load balanced environment running an Umbraco site there are much better and more comprehensive guides out there, this is just a quick overview to give you an idea of how easy it is. I think anyone reading this will agree that when it comes to setting up a load balanced Umbraco site, Umbraco is the least of your concerns.