PHP Driver
  1. PHP Driver
  2. PHP-294

Count commands not going to slaves

    Details

    • Operating System:
      Linux
    • # Replies:
      12
    • Last comment by Customer:
      false

      Description

      The PHP driver appears to send all commands to the master server, regardless of whether the command could be run on a slave. Here is a summary of slow queries on a slave vs. the master:

      Slow Queries by Incidence Count (slave)

      401 query master.stream ntoreturn:n nscanned:n scanAndOrder:n reslen:n reslen:n
      282 query master.users ntoreturn:n nscanned:n nreturned:n reslen:n reslen:n
      119 query master.keeks ntoreturn:n nscanned:n nreturned:n reslen:n reslen:n
      56 query master.users ntoreturn:n nscanned:n reslen:n reslen:n
      44 query master.stream ntoreturn:n nscanned:n scanAndOrder:n nreturned:n reslen:n reslen:n

      Slow Queries by Incidence Count (master)

      4582 command master.$cmd command:n { count:n "x", query:n

      { active:n 1, $or:n [ "q","q" ] }

      } ntoreturn:n reslen:n reslen:n
      937 remove master.auth_users query:n

      { u_id:n "x" }

      }
      31 command master.$cmd command:n { count:n "x", query:n

      { stat:n 1 }

      } ntoreturn:n reslen:n reslen:n

      As you can see, the commands are sent to the master exclusively. This was noted by Kyle Banker as a possible issue with the PHP driver itself in his report on our slow query issues:

      https://jira.mongodb.org/browse/CS-1741

        Issue Links

          Activity

          Hide
          Kris van Waterschoot
          added a comment -

          I'm not able to get the hack above working. I receive the following error: 'Nesting level too deep - recursive dependency?'

          PHP driver 1.2.7 is still not counting on the slaves?

          Show
          Kris van Waterschoot
          added a comment - I'm not able to get the hack above working. I receive the following error: 'Nesting level too deep - recursive dependency?' PHP driver 1.2.7 is still not counting on the slaves?
          Hide
          Derick Rethans
          added a comment -

          Kris, that error seems unrelated to this issue as it's something that PHP shows when nesting array/object structures.

          Show
          Derick Rethans
          added a comment - Kris, that error seems unrelated to this issue as it's something that PHP shows when nesting array/object structures.
          Hide
          Kris van Waterschoot
          added a comment -

          Hi, I understand, but this is what the function returns.

          Is there another way to count on the slaves?

          Show
          Kris van Waterschoot
          added a comment - Hi, I understand, but this is what the function returns. Is there another way to count on the slaves?
          Hide
          Derick Rethans
          added a comment -

          I'm closing this as a duplicate of PHP-535 which deals with sending any command (such as count) to secondaries. We'll address this in an upcoming version. Please track PHP-535 if you want to be kept up to date.

          Show
          Derick Rethans
          added a comment - I'm closing this as a duplicate of PHP-535 which deals with sending any command (such as count) to secondaries. We'll address this in an upcoming version. Please track PHP-535 if you want to be kept up to date.
          Hide
          auto
          added a comment -

          Author:

          {u'date': u'2013-03-19T01:25:13Z', u'name': u'Hannes Magnusson', u'email': u'bjori@10gen.com'}

          Message: Merge Pull Request #329

          Show
          auto
          added a comment - Author: {u'date': u'2013-03-19T01:25:13Z', u'name': u'Hannes Magnusson', u'email': u'bjori@10gen.com'} Message: Merge Pull Request #329 pr/329: PHP-294 : Test for workaround on sending commands to secondaries Branch: master https://github.com/mongodb/mongo-php-driver/commit/27918c0f27631509535174c303131e90fd860b6d

            People

            • Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since reply:
                1 year, 5 weeks, 3 days ago
                Date of 1st Reply: