Rate‑Limit Behavior for Algolia Search API Calls
0 reputation · 22 May 2020, 15:10 UTC
0 reputation · 22 May 2020, 15:10 UTC
To understand how Algolia enforces request rate limits per API key and how a 429 response may originate from either server‑side throttling or client‑side connection‑pool exhaustion.
Algolia’s documentation specifies that each API key has a request‑per‑second limit that varies by plan tier, but the exact threshold is not publicly listed and can change with plan upgrades. Client libraries maintain a connection pool; when it becomes saturated, requests may fail before reaching Algolia servers, yet the response format can mimic a 429.
Retry-After header reliably populated for both scenarios, and should back‑off logic treat them identically?32775 reputation · 22 May 2020, 17:59 UTC
Algolia does not provide a specific unique header to distinguish its server-side rate limits from client-side connection issues because, by definition, a true HTTP 429 Too Many Requests is a server-side response. If your application receives a valid HTTP 429, the request successfully reached Algolia's infrastructure, and the server rejected it due to API key quota exhaustion.
It is important to distinguish between a server-generated 429 and a client-side failure that mimics one. In most standard client libraries, connection pool exhaustion does not return an HTTP status code because the request never leaves the client; instead, it throws a local exception (such as a ConnectionPoolTimeoutException or a socket timeout).
However, if you are using a proxy, API gateway, or specific middleware, that intermediary may intercept a local timeout and wrap it in a generic 429 response. To differentiate these, use the following logic:
Retry-After header. These events are logged in the Algolia Dashboard.Retry-After header is present because no server responded. These events will not appear in the Algolia Dashboard monitoring tools.Retry-After header. Algolia uses this to signal server-side throttling. Its absence during a 429 strongly suggests a proxy or middleware is generating the error.You should not treat these scenarios identically:
Retry-After header to avoid further throttling.Missing Diagnostic Detail: Are you utilizing an intermediary proxy or API gateway between your client and Algolia? This significantly changes whether a 429 can originate from outside Algolia's servers.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.