Skip to content

Conversation

psincraian
Copy link
Contributor

@psincraian psincraian commented Oct 3, 2025

We should be fine to deploy this PR:

  • Postgres has a limit of 400 connections ref and we are using ~80
  • Redis has a limit of 1k connections. We are only using ~220.

Copy link

vercel bot commented Oct 3, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
polar Ignored Ignored Preview Oct 3, 2025 3:13pm
polar-sandbox Ignored Ignored Preview Oct 3, 2025 3:13pm

@psincraian psincraian marked this pull request as ready for review October 3, 2025 15:02
Copy link
Member

@frankie567 frankie567 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small thing regarding the scheduler, but otherwise great job and approach 👍

name: Registry Credentials (by fvoron)
plan: pro
dockerCommand: uv run dramatiq -p 4 -t 8 -f polar.worker.scheduler:start polar.worker.run
dockerCommand: uv run dramatiq -p 2 -t 4 --queues default -f polar.worker.scheduler:start polar.worker.run
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't start the scheduler on both workers, otherwise we'll get duplicated jobs 🙂

Next stop would be to have a dedicated server just for the scheduler, so we can independently scale the worker horizontally

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha! Good catch

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scheduler is considered a high or normal/medium priority? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pushed to default queue for now

TaskQueue.HIGH_PRIORITY
if priority == TaskPriority.HIGH
else TaskQueue.DEFAULT
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clever! I like the idea that it's made transparently :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hate duplicated code :D

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