tyk.conf
:
disable
: When set to false
this tells Tyk to run uptime tests, if you do not want any uptime tests to run on a Gateway, set it to true
and they will be disabled on those Gateways (this could be useful if you are running uptime tests in a separate group of Tyk instances).poller_group
: This field is used to define a different group of uptime tests. All the gateways that have the same poller_group
, will be candidates to be elected as the primary Gateway of its group. This could be useful if you are running uptime tests in a segmented or sharded group of Tyk instances.enable_uptime_analytics
: Tyk supports the recording of the data that is generated by the uptime tests, these can then be tabulated in the dashboard. Set to true
to enable uptime analytics. However, since uptime tests run constantly, they can generate large amounts of data, for some users who do not wish to manage this data, they can disable it by setting this value to false
.failure_trigger_sample_size
: Here we tell Tyk to trigger a HostDown
or HostUp
event after the test has failed or passed a set number of times; 3
in this example. Setting the number to higher values can protect against false positives, but can increase lead incident time due to the verification.time_wait
: The number of seconds between running tests. In this example, it is set to 300
seconds.checker_pool_size
: The worker pool for uptime tests. In this example we have configured Tyk to keep 50
idle workers in memory to send tests to, in other words, with this configuration, you are pretty much guaranteed asynchronous testing for up to 50 tests.body
: The body
is Base64 encoded.timeout
: The timeout
in milli seconds.HostDown
, when that host returns to service, it will trigger HostUp
. These events are triggered in the same event system as other Tyk Events, and therefore can have any kind of action performed:
HostDown
events for a single host where multiple endpoints are being tested.
proxy
section of your API Definition that will check the hostname of the outbound Tyk request (to your service) against the downtime list to see if the server is active, if the host is marked as “down” Tyk will skip to the next host in its list before making the request:
Note, the fully qualified host, including the port, needs to be exactly the same between the uptime test config and the RRLB entry in order for Tyk to link the two together.
ie: www.myapi.com:3000