Skip to content

Reliability

Pummelchen edited this page Sep 11, 2026 · 6 revisions

Home · Installation · Compatibility · Tools Reference · Architecture · Providers · Configuration · Reliability · Security · Self-Hosting · Monitor · Testing · Troubleshooting · Project Tracker


The governing rule

A single vendor outage must never turn a potentially successful search into a hard tool failure. A search returns an error only when no provider can produce a usable result, or when the request itself is invalid.

Everything on this page exists to enforce that rule.


Timeouts

Each mode has one whole-search wall-clock budget, not a per-provider timeout:

Mode Budget Default
fast SEARCH_FAST_TIMEOUT_MS 12 000 ms
balanced SEARCH_BALANCED_TIMEOUT_MS 15 000 ms
thorough SEARCH_THOROUGH_TIMEOUT_MS 20 000 ms

Behaviour when the budget expires:

  • Providers that already answered keep their results.
  • Providers still running are cancelled and recorded as timeout failures.
  • The call succeeds if anything usable came back.

There are two further layers beneath the budget: a connect timeout (default 3 s) and a per-request timeout (default 10 s).


Retries

Aspect Behaviour
Eligible requests Idempotent only — GET, HEAD, PUT, DELETE
Eligible statuses 408, 425, 429, 500, 502, 503, 504
Never retried Every other 4xx, including 400, 401, 403, 404
Attempts 1 initial + SEARCH_MAX_RETRIES (default 2)
Backoff Exponential with full jitter across [0.5×, 1.5×] of 200 ms, then 500 ms
Retry-After Honoured when supplied, capped so a hostile server cannot stall a search

Search requests sent by POST are deliberately not retried. Tavily and Exa search over POST; a retry consumes provider credits and may duplicate an effect. Retrying them to chase a marginal success rate is the wrong trade.

Authentication and validation failures are never retried, because retrying a bad key cannot succeed and only burns quota.


Circuit breakers

Each provider owns an independent breaker.

State Meaning
closed Normal operation
open Skipped entirely until the cooldown expires
half_open Exactly one probe request is permitted
Setting Default
Failures to open 3 consecutive transient failures
Cooldown 30 s
Close condition One successful probe

Only transient categories — rate_limited, timeout, network, server_error — count toward opening a breaker. Authentication, configuration and malformed-response failures are recorded and surfaced but never trip it: waiting cannot fix a bad key, and hiding a real error behind an open breaker makes diagnosis harder.

The half-open probe is claimed by the first caller only, so a burst of concurrent searches cannot all hammer a recovering provider.


Rate limiting

Each provider has a token bucket, treated as a ceiling rather than a quota to spend.

Provider class Burst Sustained Minimum interval
JSON APIs 4 60 / min —
Self-hosted SearXNG 2 30 / min 500 ms
Opt-in scrapers 1 10 / min 1 500 ms

A denial is reported as a rate_limited failure rather than making the caller wait, because waiting would consume the whole search budget.


Caching

Property Value
Storage In memory, bounded (256 entries, oldest evicted)
Key Normalized query + filters + mode + provider set
TTL SEARCH_CACHE_TTL_SECONDS (default 120 s; 0 disables)
Cached Successful responses with at least one result
Never cached Failures, and empty result sets

Provider set is part of the key because a fast reply from one provider and a thorough fused reply are different products and must not alias. Page content fetched by web_open is not cached.


Failover in practice

Scenario Outcome
One provider returns 429 Others answer; failure recorded; breaker tracks it
One provider returns 503 Retried if idempotent, then recorded as a transient failure
One provider times out Cancelled at the budget; answered providers keep results
One provider has a bad key Reported as authentication; breaker stays closed so it keeps reporting
All providers fail allProvidersFailed error result
A provider is skipped by its breaker Recorded as circuit_open; others proceed
No provider configured Actionable error naming the environment variable to set

Every degraded outcome is visible: providers_failed carries the category and message, and warnings summarises what happened.


Observability

web_search_status is the operator's view: per-provider status, circuit state, request and failure counters, average latency, last error with category, and a note explaining why an inactive provider is inactive — for example "Set SEARXNG_BASE_URL to a self-hosted instance with JSON enabled."

Logging goes to stderr only, with a stable query hash instead of the query text unless SEARCH_LOG_QUERIES is enabled. See Configuration.


Home · Installation · Compatibility · Tools Reference · Architecture · Providers · Configuration · Reliability · Security · Testing · Troubleshooting · Project Tracker

Clone this wiki locally