Skip to main content
Version: 4.1

HealthCheck

Namespace: Wisej.Core

Assembly: Wisej.Framework (4.1.0.0)

Handler for healthcheck requests sent by load balancers.

public class HealthCheck

Configure the load balancer to use "http://your-server/healthcheck.wx" as the health check URL.

You can modify the default healthcheck value either by placing a Healthcheck.json file in the root of your project, or programmatically assigning the values to Wisej.Core.HealthCheck properties. See load-balancing.



static class Program {

// static constructor.
static Program() {

Wisej.Core.HealthCheck.MaxCPU = 0; // ignore
Wisej.Core.HealthCheck.MaxMemory = 85;

}
}

Fields​

NameTypeDescription
IsServerAvailableFunc<Boolean>Custom function placeholder assignable by the application to determine when a server should return that it's not available to receive more sessions.

Properties​

Static member Enabled​

Boolean: Returns or sets whether the load balancing features are enabled.

Static member MaxCPU​

Int32: Maximum CPU load in percentage: Default: 100; 0 = unlimited.

Static member MaxMemory​

Int32: Maximum percentage of allocated memory. Default: 70; 0 = unlimited.

Static member MaxSessions​

Int32: Maximum number of active sessions: Default: 0; 0 = unlimited.

Static member ResponseHeader​

String: Returns or sets the response header to return to the browser.

Can be used in conjunction with the ReturnCode set to 200 (OK) and the value of the return header set to "Refresh: 0; Set-Cookie: AffinityCookie=" to cause the client browser to load the affinity cookie and reload the page to (hopefully) reach another server.

Static member RetryAfter​

Int32: Value for the Retry-After header in minutes. Default: 10.

Static member ReturnCode​

Int32: Http return code to signal that this server is not available. Default: 503.

Static member ReturnUrl​

String: Redirection Url in alternative to the error return code. Default: null.