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.