Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Marek 4 posts 84 karma points
    May 15, 2019 @ 16:21
    Marek
    0

    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:

    1. 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?
    2. 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:

    1. 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?
    2. Wait for the IApplicationEventHandler.OnApplicationStarted but is it true that the site is ready to serve after this event has fired?
Please Sign in or register to post replies

Write your reply to:

Draft