04-05-2019, 06:54 PM
What's the best way to check the health of an Intraweb application?
Basically, on AWS' Route 53 I created a health check that connects to my server, requests http://myserver/health-check and if gets back OK, my server is up (the health check is looking for "OK" string to decide if the server is up or not).
My server went down and the health check didn't alarm me. This only happened once, but it made me realize that my solution is not the best.
My original way of checking the sever was like this: In IWServerControllerBaseNewSession I have this piece of code:
The problem: One of the servers run out of available connections in the firedac connection pool and the server failed to create new sessions (not sure yet why). The IWError.html page was shown to all users that tried to connect to the server, but the http://myserver/health-check was still returning OK, so it didn't trigger the failed health check.
I could configure the health check to look for a string in the login page, but the login page returned by intraweb creates a session and considering that the route 53 makes a request every 10 seconds or faster, I don't think it would be a good idea.
My question is, do any of you have health checks running on a intraweb application? How did you set it up?
TIA
Basically, on AWS' Route 53 I created a health check that connects to my server, requests http://myserver/health-check and if gets back OK, my server is up (the health check is looking for "OK" string to decide if the server is up or not).
My server went down and the health check didn't alarm me. This only happened once, but it made me realize that my solution is not the best.
My original way of checking the sever was like this: In IWServerControllerBaseNewSession I have this piece of code:
Code:
[...] else if ContainsText(WebApplication.Request.PathInfo, 'health-check') or ContainsText(WebApplication.Request.Query, 'health-check') then
begin
// respond with OK and don't create a session
WebApplication.Response.WriteString('OK');
WebApplication.Terminate;
end
The problem: One of the servers run out of available connections in the firedac connection pool and the server failed to create new sessions (not sure yet why). The IWError.html page was shown to all users that tried to connect to the server, but the http://myserver/health-check was still returning OK, so it didn't trigger the failed health check.
I could configure the health check to look for a string in the login page, but the login page returned by intraweb creates a session and considering that the route 53 makes a request every 10 seconds or faster, I don't think it would be a good idea.
My question is, do any of you have health checks running on a intraweb application? How did you set it up?
TIA