mongodb グローバル タイムアウトなどを試しても、PHP スクリプトの find() クエリでは無視されます。findOne({...}) または find({...}) ルックアップが必要で、タイムアウトする前に DB サーバーを最大 20 ミリ秒待ちます。
PHP がこの設定をソフト制限として使用しないようにするにはどうすればよいですか? 5秒後でも無視され、回答が処理されます。
これは PHP mongo ドライバーのバグですか?
例:
MongoCursor::$timeout=20;
$nosql_server=new Mongo('mongodb://user:pw@'.implode(",",$arr_replicas).'',array("replicaSet" => "gmt","timeout"=>10)) OR troubles("too slow to connect");
$nosql_db=$nosql_server->selectDB('aDB');
$nosql_collection_mcol=$nosql_db->mcol;
$testFind=$nosql_collection_mcol->find(array('crit'=>123));
//If PHP considered the MongoCursor::$timeout, I'd expect the prev. line to be skipped or throwing a mongo/timeout exception if DB does not return the find result cursor ready within 20ms.
//However, I arrive with this line after seconds, without exception whenever the DB has some lock or delay, without skipping previous line.