From ae11423c75ee4044b9905d3843bcff8dd0256ff4 Mon Sep 17 00:00:00 2001 From: Chase Granberry Date: Fri, 9 Jun 2023 13:25:39 -0700 Subject: [PATCH] fix: Realtime "rate limits" to "quotas" --- .../NavigationMenu.constants.ts | 2 +- .../pages/guides/platform/going-into-prod.mdx | 6 +- .../guides/realtime/extensions/broadcast.mdx | 2 +- .../guides/realtime/extensions/presence.mdx | 2 +- .../pages/guides/realtime/rate-limits.mdx | 77 +++++++++---------- apps/docs/public/sitemap.xml | 2 +- 6 files changed, 45 insertions(+), 46 deletions(-) diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts index 840c07ac2a0..18d9ae3c328 100644 --- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts +++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts @@ -833,7 +833,7 @@ export const realtime = { name: 'Deep dive', url: undefined, items: [ - { name: 'Rate Limits', url: '/guides/realtime/rate-limits' }, + { name: 'Quotas', url: '/guides/realtime/quotas' }, { name: 'Architecture', url: '/guides/realtime/architecture' }, { name: 'Protocol', url: '/guides/realtime/protocol' }, ], diff --git a/apps/docs/pages/guides/platform/going-into-prod.mdx b/apps/docs/pages/guides/platform/going-into-prod.mdx index 2e68fbb8998..2e1c11d4232 100644 --- a/apps/docs/pages/guides/platform/going-into-prod.mdx +++ b/apps/docs/pages/guides/platform/going-into-prod.mdx @@ -69,10 +69,10 @@ After developing your project and deciding it's Production Ready, you should run | Token refresh requests | `/auth/v1/token` | IP Address | 360 requests per hour (with bursts up to 30 requests) | | Create or Verify an MFA challenge | `/auth/v1/factors/:id/challenge` `/auth/v1/factors/:id/verify` | IP Address | 15 requests per minute (with bursts up to 30 requests) | -### Realtime Rate Limits +### Realtime Quotas -- Review the [Realtime rate limits](/docs/guides/realtime/rate-limits). -- If you need rate limits increased you can always [contact support](https://app.supabase.com/support/new). +- Review the [Realtime quotas](/docs/guides/realtime/quotas). +- If you need quotas increased you can always [contact support](https://app.supabase.com/support/new). ### Abuse Prevention diff --git a/apps/docs/pages/guides/realtime/extensions/broadcast.mdx b/apps/docs/pages/guides/realtime/extensions/broadcast.mdx index 6c9de742fd0..3a2120c1494 100644 --- a/apps/docs/pages/guides/realtime/extensions/broadcast.mdx +++ b/apps/docs/pages/guides/realtime/extensions/broadcast.mdx @@ -129,7 +129,7 @@ const supabase = createClient( By setting `eventsPerSecond` to 20, you can send one message every 50 milliseconds on a per client basis. -Learn more by visiting the [Rate Limits](/docs/guides/realtime/rate-limits) section. +Learn more by visiting the [Quotas](/docs/guides/realtime/quotas) section. export const Page = ({ children }) => diff --git a/apps/docs/pages/guides/realtime/extensions/presence.mdx b/apps/docs/pages/guides/realtime/extensions/presence.mdx index e938e74ca3d..940fafc0288 100644 --- a/apps/docs/pages/guides/realtime/extensions/presence.mdx +++ b/apps/docs/pages/guides/realtime/extensions/presence.mdx @@ -158,7 +158,7 @@ const supabase = createClient( By setting `eventsPerSecond` to 5, you can send one message every 200 milliseconds on a per client basis. -Learn more by visiting the [Rate Limits](/docs/guides/realtime/rate-limits) section. +Learn more by visiting the [Quotas](/docs/guides/realtime/quotas) section. export const Page = ({ children }) => diff --git a/apps/docs/pages/guides/realtime/rate-limits.mdx b/apps/docs/pages/guides/realtime/rate-limits.mdx index 8e2f6612cca..b0bf01259f3 100644 --- a/apps/docs/pages/guides/realtime/rate-limits.mdx +++ b/apps/docs/pages/guides/realtime/rate-limits.mdx @@ -1,25 +1,22 @@ import Layout from '~/layouts/DefaultGuideLayout' export const meta = { - id: 'rate-limits', - title: 'Realtime Rate Limits', - description: 'Understanding Realtime rate limiting', - sidebar_label: 'Rate Limits', + id: 'quotas', + title: 'Realtime Quotas', + description: 'Understanding Realtime quotas', + sidebar_label: 'Quotas', } -Supabase Realtime is a global cluster. We've implemented some rate limits to help ensure high availability for all customers. + + [Contact support](https://app.supabase.com/support/new) if you need your quotas increased. Quotas + are configurable per project and our cluster supports millions of concurrent connections. + -Rate limits are configurable per project and our cluster supports millions of concurrent connections. [Contact support](https://app.supabase.com/support/new) if these limits are causing issues. +## Quotas by Plan -## Rate Limits by Plan +You can increase your quotas by upgrading your plan and removing your spend cap. We still have a starting quota set even without a spend cap to protect your budget just in case. -Rate limits are different than usage limits. The usage limits for Free and Pro projects can be found on the See our [pricing page](https://supabase.com/pricing). - -Rate limits protect our infrasructure. You can increase your rate limits by upgrading your plan and removing your spend cap. - -If you need your rate limits increased further please [contact support](https://app.supabase.com/support/new). - -We have different rate limits per plan: +If you need your quotas increased further please [contact support](https://app.supabase.com/support/new). ### Free @@ -37,21 +34,21 @@ We have different rate limits per plan: Starts at: -- 5,000 concurrent clients -- 1,000 messages per second -- 1,000 Channel joins per second +- 10,000 concurrent clients +- 2,500 messages per second +- 2,500 Channel joins per second ### Enterprise Starts at: -- 5,000 concurrent clients -- 1,000 messages per second -- 1,000 Channel joins per second +- 10,000 concurrent clients +- 2,500 messages per second +- 2,500 Channel joins per second -## System Limits +## System Quotas -The following limits apply to all projects: +The following quotas apply to all projects: - 100 Channels per connected client @@ -61,50 +58,52 @@ Some basic WebSocket message rate limiting is implemented client-side. For example, the [multiplayer.dev demo](/docs/guides/realtime/quickstart#cursor-positions) instantiates the Supabase client with an `eventsPerSecond` parameter. -## Rate Limiting Errors +## Quota Errors -Rate limiting errors can appear in backend logs and messages in the WebSocket connection. +When you reach a quota errors can appear in backend logs and messages in the WebSocket connection. - -Use the [Realtime Inspector](https://realtime.supabase.com/inspector/new) to reproduce an error and share those connection details with Supabase support. - + Use the [Realtime Inspector](https://realtime.supabase.com/inspector/new) to reproduce an error + and share those connection details with Supabase support. ### Backend Logs -If your project is being rate limited, check your [Realtime logs](https://app.supabase.com/project/_/database/realtime-logs). +If your project is being limited by a quota, check your [Realtime logs](https://app.supabase.com/project/_/database/realtime-logs). ### WebSocket Errors -- `tenant_events`: Clients will be disconnected if your project is generating too many messages per second. `supabase-js` should reconnect automatically when the message rate decreases below your plan limit. +- `tenant_events`: Clients will be disconnected if your project is generating too many messages per second. `supabase-js` should reconnect automatically when the message throughput decreases below your plan quota. -Some limits can cause a Channel join to be refused. Realtime will reply with one of the following WebSocket messages: + + An `event` is a WebSocket message delivered to, or sent from a client. + + +Some quotas can cause a Channel join to be refused. Realtime will reply with one of the following WebSocket messages: - `too_many_channels`: Too many channels currently joined for a single client. - `too_many_connections`: Too many total concurrent connections for a project. - `too_many_joins`: Too many Channel joins per second. - -Use your browser's developer tools to find the WebSocket initiation request and view individual messages. - + Use your browser's developer tools to find the WebSocket initiation request and view individual + messages. -## Postgres Changes Payload Limit +## Postgres Changes Payload Quota -Realtime Postgres Changes has a change payload size limit of 1 mebibyte (MiB). +Realtime Postgres Changes has a change payload size quota of 1 mebibyte (MiB). -When this limit is reached, the `new` and `old` record payloads only include the fields with a value size of less than or equal to 64 bytes. +When this quota is reached, the `new` and `old` record payloads only include the fields with a value size of less than or equal to 64 bytes. -## Presence Limits +## Presence Quotas Realtime Presence is a CRDT backed in-memory key value store based on Phoenix Presence. It's more expensive to update a Presence than Broadcast a message. -The following limits apply to Presence messages: +The following quotas apply to Presence messages: - 10 keys per object -- Message rate limit is 10% of your Realtime message rate limit +- Message per second quota is 10% of your total Realtime message per second quota export const Page = ({ children }) => diff --git a/apps/docs/public/sitemap.xml b/apps/docs/public/sitemap.xml index 78ce4d811b9..5f0581f6054 100644 --- a/apps/docs/public/sitemap.xml +++ b/apps/docs/public/sitemap.xml @@ -775,7 +775,7 @@ - https://supabase.com/docs/guides/realtime/rate-limits + https://supabase.com/docs/guides/realtime/quotas weekly 0.5