Skip to content

[Question] How does pg-boss ensure fair or random job selection for identical schedules? #685

@Yaman-kumarsahu

Description

@Yaman-kumarsahu

We have a use case where approximately 500 jobs are scheduled to start at the same time. For fairness, we prefer that job execution is not strictly ordered, but instead that instances are picked in a randomized way.

We’ve observed that jobs are currently triggered in a seemingly random order, which works well for our use case, and we’d like to preserve this behavior.

Is this randomness an intentional and stable part of pg-boss’s scheduling behavior, or could it change in future releases?

Additionally, is there a supported or recommended way to explicitly enforce randomized or fair job selection when many jobs share the same schedule?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions