The load balancer is an Nginx process that sits in front of all search-service instances and routesDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/GuancheData/stage_3/llms.txt
Use this file to discover all available pages before exploring further.
/search and /health requests to them. It uses the least_conn directive so that each new connection goes to the backend that currently has the fewest active connections, spreading load evenly when response times vary. Backends are declared statically in nginx.conf before the service starts; there is no dynamic service discovery.
Upstream configuration
The activenginx.conf upstream block is:
server lines are templates for additional backends. Uncomment and fill in the IP address of each search-service node you want to add.
Failover behavior
Eachserver directive carries two failure-tracking parameters:
| Parameter | Value | Meaning |
|---|---|---|
max_fails | 10 | Nginx marks a backend as temporarily unavailable after 10 consecutive failed upstream attempts (connection errors, timeouts, or 502/503/504 responses). |
fail_timeout | 30s | The backend stays unavailable for 30 seconds before Nginx tries it again. The same 30-second window is used to count the 10 failures. |
proxy_next_upstream directive on the /search location retries failed requests on the next available backend for error, timeout, http_502, http_503, and http_504 conditions.
Keepalive connection pooling
keepalive 64 instructs Nginx to maintain a pool of up to 64 idle persistent connections to the upstream group. Combined with proxy_http_version 1.1 and proxy_set_header Connection "", this ensures that HTTP/1.1 keep-alive is used end-to-end, avoiding the overhead of a TCP handshake on every request.
Adding or removing backends
To add a backend, uncomment one of the template lines and replace<NODE_IP> with the actual address of the search-service node:
server line. After every change, reload Nginx:
Proxied locations
Both locations forwardHost and X-Real-IP headers to the upstream.
| Location | Connect timeout | Send/Read timeout | Notes |
|---|---|---|---|
/search | 60 s | 60 s | Retries on error, timeout, 502, 503, 504. |
/health | 5 s | 5 s | Short timeout; used by health checks. |