开发者社区 问答 正文

请教 mongoDB中 update timeout 异常的问题

大量数据插入mongo的时候发生了timeout异常,提示UPDATE失败:

PHP Fatal error: Uncaught exception 'MongoCursorTimeoutException' with message 'cursor timed out (timeout: 10000, time left: 10:0, status: 0)

MongoDB Support => enabled Version => 1.3.4 phpinfo() PHP Version => 5.4.11 尝试了以下参数,均无效,
array('connectTimeoutMS'=>30000, 'socketTimeoutMS'=>30000, 'wTimeout'=>30000, 'w'=>0)
求解.
screenshot

展开
收起
落地花开啦 2016-06-14 14:57:18 5176 分享 版权
1 条回答
写回答
取消 提交回答
  • 喜欢技术,喜欢努力的人

    修改一下
    `$cursor = $collection->find();
    $cursor->timeout(-1); # (-1 is no timeout)`

    2019-07-17 19:37:44
    赞同 展开评论