## To what size should I set the WiredTiger cache? 

The size of the cache should be sufficient to hold the entire working set for the mongod . If the cache does not have enough space to load additional data, WiredTiger evicts pages from the cache to free up space. 

To see statistics on the cache and eviction, use the serverStatus command. The cache field holds the information on the cache and eviction: 

... "wiredTiger" : { ... "cache" : { "tracked dirty bytes in the cache" : <num>, "bytes currently in the cache" : <num>, "maximum bytes configured" : <num>, "bytes read into cache" :<num>, "bytes written from cache" : <num>, "pages evicted by application threads" : <num>, "checkpoint blocked page eviction" : <num>, "unmodified pages evicted" : <num>, "page split during eviction deepened the tree" : <num>, "modified pages evicted" : <num>, "pages selected for eviction unable to be evicted" : <num>, "pages evicted because they exceeded the in-memory maximum" : <num>,, "pages evicted because they had chains of deleted items" : <num>, "failed eviction of pages that exceeded the in-memory maximum" : <num>, "hazard pointer blocked page eviction" : <num>, "internal pages evicted" : <num>, "maximum page size at eviction" : <num>, "eviction server candidate queue empty when topping up" : <num>, "eviction server candidate queue not empty when topping up" : <num>, "eviction server evicting pages" : <num>, "eviction server populating queue, but not evicting pages" : <num>, "eviction server unable to reach eviction goal" : <num>, "pages split during eviction" : <num>, "pages walked for eviction" : <num>, "eviction worker thread evicting pages" : <num>, "in-memory page splits" : <num>, "percentage overhead" : <num>, "tracked dirty pages in the cache" : <num>, "pages currently held in the cache" : <num>, "pages read into cache" : <num>, "pages written from cache" : <num>, }, ... 

To adjust the size of the WiredTiger cache, see storage.wiredTiger.engineConfig.cacheSizeGB and --wiredTigerCacheSizeGB . 

## 11.7.4 MMAPv1 Storage Engine 

## What are memory mapped files? 

A memory-mapped file is a file with data that the operating system places in memory by way of the mmap() system call. mmap() thus maps the file to a region of virtual memory. Memory-mapped files are the critical piece of the MMAPv1 storage engine in MongoDB. By using memory mapped files, MongoDB can treat the contents of its data files as if they were in memory. This provides MongoDB with an extremely fast and simple method for accessing and manipulating data. 

