MongoWriteBatch:execute抛出MongoCursorTimeoutException

时间:2016-01-26 14:10:49

标签: php mongodb

我正在使用MongoUpdateBatch

对MongoDB执行批量upsert
$batch = new \MongoUpdateBatch($collection, ['ordered' => false, 'wtimeout' => 500000]);

偶尔会收到以下错误:

Read timed out after reading 0 bytes, waited for 30.000000 seconds

Trace:
#8 MongoCursorTimeoutException in /var/app/current/src/Model/Campaign.php:286
#7 MongoWriteBatch:execute in /var/app/current/src/Model/Campaign.php:286
#6 ...

MongoWriteBatch:execute()抛出MongoCursorTimeoutException的原因是什么?如何避免?

0 个答案:

没有答案