您好,欢迎访问一九零五行业门户网

mongo update timeout

大量数据插入mongo的时候发生了timeout异常,提示update失败:
php fatal error: uncaught exception 'mongocursortimeoutexception' with message 'cursor timed out (timeout: 10000, time left: 10:0, status: 0)
mongodb support => enabledversion => 1.3.4phpinfo()php version => 5.4.11尝试了以下参数,均无效,
array('connecttimeoutms'=>30000, 'sockettimeoutms'=>30000, 'wtimeout'=>30000, 'w'=>0)
求解.
php fatal error: uncaught exception 'mongocursorexception' with message 'couldn't get connection: failed to connect to: localhost:26011: send_package: error reading from socket: cursor timed out (timeout: 10000, time left: 10:0, status: 0)' in /data1/www/ifilmp.com/console/socialgraphtransform/func/tofollowing.php:76stack trace:#0 /data1/www/ifilmp.com/console/socialgraphtransform/func/tofollowing.php(76): mongocollection->update(array, array, array)#1 /data1/www/ifilmp.com/console/socialgraphtransform/process/run.php(10): tofollowing->run()#2 {main}thrown in /data1/www/ifilmp.com/console/socialgraphtransform/func/tofollowing.php on line 76

回复内容: 大量数据插入mongo的时候发生了timeout异常,提示update失败:
php fatal error: uncaught exception 'mongocursortimeoutexception' with message 'cursor timed out (timeout: 10000, time left: 10:0, status: 0)
mongodb support => enabledversion => 1.3.4phpinfo()php version => 5.4.11尝试了以下参数,均无效,
array('connecttimeoutms'=>30000, 'sockettimeoutms'=>30000, 'wtimeout'=>30000, 'w'=>0)
求解.
php fatal error: uncaught exception 'mongocursorexception' with message 'couldn't get connection: failed to connect to: localhost:26011: send_package: error reading from socket: cursor timed out (timeout: 10000, time left: 10:0, status: 0)' in /data1/www/ifilmp.com/console/socialgraphtransform/func/tofollowing.php:76stack trace:#0 /data1/www/ifilmp.com/console/socialgraphtransform/func/tofollowing.php(76): mongocollection->update(array, array, array)#1 /data1/www/ifilmp.com/console/socialgraphtransform/process/run.php(10): tofollowing->run()#2 {main}thrown in /data1/www/ifilmp.com/console/socialgraphtransform/func/tofollowing.php on line 76

$cursor = $collection->find();
$cursor->timeout(-1); # (-1 is no timeout)
其它类似信息

推荐信息