Domanda

Can you run a standard Website and a Cloud Service on a single VM in Azure? I'm trying to figure out if I can run a website with a worker role for background jobs in a single Large VM instance.

Note: Large was chosen mainly for RAM requirements of the website, the background services should be fairly lightweight.

Edit: If they can't run on the same VM would having a Web Role and a Worker Role be the next best option? Would that require me to manage the VM?

È stato utile?

Soluzione 2

Great news.. You can now do this!

Introducing Windows Azure Web Jobs

  • Azure Web Jobs make scheduled background tasks a breeze for Azure Web Sites.

So now you can have a single PaaS website and background services without even looking at Workers or Roles!

Altri suggerimenti

No, the Windows Azure Web Sites do not coexist with a Cloud Service; however, you can certainly run a Cloud Service Web role that spins up other things in the background. You can do this by either including the code you wish to execute in the web site package and then spinning it up via a ProcessStart in the OnStart for the role entry point, or you can spin it up using a start up task (http://msdn.microsoft.com/en-us/library/windowsazure/hh127476.aspx).

Why have you chosen a Large to run it in? Is that because it needs the heavier power for the background work? If so, you could get the same cost from a Small and a Medium, or even less for two smalls. Don't forget that if your "worker process" is CPU intensive it could crush the machine and starve out the web processing.

I'm all for hosting multiple processes on the same VM, especially for workers, but I'd be skeptical of doing this with a web role involved if it sees a lot of traffic.

Another option if you aren't required to use the PaaS model is to use the new IaaS (Windows Azure Virtual Machines) and run both IIS and a Windows Service on it to serve as the background worker; however, doing this means you'll own and have to care for the VM for patching, etc.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top