Could you please tell how to reset mongodb cache to make sure that results of query are not from cache? Now I try to do it rebooting server: sudo reboot. Is there any other way? Thank you.
Following user366534's comment, do this:
MongoDB itself doesn't handle the caching. Instead, it's taken care of by the OS's virtual memory manager, as MongoDB uses Memory Mapped files. See: Mongodb.org
I'm no Linux guru, but for dev purposes when I wanted to ensure a completely clean cache, I did a reboot as that seemed to be what made the difference.
I'm assuming you want to do this for dev/performance testing reasons rather than for production purposes too...
Update:
Check out this link: http://www.linuxask.com/questions/how-to-clear-cache-from-memory-in-linux
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With