发布于 2015-09-14 14:59:27 | 203 次阅读 | 评论: 0 | 来源: 网络整理
参数: |
|
---|
Modifies the current database profiler level. This allows administrators to capture data regarding performance. The database profiling system can impact performance and can allow the server to write the contents of queries to the log, which might information security implications for your deployment.
The following profiling levels are available:
Level | Setting |
0 | Off. No profiling. |
1 | On. Only includes slow operations. |
2 | On. Includes all operations. |
Also configure the slowms option to set the threshold for the profiler to consider a query “slow.” Specify this value in milliseconds to override the default.
This command provides a wrapper around the database command profile.
mongod writes the output of the database profiler to the system.profile collection.
mongod prints information about queries that take longer than the slowms to the log even when the database profiler is not active.
注解
The database cannot be locked with db.fsyncLock() while profiling is enabled. You must disable profiling before locking the database with db.fsyncLock(). Disable profiling using db.setProfilingLevel() as follows in the mongo shell:
db.setProfilingLevel(0)