// libSQL error reference

429 Too Many Requests: request rate limit hit

Turso throttles request rate with 429: back off and retry and it clears, while billing quota exhaustion surfaces as the BLOCKED error code instead.

Error
429 Too Many Requests
Categoría
Remote server and Hrana errors
Mensaje de error
Server returned HTTP status 429 Too Many Requests

Qué significa

Turso throttles bursts of requests with 429. It is a short-term signal: back off and retry, and it clears. Quota exhaustion is different: the docs say exceeding the monthly row-read, row-write, or storage quota fails with the BLOCKED error code, and Turso's response-code reference does not list 429 at all. So a 429 points at request rate, not at billing.

Causas comunes

  • More concurrent requests than the plan allows, often from a connection pool sized for a different database.
  • A retry loop with no backoff turning one slow request into a storm.
  • Monthly quota exhaustion, but that surfaces as BLOCKED, not 429, so check usage before assuming quota.
  • A batch job and live traffic sharing one database with no limit on either side.

Find the cause

Check `turso plan show` and `turso db inspect mydb` first: quotas that are exhausted show up as `BLOCKED` rather than 429, so a real 429 is about request rate. Look at how many concurrent clients and retries hit the database in the seconds before the error, and count how many connections your pool opens. A retry loop that fires on every failure with no delay is the classic cause.

Cómo solucionarlo

  1. Retry the request with exponential backoff and honor any Retry-After header:

    // retry on 429 with backoff
    for (let i = 0; i < 5; i++) {
      try { return await db.execute(sql); }
      catch (e) {
        if (!String(e).includes('429') || i === 4) throw e;
        await new Promise(r => setTimeout(r, 500 * 2 ** i));
      }
    }
  2. Cap the connection pool so live traffic cannot starve the limit:

    // @libsql/client: reuse one client, do not create one per request
    const db = createClient({ url: process.env.LIBSQL_URL, authToken: process.env.LIBSQL_TOKEN });
  3. Check current usage against the plan's limits:

    turso plan show
    turso db inspect mydb
  4. Collapse many small statements into one batch to cut request count:

    await db.batch([
      { sql: "INSERT INTO t (a) VALUES (?)", args: [1] },
      { sql: "INSERT INTO t (a) VALUES (?)", args: [2] }
    ]);

Other ways to handle it

Move read-heavy work to an embedded replica, which reads a local file and sends no requests. Move bursty writes into batches. If you are permanently above the quota, change plan instead of masking 429s with retries. If usage itself is the problem, the error will be BLOCKED, and no retry pattern helps until the quota resets or the plan changes.

Reprodúcelo de forma segura

Reproducing 429 honestly needs a real database and enough traffic to trip the limit, which I would not run against a production database. The shape is easy to demonstrate though: fire a few hundred parallel requests from a loop at one test database with @libsql/client until the server answers 429. Local `turso dev` has no rate limiter, so it cannot reproduce it.

Preguntas

Why do I get BLOCKED instead of 429 on Turso?

Quota exhaustion (monthly row reads, row writes, or storage) fails with the BLOCKED error code per Turso's usage docs. 429 is the burst request-rate signal. Check turso plan show to see which one you hit.

How do I check my current Turso usage and limits?

turso plan show prints the current plan usage and limits, and turso db inspect <db> shows a database's rows read, rows written, and space used. turso org billing opens the billing portal.

Does retrying fix a 429 from Turso?

Only when it is request rate: back off exponentially, honor Retry-After if present, and cap concurrent clients. If the real problem is an exhausted quota the error is BLOCKED, and retries change nothing until the reset or an upgrade.

Errores relacionados

More remote server and hrana errors errors

El código y el texto del mensaje son de libSQL / Turso documentation. Explora la lista completa de libSQL error list o buscar cada error de base de datos.

// menos errores, correcciones más rápidas

Work on libSQL in SQLly

A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for libSQL and the other databases you use.

Texto y datos de esta página: CC BY 4.0, con atribución a SQLly (sqlly.app). Código y fragmentos SQL: MIT. Detalles de la licencia El texto citado de los mensajes de error pertenece a su proveedor de base de datos.