InterviewSolution
| 1. |
How can we configure 3 node replica sets in MongoDB? |
|
Answer» MongoDB wiredTiger storage engine uses both WiredTiger INTERNAL cache and FILE system cache for storing data. If we do not define wiredTiger internal cache by default it utilizes larger of either 256MB or 50% of (RAM - 1GB). For example, if a system has a total 0f 6GB RAM, so 2GB (50% 0f 6GB – 1 GB) will be allocated to wiredTiger internal cache. This default setting assumes that there is only one mongod process running. In case we have multiple mongodb instances on the server we should decrease the wiredTiger internal cache size to accommodate other instances. WiredTiger also provides compression options for both collections and indexes by default. While snappy compression is used for collections, prefix compression is used for all indexes. We can set the compression at the database as well as collection and index level. WiredTiger internal cache and filesystem cache differs in terms of data REPRESENTATION from on-disk format.
All free memory that is not used by wiredTiger cache or by any other process is automatically used by MongoDB filesystem cache. |
|