Uploaded image for project: 'PHP Legacy Driver'
  1. PHP Legacy Driver
  2. PHP-1495

Driver does not remember when a member of a connection pool is down

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: 1.6.x
    • Fix Version/s: None
    • Component/s: pecl-mongo
    • Environment:
      Ubuntu 64 Bits
    • # Replies:
      18
    • Last comment by Customer:
      false

      Description

      Hello,

      I have this situation :
      One of my connection member is down (the server is down not only the mongo process)
      My php over apache uses this connection pattern to connect :
      mongodb://user:password@mongos1:27020,mongos2:27020
      or
      mongodb://user:password@member1:27017,member2:27017/rs1

      I set the connectTimeoutMS to 1000
      (I think that letting the default behavior to 60000 ms is a very bad idea, because when you have a member down, all apache workers get stuck ...)

      But if one of my members goes down, everytime I create a new MongoClient it takes one seconde to determine that the host is down.

      That means that when one of my servers goes down, all my web services are slowed down.

      Why the driver does not remember that a server is down and blacklist it for a while? Why does it have to retry to connect to it and lock the process everytime we allocate a new MongoClient ?

      I haven't find a workaround to fix this. Do you have an idea how to deal with it ?

      Thanks for your help,

      Thomas.

        Attachments

        1. mongo.log
          65 kB
        2. mongo2.log
          176 kB
        3. mongo3.log
          149 kB

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since reply:
                  3 years, 15 weeks ago
                  Date of 1st Reply: