发布于 2015-09-14 14:59:11 | 152 次阅读 | 评论: 0 | 来源: 网络整理

profile

Use the profile command to enable, disable, or change the query profiling 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. Consider the following prototype syntax:

{ profile: <level> }

The following profiling levels are available:

Level Setting
0 Off. No profiling.
1 On. Only includes slow operations.
2 On. Includes all operations.

You may optionally set a threshold in milliseconds for profiling using the slowms option, as follows:

{ profile: 1, slowms: 200 }

mongod writes the output of the database profiler to the system.profile collection.

mongod records a record of queries that take longer than the slowms to the log even when the database profiler is not active.

也可以参考

Additional documentation regarding database profiling Database Profiling.

也可以参考

db.getProfilingStatus()” and “db.setProfilingLevel()” provide wrappers around this functionality in the mongo shell.

注解

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)

注解

This command obtains a write lock on the affected database and will block other operations until it has completed; however the write lock is only in place while the enabling and disabling the profiler, which is typically a short operation.

最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务