Skip to Content

Self-Hosted Deployment

Set rate limits

Know the request limits of a self-hosted Databrain backend and change them with environment variables.

The backend limits how many requests one client can send in a time window. Over the limit, it answers 429 with a message such as Too many requests, please try again later. Each limit has an environment variable on the backend container.

The general limit

VariableDefaultWindowCounted per
RATE_LIMIT5002 minutesClient IP

Only a positive whole number turns this limit on. When RATE_LIMIT is not set, or is not a valid number, the backend only logs rate limit would block (log mode, RATE_LIMIT unset) and serves the request. Set it to enforce the limit:

RATE_LIMIT=500

Limits that are always on

VariableDefaultWindowCounted perApplies to
AUTH_ROUTE_RATE_LIMIT301 minuteRoute and IPSign-in, sign-up, MFA and session routes
REFRESH_ROUTE_RATE_LIMIT301 minuteSession and IPSession refresh
OTP_RATE_LIMIT501 minuteIPOne-time code checks
EMAIL_RATE_LIMIT501 minuteIPEmails sent from sign-up and CSV sharing
SIGN_IN_IP_FAILURE_LIMIT10015 minutesIPFailed sign-ins
SIGN_IN_ACCOUNT_FAILURE_LIMIT5015 minutesEmail addressFailed sign-ins
SIGN_IN_IP_EMAIL_FAILURE_LIMIT1015 minutesIP and email. Resets on a good sign-inFailed sign-ins
SIGN_IN_CODE_MAIL_LIMIT1015 minutesEmail addressSign-in codes sent
CRITICAL_DATASOURCE_RATE_LIMIT105 minutesAPI token’s company, else origin, else IPCreate, update, sync and schema calls on /api/v2/datasource
MCP_RATE_LIMIT301 minuteAPI token, else signed-in user, else IP/api/mcp calls from the MCP server
FILE_DOWNLOAD_RATE_LIMIT30015 minutesIPFile downloads
REPORT_ACCESS_RATE_LIMIT30015 minutesIPReport links
UNSUBSCRIBE_RATE_LIMIT30015 minutesIPUnsubscribe links

SIGN_IN_RATE_LIMIT_WINDOW_MS sets the 15-minute sign-in window in milliseconds. CRITICAL_DATASOURCE_RATE_LIMIT_WINDOW_MS, FILE_DOWNLOAD_RATE_LIMIT_WINDOW_MS, REPORT_ACCESS_RATE_LIMIT_WINDOW_MS and UNSUBSCRIBE_RATE_LIMIT_WINDOW_MS set the other windows the same way.

Behind a load balancer

The backend trusts one proxy hop and counts the IP that hop reports. Put exactly one load balancer or reverse proxy in front of the backend, and make it set X-Forwarded-For. With more hops, every client looks like the same IP and shares one limit.

Each backend container counts on its own. With three containers behind a load balancer, one client can send up to three times the limit.

If you hit a limit

  • People cannot sign in after a few tries. They hit a failed sign-in limit. Wait 15 minutes, or reset the password.
  • An integration gets 429 on datasource calls. It sends more than 10 create, update, sync or schema calls in 5 minutes. Space the calls out.
  • The MCP server answers “Too many MCP control-plane requests, please try later”. Wait a minute.

Wait for the window to end before you retry. Do not retry sign-in or email calls in a loop.