0
0
MongoDBquery~20 mins

Memory and storage engine basics (WiredTiger) in MongoDB - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
WiredTiger Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
WiredTiger Cache Size Calculation
If a MongoDB instance uses the WiredTiger storage engine on a server with 16 GB of RAM, what is the default WiredTiger cache size allocated by MongoDB?
A4 GB (25% of RAM)
B12 GB (75% of RAM)
C8 GB (50% of RAM minus 1 GB)
D15 GB (almost all RAM)
Attempts:
2 left
💡 Hint
MongoDB reserves some RAM for the OS and other processes, so WiredTiger cache is less than total RAM.
query_result
intermediate
2:00remaining
WiredTiger Cache Usage Query Result
What is the output of this MongoDB command showing WiredTiger cache statistics? db.serverStatus().wiredTiger.cache
MongoDB
db.serverStatus().wiredTiger.cache
A{"bytes currently in the cache": 104857600, "maximum bytes configured": 8589934592, "tracked dirty bytes in the cache": 5242880}
B{"cache hits": 1000, "cache misses": 500, "cache evictions": 200}
C{"total pages read": 10000, "total pages written": 8000}
D{"connections current": 50, "connections available": 100}
Attempts:
2 left
💡 Hint
Look for cache size and bytes info in the WiredTiger cache stats.
📝 Syntax
advanced
2:00remaining
Correct WiredTiger Cache Size Configuration Syntax
Which of the following is the correct way to set WiredTiger cache size to 2 GB in the MongoDB configuration file (mongod.conf)?
A
storage:
  wiredTiger:
    engineConfig:
      cacheSizeGB: 2
B
storage:
  wiredTiger:
    cacheSizeGB: 2
C
wiredTiger:
  engineConfig:
    cacheSizeGB: 2
D
storage:
  engineConfig:
    wiredTiger:
      cacheSizeGB: 2
Attempts:
2 left
💡 Hint
Check the correct nesting of keys under storage and wiredTiger.
optimization
advanced
2:00remaining
Improving WiredTiger Write Performance
Which WiredTiger configuration option can improve write performance by reducing fsync frequency, but increases risk of data loss on crash?
AdirectoryForIndexes: true
BsyncPeriodSecs: 60
CcacheSizeGB: 4
DjournalCompressor: snappy
Attempts:
2 left
💡 Hint
Look for an option that controls how often data is flushed to disk.
🔧 Debug
expert
3:00remaining
Diagnosing WiredTiger Cache Pressure Issue
A MongoDB server using WiredTiger shows frequent cache pressure warnings and slow queries. Which of the following is the most likely cause?
AJournaling is disabled causing data loss
BThe database has too many indexes
CMongoDB is running on a single CPU core
DWiredTiger cache size is too small for the working set
Attempts:
2 left
💡 Hint
Cache pressure warnings relate to memory usage and cache eviction.