randombits
randombits

Reputation: 48440

Fitting MongoDB into system memory

How does one ensure that MongoDB reads data from memory instead of hitting disk? Is there a particular configuration that needs to take place to ensure this? is it something that automagically happens if the system has enough memory? How can I tell what's hitting disk i/o and what's hitting memory?

Upvotes: 1

Views: 127

Answers (1)

Scott Hernandez
Scott Hernandez

Reputation: 7590

Make sure you have enough memory for all your data and that the OS doesn't force any data out of memory. The OS will do this if you have any other programs running which access files or cause contention for memory.

You can watch mongostat faults to tell if disk is being hit.

There is no good way to tell what is faulting.

Upvotes: 3

Related Questions