MongoDB Questions and Answers – Optimization Strategies – 2

This set of MongoDB Quiz focuses on “Optimization Strategies – 2”.

1. With the _______ storage engine, MongoDB uses memory-mapped files to store data.
a) MMAPv2
b) MMAPv1
c) WiredTiger
d) All of the mentioned
View Answer

Answer: b
Explanation: Given a data set of sufficient size, the mongod process will allocate all available memory on the system for its use.

2. Point out the correct statement.
a) Spikes in the number of available connections can also be the result of application or driver errors
b) For read-heavy applications, increase the size of your replica set and distribute read operations to secondary members
c) For read-heavy applications, deploy sharding and add one or more shards to a sharded cluster to distribute load among mongod instances
d) All of the mentioned
View Answer

Answer: b
Explanation: Extremely high numbers of connections, particularly without corresponding workload is often indicative of a driver or other configuration error.

3. The memory usage statuses metrics of the _________ output can provide insight into MongoDB’s memory use.
a) globalstats
b) serverStatus
c) locks.deadlockCount
d) all of the mentioned
View Answer

Answer: b
Explanation: The serverStatus command returns a document that provides an overview of the database process’s state.

advertisement
advertisement

4. Point out the wrong statement.
a) A single page fault completes slowly and is problematic
b) Increasing the amount of RAM accessible to MongoDB may help reduce the frequency of page faults
c) Page faults also can occur while accessing large data sets or scanning an entire collection
d) None of the mentioned
View Answer

Answer: a
Explanation: However, in aggregate, large volumes of page faults typically indicate that MongoDB is reading too much data from disk.

5. You can inspect __________ to check the amount of mapped memory that mongod is using.
a) mem.mapped
b) memory.resident
c) mem.resident
d) all of the mentioned
View Answer

Answer: a
Explanation: If this value is greater than the amount of system memory, some operations will require a page faults to read data from disk.

6. MongoDB reports its triggered page faults as the total number of page faults in ________ second.
a) 1
b) 100
c) 1000
d) None of the mentioned
View Answer

Answer: a
Explanation: Rapid increases in the MongoDB page fault counter may indicate that the server has too little physical memory.

7. Which of the operator is used to access the query field of documents within system.profile?
a) $select
b) $retrieve
c) $query
d) None of the mentioned
View Answer

Answer: c
Explanation: You can view the output of the profiler in the system.profile collection of your database by issuing the show profile command.
advertisement

8. ____________ returns information on the query plan for aggregate function.
a) Reporter
b) db.collection.explain()
c) db.collection.explainplan()
d) None of the mentioned
View Answer

Answer: b
Explanation: MongoDB runs the query optimizer to choose the winning plan for the operation under evaluation.

9. By default, db.collection.explain() runs in ___________ verbosity mode.
a) VerbosityMode
b) queryPlanner
c) executeStats
d) none of the mentioned
View Answer

Answer: b
Explanation: db.collection.explain() returns the queryPlanner information for the evaluated method.

advertisement

Sanfoundry Global Education & Learning Series – MongoDB.

Here’s the list of Best Books in MongoDB.

To practice all areas of MongoDB for quizzes, Here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.