发布于 2015-09-14 14:59:22 | 228 次阅读 | 评论: 0 | 来源: 网络整理
sleep is an internal command for testing purposes. The sleep command forces the database to block all operations. It takes the following options:
参数: |
|
---|
{ 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.