Easy way to limit mongo memory usage?
yahiabakour
PROOP

2 years ago

Hey everyone,

I'm noticing a very high usage bill because i can't customize my machine max memory and can't limit mongo memory usage via the wiredtiger cache flags.

Any ideas?

Solved

7 Replies


yahiabakour
PROOP

2 years ago

@brody

  1. i wrote that other thread lol

  2. the solution doesnt work for long, it looked like it did because i restarted the db


2 years ago

  1. Wow that funny at my expense.

  2. I assume that was a flag you appended to the start command?


yahiabakour
PROOP

2 years ago

yes, I've tried this before, doesn't seem to work long term:

--wiredTigerCacheSizeGB 5

2 years ago

Could it be that mongo does simply need more memory?


yahiabakour
PROOP

2 years ago

I don't believe that's the case, it shouldn't need 30G+ of memory and runs fine with just a few GB and then slowly ramps up over the day.

With mongo im just running the default docker image without any modifications etc...

Ideally i'd love a way to limit machine memory instead of arbitrary 32GB limit.


2 years ago

I get many many reports of Mongo crashing on the trial plan, so a container limit is likely not what you want since I can't imagine you would be okay with your database crashing every time it reaches 5GB.

Do some more research on how you would tell Mongo to use less memory, and I'd be happy to try and help you apply what you found to your database on Railway.


Status changed to Solved angelo-railway over 1 year ago


Loading...