Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-2133

Extra Mongoid ismaster commands

    • Type: Icon: Task Task
    • Resolution: Done
    • 3.0.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      I was looking through the debug logs to try to figure out why my code is a bit slow for a simple task. I noticed that on every request that mongoid/moped is checking for who the master server is. Is this required for every request, and is it possible to cache what it thinks the master is? Also, it seems to be doing this twice for every server (notice the request times are different)

      Here is the log: (3.0.0.rc)

      MOPED: mongo0.XXX.com:27017 COMMAND database=admin command={:ismaster=>1} (0.1ms)
      MOPED: mongo0.XXX.com:27017 COMMAND database=admin command={:ismaster=>1} (0.3ms)
      MOPED: mongo1.XXX.com:27017 COMMAND database=admin command={:ismaster=>1} (0.1ms)
      MOPED: mongo1.XXX.com:27017 COMMAND database=admin command={:ismaster=>1} (1.1ms)
      MOPED: mongo2.XXX.com:27017 COMMAND database=admin command={:ismaster=>1} (0.1ms)
      MOPED: mongo2.XXX.com:27017 COMMAND database=admin command={:ismaster=>1} (0.2ms)
      MOPED: mongo2.XXX.com:27017 QUERY database=rails collection=events selector=

      {"code"=>"230HH"}

      flags=[:slave_ok] limit=-1 skip=0 fields=nil(0.1ms)

      Started GET "/230HH.json" for 127.0.0.1 at 2012-06-21 18:09:34 -0400
      Processing by EventsController#show as JSON
      Parameters:

      {"id"=>"230HH"}

      Completed 200 OK in 1688ms (Views: 0.0ms)

            Assignee:
            Unassigned Unassigned
            Reporter:
            HarrisonW HarrisonW [X]
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: