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

sleep

sleep is an internal command for testing purposes. The sleep command forces the database to block all operations. It takes the following options:

参数:
  • w (boolean) – If true, obtain a global write lock. Otherwise obtains a read lock.
  • secs (integer) – Specifies the number of seconds to sleep.
{ sleep: { w: true, secs: <seconds> } }

The above command places the mongod instance in a “write-lock” state for a specified (i.e. <seconds>) number of seconds. Without arguments, sleep, causes a “read lock” for 100 seconds.

警告

sleep claims the lock specified in the w argument and blocks all operations on the mongod instance for the specified amount of time.

注解

sleep is an internal command that is not enabled by default. sleep must be enabled by using --setParameter enableTestCommands=1 on the mongod command line. sleep cannot be enabled during run-time.

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

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