开发者社区> 问答> 正文

mongo 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

展开
收起
蛮大人123 2016-02-13 17:47:19 2577 0
1 条回答
写回答
取消 提交回答
  • 我说我不帅他们就打我,还说我虚伪

    $cursor = $collection->find();
    $cursor->timeout(-1); # (-1 is no timeout)

    2019-07-17 18:42:16
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
MongoShake -- Multi Active-Active and Cross-Region Disaster Recoverable MongoDB Service 立即下载
SQL Server 2017 立即下载
Getting Ready to Use Redis with Apache Spark 立即下载