Since the version of MongoDB version is for PHP version 1.4, we will be a "black list" of servers for a minute if they cannot be contacted. This is so that we do not slam the server with connections, which can lead to a timeout. This is primarily done to make sure that in an environment with replicas, we can still use only one of the hosts, but, of course, if you have only one machine, this is a little more complicated.
If you use MongoLog, you can very easily determine what is happening under the hood:
MongoLog::setModule(MongoLog::ALL); MongoLog::setLevel(MongoLog::ALL); MongoLog::setCallback('print_mongo_log'); function print_mongo_log($a, $b, $c) { echo $c, "\n"; }
This will display everything the driver is trying to do. It would be interesting to see the dump first , when something goes wrong, and also at one time it is "stuck" in the black list.
The above warning will disappear after 60 seconds or when you reboot your web server software (or you are using PHP-FPM). If you think this explanation is incorrect, write a bug / function request at http://jira.mongodb.org/browse/PHP
Derick
source share