How to reset mongodb cache

Could you tell me how to reset mongodb cache to make sure that the query results are not from the cache? Now I'm trying to reboot the server: reboot sudo. Is there any other way? Thank.

+3
source share
2 answers

Following user comment 366534 do the following:

  • stop mongod
  • sh -c "sync; echo 3> / proc / sys / vm / drop_caches"
  • start mongod
+5
source

MongoDB itself does not handle caching. Instead, he took care of the OS virtual memory manager, since MongoDB uses memory files. See: Mongodb.org

Linux, dev, , , , .

, dev/performance, ...

:
: http://www.linuxask.com/questions/how-to-clear-cache-from-memory-in-linux

+3

All Articles