How to report service as ready (or not ready)?
Hi,
We have 2 types of cloud services: 1 that accepts input from TCP, and one that accept input from service bus. Each type of service has 3 instances running. Now the problem is, that these services take nearly 1 minute to start up (some data needs to be parsed
etc). The data is static, but still, whenever a cloud service is started it cannot accept input (either TCP or queues) the first minute.
The default "instance" logic in Azure is just round robin right? So it doesn't look IF a service is responding? And next question is: Can I somehow tell this default "instance-logic" in Azure that my service is ready (or not ready)?
Are there other solutions in Azure that will enable me to somehow tell Azure that a service is "ready"?
--
Werner
December 18th, 2013 5:58pm
Hi,
Based on your description, when the cloud service is started but you cant accept the data the first minute, from my experience, when we use service, we need to check the service was given us data or not, we continue loading unless we receive the data, this
ready/not ready state was judging by us through our logic. Hope this helps, if I misunderstand, please feel free to let me know, and give us further information for a better help.
Best Regards
December 19th, 2013 11:21am
Hi,
Based on your description, when the cloud service is started but you cant accept the data the first minute, from my experience, when we use service, we need to check the service was given us data or not, we continue loading unless we receive the data, this
ready/not ready state was judging by us through our logic. Hope this helps, if I misunderstand, please feel free to let me know, and give us further information for a better help.
Best Regards
December 23rd, 2013 11:14am
No this does not work for me. I can put my initialization in the RoleEntryPoint.OnStart(). This initializes logging and loads some large data into static field. Before I leave OnStart, the fields are filled correct.
However when I then access the WCF web service: Logging is not initialized and the static fields are all null.
Please advice
--
Werner
- Edited by
Werner Clausen
Friday, January 10, 2014 2:39 PM
January 10th, 2014 3:28pm
No this does not work for me. I can put my initialization in the RoleEntryPoint.OnStart(). This initializes logging and loads some large data into static field. Before I leave OnStart, the fields are filled correct.
However when I then access the WCF web service: Logging is not initialized and the static fields are all null.
Please advice
--
Werner
- Edited by
Werner Clausen
Friday, January 10, 2014 2:39 PM
January 10th, 2014 3:28pm
No this does not work for me. I can put my initialization in the RoleEntryPoint.OnStart(). This initializes logging and loads some large data into static field. Before I leave OnStart, the fields are filled correct.
However when I then access the WCF web service: Logging is not initialized and the static fields are all null.
Please advice
--
Werner
- Edited by
Werner Clausen
Friday, January 10, 2014 2:39 PM
January 10th, 2014 3:28pm
Hi,
Based on my understanding, this is a completely different issue. Actually, it's not because the role is marked as ready or not. It's because OnStart executes in a different process (web role process) as the main web application (IIS process).
The solution in my mind is: assuming you're loading a lot of data from an external source, you can cache the data in the server's local disk in OnStart. Then in the web application's Application_Start (in Global.asax), you read the data from
the local disk, which could be faster than reading from the remote data source, and store in static fields. Please initialize logging in Global.asax as well. To further improve performance, you may want to implement some memory sharing
mechanisms between web role and IIS processes (http://msdn.microsoft.com/en-us/library/windows/desktop/aa366551(v=vs.85).aspx).
Best Regards,
Ming Xu
January 12th, 2014 8:32pm
Ok that makes sense then. Yet I can't see that many initialization use cases that would work between different processes. In any case, with this service, the time consuming part is not loading the data from storage - but parsing and initializing them in
memory.
Thanks for you help though.
--
Werner
- Edited by
Werner Clausen
4 hours 39 minutes ago
January 13th, 2014 2:07am
Ok that makes sense then. Yet I can't see that many initialization use cases that would work between different processes. In any case, with this service, the time consuming part is not loading the data from storage - but parsing and initializing them in
memory.
Thanks for you help though.
--
Werner
- Edited by
Werner Clausen
Monday, January 13, 2014 7:05 AM
January 13th, 2014 10:04am
Ok that makes sense then. Yet I can't see that many initialization use cases that would work between different processes. In any case, with this service, the time consuming part is not loading the data from storage - but parsing and initializing them in
memory.
Thanks for you help though.
--
Werner
- Edited by
Werner Clausen
Monday, January 13, 2014 7:05 AM
January 13th, 2014 10:04am
Ok that makes sense then. Yet I can't see that many initialization use cases that would work between different processes. In any case, with this service, the time consuming part is not loading the data from storage - but parsing and initializing them in
memory.
Thanks for you help though.
--
Werner
- Edited by
Werner Clausen
Monday, January 13, 2014 7:05 AM
January 13th, 2014 10:04am
At least it doesn't take much time to read the data from memory. So I assume the only thing that takes time is parsing the source data into a format that is used by your application. You can try to do the initialization in OnStart, serialize the result
as a file in local storage, and in Global.asax, read the file and load the data to memory. If you have a lot of small data, another option is to use cache preview (
http://msdn.microsoft.com/en-us/library/windowsazure/dn386094.aspx).
It allows you to share cached data accross multiple applications and thus multiple processes. You can store a lot of parsed data in cache, and read a piece of data from cache in the web application.
January 17th, 2014 1:30am