Docs / Reference

Limits

Lifetimes, rate limits, per-network caps, stack size, Postgres, timeouts, log sizes, the crash-loop rule and retention.

The limits AgentServe applies to stacks, requests and accounts.

Anonymous stacks#

LimitValue
Lifetime of an unclaimed stack1h
Shortest TTL accepted15m
stack.expiring notice5m before expiry
Unclaimed stacks building or live per IP3
Snapshot retention after expiry7 days
  • A stack's lifetime is set when it is created, from the request's ttl, then the manifest's, then the default. agentserve extend sets a new expiry counted from now; extensions are capped relative to the stack's creation time, and a request past the cap returns 422 with the latest possible expiry.
  • The per-IP cap counts unclaimed stacks whose status is building or live. Expired, failed, deleted and claimed stacks don't count. Over the cap, creates return 429 N unclaimed stacks are already running from your network (limit 3); destroy or claim one first.
  • Claimed stacks and stacks created with an API key have no TTL and don't count toward the per-IP cap.

Rate limits#

WhatLimitKey
Anonymous POST /v0/stacks30 per hourclient IP
POST /v0/claim10 per minuteclient IP
POST /report10 per hourclient IP
Password forms: sign-in, sign-up and the claim form10 per minute, shared across the threeclient IP

Over a limit, the server returns 429 with {"detail": "too many requests; slow down and retry in a minute"} and a Retry-After header set to the window length: 3600 for creates, 60 for the others. Creates with an API key are not rate limited. The windows are sliding.

Stack size#

LimitValue
Services per stack4
Upload size (the compressed archive)50 MB
Service name20 characters, [a-z][a-z0-9]*

The service limit applies to every stack, claimed or not. A larger upload returns 413. Each stack gets 2 GB of disk (dependencies, builds and data together); each service 512 MB of memory and half a CPU.

Outbound traffic#

LimitValue, per stack
New connections off the server20 a second, bursts of 100
Data sent off the server2 MB a second, bursts of 10 MB
SMTP (port 25)refused: send email through an API
Private networks and the metadata serverunreachable

A connection over the limit is refused (ECONNREFUSED); packets over the byte rate are dropped, which TCP sees as a slow link. Incoming traffic is not limited.

Postgres beta#

For stacks with addons: [postgres]. These limits may change while the add-on is in beta.

LimitValue, per stack
Databases1
Size512 MB
Connections open at once20
Stopped when nothing is connected forabout a minute; the next connection starts it in about a second
  • The size is what Postgres counts (pg_database_size of every database in the instance, an empty one's few tens of MB included), checked every few seconds. Over it, the database turns read-only: open sessions are ended, and writes fail with cannot execute INSERT in a read-only transaction. Reads still work.
  • To get under the limit again, drop what you no longer need from a session that turns read-only off first, as a statement of its own: SET default_transaction_read_only = off; then DROP TABLE … or TRUNCATE …. DELETE frees no space until a VACUUM FULL. Within a few seconds of being back under, the database is writable again.
  • Past the size there is a hard limit on disk, a little above it, that no session can turn off.
  • A connection past the limit is refused with too many connections to database <id> (limit 20). Keep a service's pool well under it, since every replica and build step counts too.
  • Connections to the database leave the server, so they count toward the outbound limits above.
  • A database on its own is a stack, and counts as one toward the anonymous limits. While its stack is expired it accepts no connections.

Timeouts#

LimitValue
Each build command (install, build)600 s
?wait=true on the API90 s; poll again if the stack is still building
Health check after start60 s
Proxied request to a service60 s, 5 s to connect
WebSocket handshake to a service10 s
Webhook delivery attempt5 s
Builds running at the same time, server-wide4

The build timeout applies to each command separately, not to the whole build. When ?wait=true runs out, the response returns the stack as it is, usually still building.

WebSockets#

A service takes WebSockets at its own URL, as wss://, on the port it already listens on. The visitor's Host, Origin, cookies and subprotocols reach it as they were sent. Static services don't take them. A connection stays open as long as both ends keep it, with pings every 20 s, so it doesn't need keepalive messages of its own.

LimitValue
Message size, either way4 MB
Open WebSockets per stack200; the next handshake gets a 429

A stack that isn't serving refuses the handshake with the status a plain request would get: 503 while it builds, 410 once it expired. Expiry, a redeploy or a restart ends open connections, so clients should reconnect.

Logs and events#

LimitValue
Runtime log per service5 MB, then rotated to <service>.run.log.1. One rotated copy is kept. The API and CLI read only the current file.
Build log per serviceOverwritten by every build; only the latest build's log exists.
Log lines returnedtail per service: default 200 from the API and MCP, 100 from the CLI.
Events per request200. Page with after.
Error texterror and deploy_error keep the last 4,000 characters; event payloads the last 1,000.

Logs are deleted with the stack. Event rows stay in the server's database, but a deleted stack's events can no longer be read through the API.

Crash loops#

While a stack is live, the supervisor checks its processes about every 2 seconds. A process that exited is restarted after a backoff of 1, 2, 4, 8 and 16 seconds for successive crashes (capped at 30 seconds), with a service.crashed event before and service.restarted after.

The crash count is per service, over a sliding 10-minute window. On the 6th crash within 10 minutes (more than 5), the whole stack is stopped and marked failed with an error such as api crashed 6 times in 10 min (last exit code 1); check its logs and redeploy. A failed stack serves an error page until it is redeployed. A restart that doesn't become healthy counts as another crash. The count resets after a successful deploy or restore, and when a service is restarted from the dashboard.

Retention#

  • When an unclaimed stack expires, its processes stop. Its built services, logs and every service's $DATA_DIR are kept as a snapshot for 7 days (retained_until in the stack object).
  • Claiming during that time restores the stack without a rebuild, at the same URLs and with its data.
  • A stack's Postgres database is kept the same way, and dropped with the stack.
  • When the 7 days are over, the stack is deleted with everything in it, and stack.deleted fires.
  • Only the generation being served is kept on disk. Older generations are removed after each successful deploy or rollback, so there is no way to roll back to them later.
  • Claimed stacks are kept until their owner deletes them.

Accounts#

LimitValue
Password lengthAt least 8 characters.
Dashboard session30 days.
API keys per accountOne. Rotating it invalidates the previous key.
Stuck? Your agent can read /skill.md, or connect it over MCP.