How to check Umbraco node availability in a load balanced environment
Contex: The load balancer has to know if a node is up or down.
Question: What is the correct way of checking if an Umbraco node is up?
Several options came to my mind:
Send HTTP GET to the fetch the homepage and wait for status 200. For example ping my-site.node1.foo.com But isn't loading the homepage just to get 200 a waste of resources?
Send HTTP GET to a dedicated Web API controller. For example ping my-site.node1.foo.com/Umbraco/Api/Healthcheck/GetHealth This is based on the assumption that the controller will only send a response if the app is running. But is this actually true?
Also, related question: how to know that an Umbraco site has started up and is ready to serve?
I've seen a couple of approaches:
Add the node to the load balancer
only after it finds App_Data\umbraco.config - it's assuming that
the XML cache has to be generated before serving. Can Umbraco serve
before the cache has been built?
Wait for the IApplicationEventHandler.OnApplicationStarted but is it true that the site is ready to serve after this event has fired?
How to check Umbraco node availability in a load balanced environment
Contex: The load balancer has to know if a node is up or down. Question: What is the correct way of checking if an Umbraco node is up?
Several options came to my mind:
200
. For example pingmy-site.node1.foo.com
But isn't loading the homepage just to get200
a waste of resources?my-site.node1.foo.com/Umbraco/Api/Healthcheck/GetHealth
This is based on the assumption that the controller will only send a response if the app is running. But is this actually true?Also, related question: how to know that an Umbraco site has started up and is ready to serve? I've seen a couple of approaches:
App_Data\umbraco.config
- it's assuming that the XML cache has to be generated before serving. Can Umbraco serve before the cache has been built?IApplicationEventHandler.OnApplicationStarted
but is it true that the site is ready to serve after this event has fired?is working on a reply...