Skip to content

Use load based strategy for selecting readonly connections #1862

@lutter

Description

@lutter

When using read replicas, we right now select the database for a connection in a round robin fashion. But since the primary will always have to do more work (indexing and serving subscriptions), the utilization of the read replica(s) will have a ceiling well short of 100%.

Instead of round-robin, we should select read replicas by using the pool with the smallest connection wait time as that is a decent proxy for database load.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions