dqnqpqv3841 2014-05-02 13:57
浏览 361
已采纳

PHP / MongoDB连接超时

we're using MongoDB heavily in our web application and until recently we've had no issues at all with it. Our application see between 1000 - 2500 requests per minute but it seems that regardless of our traffic levels however we're constantly seeing a high number of the following error:

MongoConnectionException' with message 'Failed to connect to: HOST:PORT: Read timed out after reading 0 bytes, waited for 0.-01000 seconds

These appear to happen randomly. The strange part of this error is the time waited, 0.-01000 seconds, I've so far been unable to find another instance of this being documented anywhere.

The application is written in PHP and we're using the 1.4.5 version driver with version 2.4.6 of Mongo running multiple shards. The connection string is the standard mongodb://IP:PORT with no other arguments being passed.

I'm at a bit of a loss as to what might be causing this, we've not been able to find anything in the mongo logs regarding failed connection attempts and we're not hitting any connection limits at either end. Any help would be appreciated, we're likely to see a big increase in traffic over the coming months and I'd like to get this resolved before then.

Thanks in advance.

Update. Updating to the latest driver (1.5.2) solved the issue, however it required that we add in an inclusion for the JSON extension above the Mongo driver inclusion in the php.ini file otherwise we'd receive JSON not found errors.

  • 写回答

1条回答 默认 最新

  • donglu4159 2014-05-02 14:25
    关注

    Looks to be a bug in the PHP driver version 1.4.5:

    https://jira.mongodb.org/browse/PHP-922

    Looks to be fixed in version 1.5.2 of the driver.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?