Trying to get my database optimized… I’m currently running MongoDB OpLog which is plenty fast, but, I have to run 3 instances.
EATS my RAM. I’m upwards of 20 gigs.
So I want to try Redis. So I’m thinking 1 MongoDB, 1 Redis? Should this use less RAM?
God damn I wish there was some STRAIGHT FORWARD directions on the ideal scalable database for Meteor. What a nightmare.
SOLUTION
No. Yes? Sort of. It turned out my OpLog was not configured right. I had the server running 3 replica set, that’s fine. But you need to set an addtional environment variable that tells the OpLog URL to look at /local, which is where the oplogging takes place!
I really wonder how you get upwards of 20GB. What is the total size of your db? What does db.stats() give you? What steps did you take so far for analysing/optimising your DB? In any case, you can limit cache size when using wired-tiger, maybe that would be the first thing to do.
No, you only need redis-oplog and not the MongoDB Oplog. But it seems like that there is something wrong with your database scheme our application layout unless you have thousands of concurrent users online.
I’m running 3 MongoDB instances in replica mode on the SAME virtual host. Trying to save money until the time comes to pay for things so thats why I’m self hosting.
For optimization, the subscriptions only load in the necessary data, which really hasn’t made much of a difference. That cache object size thing sounds pretty good.
I do notice that starting the server has low RAM, and after a day or two, she’s right full
I can confirm that setting a cache limit on each of the MongoDB Replicasets has fixed the issue! Hovering around 6gb of RAM used, which is about what I intended. Server stability is much improved as time goes on!!!
What’s the value of running a 3 member replica set on the same host? Why not run a 1 member replica set? (Data doesn’t get replicated, but you still get the oplog access you need.)
A one member replica set is all you need to get oplog access. That’ll save you some resources.
I was initially doing the same thing – running a 3 member set on a single host – but eventually realized there wasn’t much point to that, so stripped it down to 1 member, which works just fine.