1

What is the difference between the single and multiple instances sites in asp.net when using Azure cloud services?

Pure.Krome
  • 84,693
  • 113
  • 396
  • 647
user3740129
  • 11
  • 1
  • 3
  • 1
    Can you elaborate what you mean by that? These are not standard terms as far as I'm aware. – usr Jun 14 '14 at 11:00
  • 1
    Please edit your question to clarify whether you're talking about Virtual Machines, Cloud Services (web role), or Web Sites service. Also clarify what differences you're looking into: the Azure service differences, or asp.net differences (and if the latter, please remove Azure tag). – David Makogon Jun 14 '14 at 11:06
  • 1
    Still not really clear what you're asking. Are you trying to scale? http://azure.microsoft.com/en-us/documentation/articles/cloud-services-how-to-scale/ – CSharpRocks Jun 14 '14 at 13:05
  • 1
    In this page http://azure.microsoft.com/en-us/documentation/articles/web-sites-dotnet-session-state-caching/ . It says in the second paragraph " for sites with multiple instances ". I want to understand what it means with multiple instances – user3740129 Jun 14 '14 at 14:12
  • Instance == Virtual Machine in which your web application is running. Multiple instances means your web application is running in more than one virtual machine. HTH. – Gaurav Mantri Jun 14 '14 at 14:18

2 Answers2

5

Ok - there's a few concepts here that you need to grok to answer your question.

// Arrange.

First, I'll make some assumptions about your question mainly based on the link to documentation, so my answers have less ambiguity.

  1. You're dealing with Azure WebSites and not a Cloud Web Role or a custom Windows Virtual Machine with IIS. **
  2. You're trying to remember stuff with the Session object (ie: State data).
  3. You're not sure what an instance or multiple instances are, with respect to Azure WebSites.

NOTE: My answer applies to WebSites, Web Roles and Windows VM's running IIS .. but I just wanted to be uber clear on the Q.

// Act.

When you create a website (either in an WebSite, Web-Role or a custom Windows Server with IIS) the website has some defined memory boundary/space/garden/wall/magic bubble which is called the App Pool. It means that your website is 100% isolated from other websites on that single server. You do something bad, it doesn't mess with anyone else's sites.

So that website which is installed on that single server is called an instance.

Next, we decide that we need to handle so many people hitting our websites, so we need to scale out. This means, make copies/clones of this website which has the effect of splitting the load up. If you scale out to 3 copies, then each webserver should (for simplicity) split the work load by a 3rd - so each handles about 33% of the load***.

Now, you have 1 website on 3 servers and this is called multiple instances.

So an instance is therefore a term used to describe how many servers the website is installed on.

Ok - so why is this important and what does this have to do with State (as suggested by that article you were reading/referring to) ?

Remember how I said that a instance is a single server and if you have multi instances you have more than 1 server? well .. now that the website exists on different servers - they can't share their State data between them unless you do some special stuff. That special stuff is what that document is chatting about, with lots of funky terms like Inproc, OutProc, Distributed caching, etc.

// Assert.

So the TL;DR; is that you now know that when you scale out and have multiple copies of your website on separate hardware, that's called multi instances and when you do that (have more than one copy) then you need to consider some special code to handle sharing of the State across these multiple servers -- if you need to share state.

Now - have a pic of a beautiful Mola Mola for reading all of this :)

enter image description here

*** Yes yes yes .. there's a number of algorithms to handle load balancing of scaled out sites, like round robin, etc. Lets just keep it really simple for the purpose of this question. K? thxgoodbai.

Community
  • 1
  • 1
Pure.Krome
  • 84,693
  • 113
  • 396
  • 647
0

The "multiple instances" means what it says - more than a single instance of your website hosted on two IIS instances. If you utilise in-process state tracking you will not be able to balance traffic between the two web servers (typically sticky sessions are used to get around this but this is not an option with the load balancing capabilities of Azure).

Simon W
  • 5,481
  • 3
  • 24
  • 35