Database profiling
To round out your system analysis strategy, MongoDB provides the database profiler, which logs detailed information about database commands against a running mongod
instance to a capped collection called system.profile
. This feature is off by default but can be activated by setting the operationProfiling.mode
parameter to the appropriate integer value in your mongod.conf
.
When activated, the profiler introduces some performance and storage overhead. When you use the profiler as part of your testing strategy in a staging environment, these considerations can be balanced on the fly. If you want to perform database profiling in a production environment, it’s important to carefully evaluate your needs and priorities before enabling the profiler.
For most use cases where database profiling is desirable, consider setting the profiling level to 1
. If you use a slowms
time threshold, set it to the maximum value your system can wait on a given event. If you...