Deploy a Web Role and Worker Role in a single instance

血红的双手。 提交于 2019-12-08 04:30:04

问题


I'm developing a scalable app and I use the web role, queue, worker role design... But right now (in the alpha tests phase) i'm concerned a little about cost cutting because i'm suffering from the common "out of cash" problem...

So due to the test nature of the phase i was wondering if there's a way to make a role behave as web role and worker role? So i could deploy both of my projects (the "WebFrontEnd" project and the "QueueProcessor" project) on a single instance...

Edit1: i do know how to deploy various web projects on the same instance... or a web project and a WCF project... but i can't manage the worker role project...


回答1:


There're many threads on the same subject which basically would tell you not to do it. See this thread for example: Can we have a worker Role and a web role in a single instance of Azure Cloud Services. However do take a look at this blog post about combining a web and a worker role: http://www.31a2ba2a-b718-11dc-8314-0800200c9a66.com/2010/12/how-to-combine-worker-and-web-role-in.html.

Another idea could be to keep them separate however deploy them in Extra Small instance instead of a larger instance (1 Small Instance = 6 Extra Small Instance in terms of cost). If you don't care about the SLA, you could possibly deploy just a single instance of your web and worker role (in separate VMs).




回答2:


You cannot deploy two different "endpoint" projects on one instance. However, your instance can house the codebase for both and serve as a single machine that houses both executables.

Simply reference QueueProcessor project from your WebFrontEnd project and start the QUeueProcessor from your WebRole.cs



来源:https://stackoverflow.com/questions/15500803/deploy-a-web-role-and-worker-role-in-a-single-instance

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!