为什么IIS接受RoleEntryPoint.OnStart返回之前的请求? [英] Why does IIS accept requests before RoleEntryPoint.OnStart returns?

查看:109
本文介绍了为什么IIS接受RoleEntryPoint.OnStart返回之前的请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我和Azure的样品从这里上计算仿真玩耍,我发现,如果我做的OnStart()在我从 RoleEntryPoint 继承类在Web角色返回.aspx页面中相当缓慢甚至在接受HTTP请求的OnStart()的回报。

I'm playing with Azure sample from here on Compute Emulator and I found that if I make OnStart() in my class inherited from RoleEntryPoint rather slow to return the .aspx page in the web role accepts HTTP requests even before OnStart() returns.

我觉得相当混乱 - 为什么会IIS接受请求到尚未启动的作用

I find it rather confusing - why would IIS accept requests to the role that hasn't yet started?

推荐答案

模拟器并不模拟负载平衡器100%。对于云计算,当你的角色是的OnStart(),您就报告给LB因为忙,没有任何流量将被路由到它。一旦你的OnStart()与真正的回报,这将需要几秒钟左右,但只有这样,LB开始路由。您可以通过在你的OnStart跟踪(),并把一个大的睡眠()在那里测试这个自己。您将无法达到您的实例(对非挥之不去的端口)。

The emulator does not emulate the load balancer 100%. For the cloud, when your role is in OnStart() you are reported to the LB as Busy and no traffic will be routed to it. Once you return from OnStart() with true, it will take a few seconds or so but only then will the LB start to route to it. You can test this yourself by tracing in your OnStart() and putting a big Sleep() in there. You won't be able to reach your instance (over non lingering ports).

您当然可以要求LB忽略就绪状态,它甚至会忙时的路线 - 这是在端点上指定ignoreRoleInstanceStatus =真正的做

You can of course ask the LB to ignore the Ready status and it will route even when busy - that is done by specifying ignoreRoleInstanceStatus="true" on the endpoint.

这篇关于为什么IIS接受RoleEntryPoint.OnStart返回之前的请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆