Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stream-info-service: Avoid creating indexes and reduce pool size #2321

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

victorges
Copy link
Member

What does this pull request do? Explain your changes. (required)

Realized that every stream-info-service is trying to create all the DB tables and indexes on startup. Theoretically they return quickly as they already exist, but it still means we open up to 10 connections from each instance everytime a broadcaster pod starts (or the stream-info restarts).

This is hopefully what's been causing connection issues with Postgres just now.

Specific updates (required)

  • Add CLI args equivalent to main Studio app
    • Notice that the main difference is that by default we don't create indexes, and allow up to 5 connections with Postgres (instead of true/10 on main app)
  • Use new args when initializing db client

How did you test each of these updates (required)
Config change only that reduces load and reuses already tested code in production on main app.
Will just test on staging and send to prod at a safe time.

Does this pull request close any open issues?
Related to PS-842

Checklist

  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

Realized that every stream-info-service is trying to create all
the DB tables and indexes on startup. Theoretically they return
quickly as they already exist, but it still means we open up to
10 connections from each instance everytime a broadcaster pod
starts (or the stream-info restarts).

This is hopefully what's been causing connection issues with Postgres
just now.
@victorges victorges requested a review from a team as a code owner October 9, 2024 21:30
Copy link

linear bot commented Oct 9, 2024

Copy link

vercel bot commented Oct 9, 2024

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 Oct 9, 2024 9:30pm

@victorges victorges merged commit 9d69521 into master Oct 9, 2024
8 checks passed
@victorges victorges deleted the vg/fix/stream-info-indexes branch October 9, 2024 21:43
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.

2 participants