4
votes

In a sharded MongoDB configuration, is it recommended to run the mongos and config servers on the same machines? I would end up with 3 mongos and 3 config servers, achieving full redundancy with much less costs.

No. Not a good idea - you should run mongos on the same machines as your app servers.Asya Kamsky
@AsyaKamsky ...because...Philipp
Because it's a good idea to minimize network hops between app and data. Because number of mongos should depend on app server requirements and not tied to number of config servers which is fixed.Asya Kamsky
It's always possible to "move" the mongos to other servers if needed, isn't? What is more important: latency between mongos and config servers or latency between mongos and data servers?Vincent
The only answer to this same question on serverfault.SE says yes - the configsvr and mongos can be placed on the machine, and doing so is less likely to cause resource contention than placing either beside a data laden shard.WAF