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 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 Web.config连不上数据库
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
  • ¥15 怎么配置广告联盟瀑布流
  • ¥15 Rstudio 保存代码闪退
  • ¥20 win系统的PYQT程序生成的数据如何放入云服务器阿里云window版?
  • ¥50 invest生境质量模块