我正在编写一个小型计算程序,对blob文件进行大量读取操作......我是否应该去工作角色或Web角色....
The only difference between a web role and a worker role is that in the web role, IIS (actually Hosted Web Core) gets started and pointed at your app data directory. You can still put code in WebRole.cs that does exactly the same thing as you would do in your worker role, so the decision should really be "Do you want IIS?" If so, use a web role. If not, use a worker role.
最终是工作者角色,顾名思义,Web角色旨在回答Web请求,并且根据IIS设置,Web请求可能在1分钟左右后超时。
It's hard to give a definitive answer without more information, but at first glance I would say a worker role. This is like a back-end Windows service, as opposed to something which answers HTTP requests as they arrive.
Regarding your question about how to host a worker role: it's the exact same process as hosting a web role - just add a new role to your project, and choose Worker Role instead of Web Role. Roles are nothing more than "virtual machines." And when you select the number of "instances," well that equates to how many virtual machines are running. What @smarx was explaining simply says web roles (or web Virtual Machines) have IIS at your disposal, where worker roles do not.
To see what a worker role is doing, there are two relatively common patterns:
If you want to see some great getting-started videos, check out the Cloud Cover Show . Episode 3 talks specifically about creating worker roles, and @smarx shows how to host the Mongoose html server from a worker role.
I'll make it simple
web role is for hosting an IIS based web application.
worker role is for any other application.
The only real difference between the two is that IIS is installed on the Web Role and your application will be deployed into it.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.