Skip to content

Multiple hosts, failover and load balancing #732

Closed

Description

@roji

Sub-issues:

Further improvements are tracked in #3613.

Resources:

Activity

  1. changed the title [-]Allow specifying multiple hosts/ports for connecting[/-] [+]Failover connections[/+] on May 4, 2016
  2. added this to the 3.2 milestone on May 4, 2016
  3. modified the milestone: 3.2 on Sep 24, 2016
  4. roji commented on Oct 11, 2016

    @roji
    MemberAuthor

    Also support multi-master scenarios such as BDR?

  5. day01 commented on Oct 25, 2016

    @day01

    What do you think about prepare availability set provider for connection string?
    One interface instead connection string. Lets developers decide which method should be used (failover, bdr)

  6. roji commented on Oct 25, 2016

    @roji
    MemberAuthor

    @day01 I'm not clear on what you mean, can you elaborate and provide examples?

    Regardless, this is probably not a feature that will make it into 3.2...

  7. changed the title [-]Failover connections[/-] [+]Multiple hosts in connection string[/+] on Feb 14, 2017
  8. added this to the milestone on Feb 14, 2017
  9. self-assigned this
    on Feb 14, 2017
  10. FlorianRainer commented on Mar 14, 2017

    @FlorianRainer
    Contributor

    It is possible to specify multiple host components, each with an optional port component, in a single URI. A URI of the form postgresql://host1:port1,host2:port2,host3:port3/ is equivalent to a connection string of the form host=host1,host2,host3 port=port1,port2,port3. Each host will be tried in turn until a connection is successfully established.

    Copied from https://www.postgresql.org/docs/devel/static/libpq-connect.html#libpq-connstring
    I think it must be something like a paralell TryToConnect for each host and the first successfully established connection will be used. A sequential check would wait to long if the host is not responding.

  11. roji commented on Mar 14, 2017

    @roji
    MemberAuthor

    I'll definitely be looking into this for 3.3.

  12. roji commented on Mar 14, 2017

    @roji
    MemberAuthor

    @FlorianRainer one thing though... the documentation you quote is pretty clear about the attempts being sequential and not parallel as you suggest. The problem with doing things in parallel, is that you'd be constantly overloading all the servers with connection requests (which are a pretty heavy thing), while only one will actually be retained. You'd also be generating lots of bogus connection errors at the backends.

  13. 50 remaining items

  14. mintsoft commented on Mar 13, 2021

    @mintsoft
    Contributor

    Awesome, thanks @vonzshik I'll take a look

  15. added a commit that references this issue on Mar 30, 2021
    f3a28b7
  16. linked a pull request that will close this issueA few fixes and additions for multiple hosts #3628on Apr 4, 2021
  17. linked a pull request that will close this issueImplemented load balancing for multiple hosts #3624on Apr 4, 2021
  18. changed the title [-]Multiple hosts in connection string[/-] [+]Multiple hosts, failover and load balancing[/+] on Apr 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions