Options

"Sorry page" and connection limits

PjarInkPjarInk Member
Hello

I've been looking into 2 things, the first being a sorry page for when our servers are down and I'd like to have my page in the loadbalancer. Is aflex the best solution to this? To do a simple check if our SGs are down, display sorry page instead? Can the LB display HTML only or is it possible to have an image in there as well, or do I have to have the image off site? (Image is not necessary, just a bonus)

The other thing I've been looking into is related to the above in the sence that I want the same logic applied, but for connection limit. Please see my thread in general for more info: https://www.a10networks.com/vadc/index.php/forums/topic/ax-handling-of-connection-limit/

So basicly, I want to display the sorrypage when we're receiving too many connections on our appservers to prohibit them from crashing due to overload.

Comments

  • Options
    kumakuma Member
    edited February 2014
    Hi Pierre,

    Usually aFleX is the solution we would take if you want AX/Thunder to display sorry page. If you do have some other server which is capable of having sorry page contents, you can also use "failover-url" feature from HTTP template.

    By having configuration like:
    slb template http myHTTP
    failover-url www.example.com/contents/sorry.html

    And apply it to the virtual server, then if all the member of service-group are down, the request will be redirected to the url configured.

    Another part of your question:
    >Can the LB display HTML only or is it possible to have an image in there as well, or do I have to have the image off site? (Image is not necessary, just a bonus)

    You cannot have an image uploaded in the box. If you need to have an image to your sorry page displayed, you need to have it off site. Let's wait for an enhancement for this part.

    Hope this helps.
  • Options
    edited February 2014
    Hi Pierre,
    To get a image to display direct from the AX/TH

    I used this site http://yellowgreen.de/image-to-base64-string-encoder/language/en_US/ to encode a image file to base64, then use the following (removed some of the base64 as too long)

    aFleX would be like the below.

    when LB_FAILED {
    HTTP::respond 503 content "<html><head><title>Apology
    Page</title></head><body>We are sorry, but the site you are looking
    for is temporarily out of service<br>If you feel you have reached this
    page in error, please try again.<p>
    image
    </body></html>"

    }

    Thanks
    Michael.
  • Options
    edited February 2014
    Sorry the Forum is converting the inline source image. (I will add spaces and see if that works).

    hen LB_FAILED {
    HTTP::respond 503 content “<html><head><title>Apology
    Page</title></head><body>We are sorry, but the site you are looking
    for is temporarily out of service<br>If you feel you have reached this
    page in error, please try again.<p><i m g s r c =\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVIAAACTCAIAAABTdAYdAAAAAXNSR0IArs4c6QAAbrpJREFUeF7tv...........QmCC\"/></body></html>”
    }
  • Options
    PjarInkPjarInk Member
    edited February 2014
    Ok, thanks for input! I'll try to make an aflex that covers our needs and I can post it here if there's interest.
  • Options
    edited February 2014
    Hi Pierre,
    Please do post what you come up with to help others.

    Thanks
    Michael.
  • Options
    PjarInkPjarInk Member
    edited February 2014
    Is it possible to store html in a variable? I can't get it to work and I need it for my aflex to work properly.

    Right now it's nothing more than a when LB_FAILED and a http response with my page, but I need some more logic because we have a CDN on a different service group and I need to check if that group is up or down as well.

    Another solution would be if it was possible to do something like:
    when LB_FAILED or LB::status pool CDN == "down" {}

    But that doesn't work either, I've tried a few different variations but without result.
  • Options
    PjarInkPjarInk Member
    edited February 2014
    I came up with a solution and it seems to work in my testing (disable realservers/service groups), the logic is that if any of our service groups are down, the sites function is degraded to a point where the site should not be displayed.
    # Displays a sorry page when LB can not be performed (Servers down or connection limit hit)
    
    when HTTP_REQUEST {
         if {([LB::status pool ServiceGroup1] equals "down") or ([LB::status pool ServiceGroup2] equals "down") or ([LB::status pool ServiceGroup3] equals "down")} {
             HTTP::respond 503 content "html goes here"
    }
    }


    Please note that you have to escape quotation marks (\") in the html response
  • Options
    kumakuma Member
    edited March 2014
    Thanks for the post.
    For putting HTML in variables, may be you can try out something like:

    when RULE_INIT {
    set ::myhtml "your html contents"
    }

    when HTTP_request{
    YOUR METHODS
    HTTP::respond 503 content $::myhtml
    }
  • Options
    PjarInkPjarInk Member
    edited March 2014
    I got a blank page whenever I tried using a variable for my html.
Sign In or Register to comment.