开发者

How does Azure check the WorkerRole's status?

开发者 https://www.devze.com 2023-02-18 22:51 出处:网络
I see how Azure checks the status of my worker role periodically, but how? Ther开发者_如何学运维e is no method in RoleEntryPoint to do that, and I\'m taking a look on Microsoft.WindowsAzure.ServiceRu

I see how Azure checks the status of my worker role periodically, but how?

Ther开发者_如何学运维e is no method in RoleEntryPoint to do that, and I'm taking a look on Microsoft.WindowsAzure.ServiceRuntime's classes with ILSpy but I don't see anything relevant.


Here's a blog post that describes how the Windows Azure Fabric Controller monitors instance health.

Aside from that, the controller calls a StatusCheck event, every 15 seconds, that you can handle. If you want to pull yourself out of the load balancer (maybe based on some internal data your instance has), you just call SetBusy() on the RoleEnvironmentStatusCheckEventArgs object. This takes you out of the load balancer until the next check.


I think the mechanism is the same as the one used for WebRoles

the Azure RoleEnvironment performs a StatusCheck - see http://msdn.microsoft.com/en-us/library/microsoft.windowsazure.serviceruntime.roleenvironment.statuscheck.aspx

If you want to tell the service you are busy then call SetBusy() when this event fires

0

精彩评论

暂无评论...
验证码 换一张
取 消