How does Azure check the WorkerRole's status?
Asked Answered
I

2

6

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

There 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.

Impish answered 21/3, 2011 at 17:18 Comment(0)
S
4

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.

Stelliform answered 21/3, 2011 at 19:19 Comment(2)
The blog post you linked to does not say the polling period is 15 seconds. It doesn't give any information on the period, actually.Goldfinch
I never said that article mentioned the time period - in fact, back in 2011, I don't even know if there was a published article mentioning that (a bit difficult to go back 6 years to check). But there are plenty of more current articles which do mention it. Such as this one.Stelliform
W
4

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

Wheaton answered 21/3, 2011 at 19:17 Comment(0)
S
4

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.

Stelliform answered 21/3, 2011 at 19:19 Comment(2)
The blog post you linked to does not say the polling period is 15 seconds. It doesn't give any information on the period, actually.Goldfinch
I never said that article mentioned the time period - in fact, back in 2011, I don't even know if there was a published article mentioning that (a bit difficult to go back 6 years to check). But there are plenty of more current articles which do mention it. Such as this one.Stelliform

© 2022 - 2024 — McMap. All rights reserved.