Skip to content

Comments

rafal/fix-slow-multistream-delete#2332

Closed
leszko wants to merge 1 commit intomasterfrom
rafal/fix-slow-multistream-delete
Closed

rafal/fix-slow-multistream-delete#2332
leszko wants to merge 1 commit intomasterfrom
rafal/fix-slow-multistream-delete

Conversation

@leszko
Copy link
Contributor

@leszko leszko commented Apr 7, 2025

We have a problem with PATCH/DELETE multistream target. The issue is that when user has a lot of streams, then this becomes a very DB-heavy request.

The proposed workaround is to skip notifying Catalyst about the multistream update in case of not passing by the user a helper streamId or playbackId as query param. So it will work right now this way:

  1. If user does not change anything in their API usage, then the Catalyst will not be notified about the multistream delete or patch => Then their multistream will be refreshed only after 30s (instead of instant refresh)
  2. If user updates their API call to include streamId or playbackId in the query params, then it will work as before.
    • Now: DELETE /api/multistream/target/fabb8085-5d71-4807-919e-abd7410f051b
    • After: DELETE /api/multistream/target/fabb8085-5d71-4807-919e-abd7410f051b?streamId=abcdef

The root cause is our studio DB architecture and the design decision that 1 multistream can be related to multiple streams. This with comparison with storing everything as JSON and multiple target in a single stream creates the issue: we can only use GIN index, which happens to be too slow with the number of streams users have.

@leszko leszko requested a review from a team as a code owner April 7, 2025 12:29
@vercel
Copy link

vercel bot commented Apr 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
livepeer-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 7, 2025 0:31am

@leszko
Copy link
Contributor Author

leszko commented Apr 10, 2025

Closing this one, since @victorges found a better solution here: #2333

@leszko leszko closed this Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants