Docs / Hosting OwnBase

Request limits

One caller is held to a fair share of sign-in attempts, messages, uploads, sockets and typing notices. Where there is an account to key on, the limit is keyed on the account rather than the address: an office reaches this server from a single NAT address, and everyone in it must not be sharing one person's allowance. Only the two limits that have no account yet — sign-in attempts and opening a socket — are keyed on the address, and both are deliberately loose.

Sign-in is rationed per handle as well, and tightly, because that is the limit an attacker actually meets. Only wrong guesses count: a correct password clears what the handle has spent, so someone who knows their own password never meets this however often they sign in or change it. A refused request answers 429 with a Retry-After telling the client when to come back, and nothing is charged for a refusal, so a client that retries too eagerly does not push its own recovery out.

Incoming webhooks have no account behind them, so each webhook has an allowance of its own (a burst of 30, then one a second) rather than spending a person's or starving the same app's other webhooks. Requests to /hooks/… are also counted per address before the token is looked up, loosely, so guessing tokens costs the same as using one. The workspace's icon can be read without an account, so it is counted per address, loosely (a burst of 120, then four a second), since each client fetches it once and keeps it. Slash commands, buttons and form submissions that call out to an app spend an allowance of the account that caused them (a burst of 20, then one a second), and at most four such calls per account and sixteen per app may be waiting for an answer at once. A call past either cap is refused with 429 straight away rather than queued behind a slow app, and nothing is sent to the app for a refused call.

Scheduled messages are bounded too: one account may have 200 waiting and the workspace 10,000, and past either the request is refused with 409 rather than queued. Messages that come due are sent ten at a time, with other requests served in between, and one held back (an archived channel, a lost membership, a deactivated author) is looked at again a minute later, or at the next check once the channel reopens, the membership returns or the account is reactivated.

The allowances are held in memory, so a restart grants one fresh burst. Buckets are dropped once they refill, which keeps the bookkeeping proportional to who is active rather than to everyone who has ever connected.

--no-rate-limits, or OWNBASE_RATE_LIMITS=off, turns all of this off. That is reasonable on a network where everyone is already trusted and unreasonable anywhere reachable from outside it. Bulk imports and seeding scripts are the usual reason to want it; prefer running those against a server started with the flag rather than raising the limits for everybody.

This page is made from docs/DEPLOYMENT.md.