iwind/rockmongo

mongo timeout settings is not applied for php_mongo > 1.5.0

Opened this issue · 0 comments

After the change "Fix deprecated warnings under PHP 5.5 and php_mongo 1.5.0 ( 225a712 )" the mongo_timeout param is no longer applied if you have php_mongo lib v 1.5+ (that is the case for most of current users). Because of this, the default timeout used is 30s (default one) regardless of what you will set in your config file.

While it is not good to have long running queries in production - for dev/test purposes it is great to be able to have it.

Based on http://php.net/manual/en/mongocursor.timeout.php the static timeout that is now depricated, has the an alternative instance level method to be used instead.

But since MongoQuery.timeout is only client side limit, in most cases again for dev/test purposes it is better to also have serverside timeout as well that is introduced in 1.5.0 http://php.net/manual/en/mongocursor.maxtimems.php