Skip to content

maxUses based on time instead of uses #51

Open
@intellix

Description

@intellix

So we're having the exact same problem that maxUses seems to describe and we're going to implement it (pgbouncer instances are getting 4/5 and 1/5 split of traffic).

It looks great but feels quite difficult to implement dynamically (especially since a server may be long lived, how do you dynamically update the maxUses option based on traffic and how do you even get that data?).

Wouldn't it be much easier to just reconnect every 30 minutes instead of counting uses of a connection?

I'm not too versed in how this library works, but looking at the maxUsesPerInstance code, I believe it would be as simple as a setInterval to swap a flag from false -> true and then calling destroy on release()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions