您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

mongo update timeout

2025/8/7 9:20:17发布14次查看
大量数据插入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)
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product