"Sorry page" and connection limits
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.
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.
0
Comments
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.
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>
</body></html>"
}
Thanks
Michael.
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>”
}
Please do post what you come up with to help others.
Thanks
Michael.
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.
Please note that you have to escape quotation marks (\") in the html response
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
}