-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
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=
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:
Completed 200 OK in 1688ms (Views: 0.0ms)