Skip to content

Conversation

@Schniz
Copy link
Collaborator

@Schniz Schniz commented Nov 30, 2025

turns out pg-boss is not using LISTEN/NOTIFY, which makes it a polling
queue management system. This means we need to tune the polling interval. The minimum is 0.5s,
so I set it like so. I believe this shows we need to drop pg-boss altogether.

@Schniz Schniz self-assigned this Nov 30, 2025
@changeset-bot
Copy link

changeset-bot bot commented Nov 30, 2025

🦋 Changeset detected

Latest commit: f9f0a8f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@workflow/world-postgres Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Contributor

vercel bot commented Nov 30, 2025

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

Project Deployment Preview Comments Updated (UTC)
example-nextjs-workflow-turbopack Ready Ready Preview Comment Nov 30, 2025 4:50pm
example-nextjs-workflow-webpack Ready Ready Preview Comment Nov 30, 2025 4:50pm
example-workflow Ready Ready Preview Comment Nov 30, 2025 4:50pm
workbench-express-workflow Ready Ready Preview Comment Nov 30, 2025 4:50pm
workbench-hono-workflow Ready Ready Preview Comment Nov 30, 2025 4:50pm
workbench-nitro-workflow Ready Ready Preview Comment Nov 30, 2025 4:50pm
workbench-nuxt-workflow Ready Ready Preview Comment Nov 30, 2025 4:50pm
workbench-sveltekit-workflow Ready Ready Preview Comment Nov 30, 2025 4:50pm
workbench-vite-workflow Ready Ready Preview Comment Nov 30, 2025 4:50pm
workflow-docs Ready Ready Preview Comment Nov 30, 2025 4:50pm

@github-actions
Copy link
Contributor

github-actions bot commented Nov 30, 2025

No benchmark result files found in benchmark-results

@Schniz Schniz marked this pull request as ready for review November 30, 2025 14:08
turns out pg-boss is not using LISTEN/NOTIFY with Postgres, which makes it a polling
queue management system. This means we need to tune the polling interval. The minimum is 0.5s,
so I set it like so. I believe this shows we need to drop pg-boss altogether.

Signed-off-by: Gal Schlezinger <[email protected]>
Signed-off-by: Gal Schlezinger <[email protected]>
@alex-holovach
Copy link
Contributor

Since LISTEN/NOTIFY was requested in 2017 but never implemented, might be worth considering Graphile Worker which uses it natively:

Graphile Worker benchmarks show it's able to handle ~2.6ms avg latency while processing ~11,800 jobs/sec

The public API wouldn't change since it's internal to world-postgres. However, it would be a breaking change for users already running pg-boss in production (different DB schema, existing jobs won't migrate). Would need a major version bump with migration docs.

Thoughts?

Would be happy to work on this

@alex-holovach
Copy link
Contributor

Just noticed #332 introduces a QueueDriver abstraction that would make adding Graphile Worker much cleaner. Instead of replacing pg-boss entirely, it could be added as an alternative driver

@VaguelySerious
Copy link
Member

@alex-holovach Good thinking. I'll ping the author of #332 to see if they want to continue on their solution. In the meantime, I'll merge this PR.
Long-term we want something with minimal latency between jobs, which is also easy to set up for production environments. I haven't looked too hard at whether Graphile Worker will get us there

@VaguelySerious VaguelySerious merged commit ef8e0e5 into main Nov 30, 2025
26 of 101 checks passed
@VaguelySerious VaguelySerious deleted the schniz/poll-faster-in-pg-boss branch November 30, 2025 17:45
@Schniz
Copy link
Collaborator Author

Schniz commented Dec 1, 2025

@alex-holovach Since LISTEN/NOTIFY was requested in 2017 but never implemented, might be worth considering Graphile Worker

:same-team-hdr: :+1_plus-one:

i just used pg boss because it seemed to be more widely used, but indeed a bad decision on my part: @copilot

image

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.

4 participants