Contact AlphaToGo if you need assistance with configuration.


AlphaLB is configured using a file named alphalb.toml. Please study the default configuration file here.


Within the default configuration are several settings you need to make to match your situation.


The default configuration file is pre-configured to support Alpha instances on port 84 and 85. Additionally, ports 86-91 are also configured but commented out. Comment any of these back in if you use them. You are free to use different port numbers.


Initial configuration can be confusing. Contact AlphaToGo for assistance.


We are assuming below that your load balancer-related files are stored in c:\aa\alphalb.


Configuration file sections:


Section

Meaning/Comment

License

Your license number. Licenses are unique to each installation. Altering this license can cause your load balancer to stop working.

#debug = true

logLevel = "INFO"

These lines control the amount of detail in the InfoLog file. If you uncomment the debug parameter it will include debug information in the InfoLog file.


The LogLevel parameter can be any of these, each with decreasing amount of information in the InfoLog file: "DEBUG", "INFO", "WARN", "ERROR", "FATAL", "PANIC"

[file]

watch = true

The [file] parameter is required but the 'watch' parameter value is optional. Set to 'true' to cause changes to the configuration file to be implemented immediately, without restarting the service. Omit or set to 'false' to not have the configuration file implemented immediately.

[entryPoints]

EntryPoints define how the load balancer listens to particular ports, typically one is set for port 80 and one for port 443.

[entryPoints.http]

address = "xxx.xxx.xxx.xxx:80"

compress = true

Standard setup for listening to port 80. If you do not want the load balancer to listen to port 80, comment this section out. The line for "compress" is optional and if set to 'true' will enhance performance where the header on the incoming packet is over 512K in size. The IP address is often left blank.

[entryPoints.http.redirect]

entryPoint = "https"

This line tells the load balancer to redirect any traffic sent on port 80 (i.e., non-SSL) to the "https" entry point. If you are not listening on port 80, comment this section out.

[entryPoints.https]

address = "xxx.xxx.xxx.xxx:443"

compress = true

This is the standard line for listening to port 443 (SSL). It is also the entry point for traffic redirected from port 80 if configured to do so. If you do not want the load balancer to listen to port 443, comment this section out. The IP address is often left blank.

[entryPoints.https.tls]

minVersion = "VersionTLS12"

These lines define the SSL security between the load balancer and the Internet. TLS is typically set to "VersionTLS1.2". You can alter this value but you should be familiar with TLS security settings.

[[entryPoints.https.tls.certificates]]

certFile = "C:/aa/ssl/mydomain.crt"

keyFile = "C:/aa/ssl/mydomain.key"

These lines define the certificate and paraphrase key file for the Alpha application.

[frontends]

Frontends receive traffic from the associated Entrypoint and enable various rules about how to handle the traffic, and the forward that traffic to the defined EndPoint. Every EntryPoint must point to a FrontEnd and every FrontEnd must point to an EndPoint.

[frontends.frontend1]

entryPoints = ["http", "https"]

backend = "backend1"

passHostHeader = true

These lines define "frontend1" which, in this example, are listening to EntryPoints .http and .https defined above and will forward traffic to backend1, defined below.


The parameter "passHostHeader = true" will ensure that the Alpha function ?request.host will hold the full host name such as "iadn.com". Without this parameter in place, request.host woudld show the load balancer IP address and port, such as 127.0.0.1:88.

[frontends.frontend1.routes.route1]

rule = "Host: mydomain.com,www.mydomain.com,xxx.xxx.xxx.xxx"

These lines define the "Hosts" rule for traffic being forwarded to the BackEnd. Although there are many possible rules, a typical Alpha application will have the rules provided in this example. All versions of how your clients access your website need to be entered here. For example, if you do not want clients to access via an IP address, omit that IP address here.

[backends]

BackEnds can be defined as how the load balancer manages the Alpha Instances.

[backends.backend1]

This line establishes backend1. You would only need to define multiple backends if you were using the load balancer to manage more than one Alpha application.

[backends.backend1.loadBalancer]

method = "drr"

These lines define how backend1 will distribute the load across all of the Alpha Instances. The only appropriate value for method is "drr" which stands for Dynamic Round Robin.

[backends.backend1.loadBalancer.stickiness]


This line tells the load balancer to try to keep users on the same Alpha Instance once they establish a connection. It is a mandatory setting for this configuration. 

[backends.backend1.healthcheck]

path = "/" 

#path = "/optional_healthcheck_page.a5w"

interval = "30s"

These lines define the Health Check functionality. This whole section is optional. If defined, the load balancer will "ping" the file designated in the path parameter at the interval defined. In the example I show an alternate path pointing to a particular A5W page; and this is desirable because every single hit by the health check will end up in your Alpha Access log if you have that turned on. It is convenient to define a special page so you can purge those from the Alpha log if desired. and also not to mistake them for actual hits to your website.


The interval can be as long or short as you desire. The health check will ping on that interval and IF it finds that the Alpha Instance is not responding it will take it out of consideration for new traffic until if finds that the Alpha Instance has returned to full service. The larger you set the interval the longer it will take for the load balancer to respond to a poorly performing Alpha Instance, and the longer it will take to put it back in service.

[backends.backend1.servers]

This line defines the group of backend server(s).

[backends.backend1.servers.server1]

url = "http://127.0.0.1:84"

weight = 1

These lines define a specific Alpha Instance by port number, port 84 in this example.


The parameter for 'weight' is optional and typically only valuable if the Alpha Instances are on physically different machines, and one of those machines has higher bandwidth or better performance. The higher the weight, the greater the number of requests go to that Instance.

[backends.backend1.servers.server2]

url = "http://127.0.0.1:85"

weight = 5

This is an example of the configuration for a second Alpha Instance. Note how the port number is different and the suffix on the server Id has incremented. As an example, the weight has been set to 5 meaning 5 times more traffic will be sent to this Instance as the one defined above.

[InfoLog]

filePath = "c:/aa/alphalb/alphaLB_info.log"

format = "common"

These lines define the InfoLog which is analogous to a debug log indicating how the system is working, and showing configuration details at each startup. If your load balancer is not working, this is the log to review. Comment these lines out if you do not want to generate this log. Note the forward slashes for folder designation.

[accessLog]

filePath = "c:/aa/alphalb/alphaLB_access.log"

format = "common"

These lines define the access log which is a record of every single hit to your website. Unlike the Alpha access log, these are in 'common' format and can be analyzed using standard tools to understand your traffic. The file can grow quite large so it is important either to review or to use a Log Rotator program (not provided) to rotate the log file.


This log can be filtered so that it only captures particular information. The instructions for filtering are not yet in this help file. Note the forward slashes for folder designation.

#[API]

#address = 8080

The load balancer has the option of pushing statistics to a particular port. You can use this to gather real-time statistics about how your application is performing and about traffic to your site. The instructions on how to do this are not yet in this help file. The settings are toggled off as a default.

#[Retry]

#attempts = 5

These lines tell the load balancer how many times to retry to make a connection. The default is to toggle this setting off. When toggled off, it will retry a number of times equal to the number of defined Alpha Instances minus 1. Normally this is sufficient, but if your application can get 'sluggish' and you frequently see Bad Gateway noted in the browser, you might want to increase this setting, There is no penalty to making the value quite high, like attempts=30.