Skip to content

Commit

Permalink
reads better like this
Browse files Browse the repository at this point in the history
  • Loading branch information
kiwicopple committed Sep 11, 2023
1 parent e418a60 commit 2477b89
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions apps/docs/pages/guides/realtime/guides/client-side-throttling.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,7 @@ export const meta = {
subtitle: 'Use client-side throttling to manage message frequency.',
}

You should always consider optimizing the performance of you realtime system.

## Project Quotas

Each Broadcast and Presence message counts towards your [Project Quotas](/docs/guides/realtime/quotas).

It's common to unintentionally flood the Realtime service with messages. For example, tracking mouse movents without throttling would send hundreds of events per second. It's rare that you need so many messages. Updating a mouse movement even a few times per second is usually enough for the human eye.

The Supabase client includes a configurable throttling parameter to protect against these unintended floods.

## Default client throttling

By default the Supabase clients throttles messages to 10 messages per-second (1 message every 100 milliseconds). This is a soft-limit provided as a safe-guard when you're getting started. You'll rarely need to send more messages than this.

Each client has their own throttling behavior. For example, if you instantiate two clients, by default you would send 20 messages per-second to your project.
The Supabase clients include functionality for throttling messages.

## Managing client-side throttling

Expand All @@ -42,6 +28,20 @@ const supabase = createClient(SUPABASE_URL, SUPABASE_ANON_KEY, {
})
```

## Default client throttling

By default the Supabase clients throttles messages to 10 messages per-second (1 message every 100 milliseconds). This is a soft-limit provided as a safe-guard when you're getting started. You'll rarely need to send more messages than this.

Each client has their own throttling behavior. If you instantiate two clients, by default you would send 20 messages per-second to your project.

## Project Quotas

Each Broadcast and Presence message counts towards your [Project Quotas](/docs/guides/realtime/quotas).

It's common to unintentionally flood the Realtime service with messages. For example, tracking mouse movents without throttling would send hundreds of events per second. It's rare that you need so many messages. Updating a mouse movement even a few times per second is usually enough for the human eye.

The throttling parameter protects against these unintended floods.

export const Page = ({ children }) => <Layout meta={meta} children={children} />

export default Page

0 comments on commit 2477b89

Please sign in to comment.