1

I installed Redis in my machine for a project with Rails. Now I have to build the environment for another project in Rails, but this one is using MongoDB.

I saw that MongoDB shouldn't be installed together with Redis. But, if I use each for different projects, can I have both installed?

Should I stop Redis when MongoDB is starting? It is necessary?

the Tin Man
  • 150,910
  • 39
  • 198
  • 279
Luismiv85
  • 50
  • 1
  • 10
  • I recommend you use a spelling checker. – the Tin Man Jan 24 '14 at 16:19
  • Could you please provide us with the link that sais, that mongo and redis should not run on the same machine!? – heinob Jan 24 '14 at 17:03
  • Yes, sure. You can see it here [link](http://stackoverflow.com/a/10721249/2385600) – Luismiv85 Jan 24 '14 at 18:27
  • It sounds pretty logical. But how would you go about stopping one and starting the other? What kind of project are you talking about? It sounds like it's web-related and I don't see how you would stop the underlying data structure for a web app when no-one is using it. – simbabque Jan 24 '14 at 19:42
  • Well, they are two diferents projects, so I will be working with one, no with both at the same time. So I thought stop Redis when I work with MongoDB, but I don't know if that is a good solution. This will be for a developer enviorement :) – Luismiv85 Jan 24 '14 at 20:56
  • By the way, sorry for my English skills. – Luismiv85 Jan 25 '14 at 00:17

1 Answers1

1

You should not run Redis and MongoDB on the same machine for production environment, because if Redis memory is swapped out, its performance will be abysmal.

For development or test systems, it should not be a problem (except if you plan to run performance testing).

If you stop MongoDB when you use Redis, you will have no issue.

Note that Redis and MongoDB can be run on the same machine without problems if the addition of their respective data fit in memory, or if you can limit the memory consumption of MongoDB in some way (for instance by using containers, cgroups, numa bindings, etc ...).

Didier Spezia
  • 63,324
  • 10
  • 166
  • 145
  • Great!! Thanks so much! One question more, just for curiosity, do you know how many ram memory I should have for running both at the same time? At the moment, I have to work in developer enviornment and every project will be hosted in differents servers, but it is good to know it! Thanks again. – Luismiv85 Jan 25 '14 at 00:04
  • It depends on your data. The more data, the more ram. With Redis you can use the info command to see how much ram it takes for your data. With MongoDB, you can use the collstats command on your collections. – Didier Spezia Jan 25 '14 at 09:02