Bloodhound: Load Balancing
Legacy Documentation
You're viewing legacy documentation for API Fortress (deployed via an on-premises container). To view documentation for the new SaaS version of API Fortress — now known as Sauce Labs API Testing and Monitoring (with Sauce Connect tunnels) — see API Testing on the Sauce Labs Cloud.
Bloodhound has a simple load balancing capability we are going to discuss now. Before moving forward, make sure you have read the basic configuration guide.
Load Balancing Configuration
The backends in the backends.yml
can alternatively be expressed as follows:
- prefix: '\[^/\]\*/upstreams'
upstreams:
urls:
- 'https://server-1/endpoint'
- 'https://server-2/endpoint'
probe:
count\_up: 2
count\_down: 2
method: GET
timeout: 2 seconds
path: ''
status: 200
interval: 10 seconds
flow\_id: default
In this configuration, upstream
is replaced by the upstreams
object.
urls
: a list of URLs that will be used as upstreamsprobe
: the system will probe each URL periodically to make sure they are available. The probe is optional and, if omitted, Bloodhound will always consider URLs as functional.path
: an extra path segment to be appeneded to the URL when probingcount_up
: how many times a probe should be successful before the URL can be considered as workingcount_down
: how many times a probe should fail before the URL can be considered as non workingmethod
: which method, amongGET
/POST
/PUT
/PATCH
needs to be used by the probetimeout
: how long should a probe wait for a reply before it considers the URL as non responsive and therefore call it a failurestatus
: the expected status codeinterval
: how frequently should the probe run
NOTE: The system will look for a
probe
thread pool in theimplementers.yml
file. If noprobe
thread pool is defined, default will be used.
Additional Topics
Fine Tuning the Configuration: Please refer to the fine tuning guide to learn more.