Skip to content

Usage limits

A usage limit watches one metric of a deployment, such as function calls, over a day or a month. A warning limit tells your team when usage reaches it. A disable limit pauses the deployment, so its function calls fail.

proddeploymentserving callspaused1M calls: warning5M calls: disablemonth startsmonth endsproddeploymentserving callspaused1M calls: warning5M calls: disablemonth startsmonth ends
The warning limit only notifies. The disable limit pauses the deployment when usage reaches it.
yield* Convex.UsageLimit("Calls", {
deployment,
metric: "functionCalls",
window: "month",
limitType: "warning",
limit: 1_000_000,
});

window is day or month. A deployment has one limit per metric, window and type.

yield* Convex.UsageLimit("Stop", {
deployment,
metric: "functionCalls",
window: "month",
limitType: "disable",
limit: 5_000_000,
});

disable pauses the deployment when it reaches the limit.

yield* Convex.UsageLimit("Calls", {
deployment,
metric: "functionCalls",
window: "month",
limitType: "warning",
limit: 1_000_000,
enabled: false,
});