Hey! 👋

Whether you’re an experienced PHP developer, a beginner just starting your journey, or an enthusiast interested in understanding more about the world of PHP, this is the place for you. We are a community dedicated to sharing knowledge, discussing new trends, and solving problems related to PHP.

As members of this community, we expect everyone to respect each other and foster a positive environment. Please make sure your posts are relevant to PHP, and remember to be kind and considerate in your discussions. Let’s learn from each other and help each other grow.

Whether you’re here to ask questions or to share your knowledge, we’re excited to have you here. Let’s make the most of this community together!

Welcome to /c/php! 🐘

  • msage@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    1 year ago

    Can anyone here help me understand persistent PDO connections?

    So I set up Patroni cluster, everything works as expected. But during the failover/switchover PHP remembers connections to the failed node. And I can’t figure out why. Reloading FPM is kind of PitA.

    I will use PgBouncer. But I still would like to know how PHP works with the persistent connections.

    • thgs@beehaw.org
      link
      fedilink
      arrow-up
      0
      ·
      1 year ago

      I haven’t used persistent connections although I have been tempted in the past. I believe, if you haven’t used it before, it might come with more trouble than it solves.

      As an alternative I could propose using amphp (or maybe react PHP) which will let you handle a pool of connections in a single long running process. But it’s a bigger change really, the more I think of it.

      • msage@programming.dev
        link
        fedilink
        arrow-up
        0
        ·
        1 year ago

        Yeah, but any ‘single server’ PHP defeats the purpose of PHP, so I’m not a huge fan.

        I’ve used them in the past, and they work great, until you have to switchover to another node.