Multiple MongoDB instances on same server

5,823

The reason Mongo/10Gen recommends against running multiple instances of Mongo on the same system has to do with resource availability assumptions. The mongod process assumes it's the only major tenant of the system, and running two such side-by-side will lead to overall worse performance than just running one mongod just with two databases.

Mongo is quite capable of running multiple databases under a single mongod process. These are discrete databases, just under a single master process. Each database handles its own authentication, which gives you separation. You'd run multiple mongod processes if you need different mongo versions for your products.

I'm not enough of an RDBMS DBA to know the best-practice arguments behind separating products by discrete database-binary processes, so I can't refute/assuage/talk-down each point. But as I understand it, accepted practice in Mongo environments is to have a separate database per product.

Share:
5,823

Related videos on Youtube

Banjer
Author by

Banjer

Musician and coder.

Updated on September 18, 2022

Comments

  • Banjer
    Banjer almost 2 years

    We set up a MongoDB development server on CentOS 6.3 and were able to separate different projects by using separate config files and rc scripts. Now we're looking at setting up a MongoDB production environment.

    I've read that it is not recommended to host multiple instances of MongoDB on the same server in production. Does that mean each project will need its own production MongoDB environment?

    These projects are not very "big" and so do not require a lot of resources, so it feels like we're jumping the gun by giving each its own host. Perhaps we just need to get our heads out of the RDBMS world.

    We will be monitoring our development server to see how it fares, but I'm looking for some insight and some of your own personal experience to supplement what I've read.

  • Nic Cottrell
    Nic Cottrell almost 11 years
    What about mixing a config server process and an arbiter on a single machine? I'm planning out a setup with 2 replica sets, each with 2 nodes and an arbiter and don't want t separate machine for each arbiter and config server if possible.
  • Deb
    Deb almost 11 years
    @NicholasTolleyCottrell The Mongo docs on arbiters says it right there: arbiters have minimal requirements. They can safely run along side a config server.
  • kommradHomer
    kommradHomer almost 8 years
    in my case , i had to run 3 instances on a single server , because it's recommended to have a replica set with at least 3 members , 2 real and 1 voter . So that's how we rolled for months before new servers were available to us .