diff --git a/collectors/aws/collector.js b/collectors/aws/collector.js index 7599d7bed3..41978de0ba 100644 --- a/collectors/aws/collector.js +++ b/collectors/aws/collector.js @@ -20,12 +20,8 @@ const { EC2 } = require('@aws-sdk/client-ec2'); -const { - DynamoDBClient -} = require('@aws-sdk/client-dynamodb'); var async = require('async'); -//var https = require('https'); var helpers = require(__dirname + '/../../helpers/aws'); var collectors = require(__dirname + '/../../collectors/aws'); var collectData = require(__dirname + '/../../helpers/shared.js'); @@ -62,6 +58,11 @@ var collect = function(AWSConfig, settings, callback) { var debugMode = settings.debug_mode; if (debugMode) AWSXRay = require('aws-xray-sdk'); + const customRequestHandler = new NodeHttpHandler({ + httpsAgent: new Agent({maxSockets: 100}), + httpAgent: new HttpAgent({maxSockets: 100}) + }); + AWSConfig.requestHandler = customRequestHandler; AWSConfig.maxRetries = 8; AWSConfig.retryDelayOptions = {base: 100}; diff --git a/collectors/aws/collector_multipart.js b/collectors/aws/collector_multipart.js index 86efebb5c6..dfdf6520d9 100644 --- a/collectors/aws/collector_multipart.js +++ b/collectors/aws/collector_multipart.js @@ -20,9 +20,6 @@ const { EC2 } = require('@aws-sdk/client-ec2'); -const { - DynamoDBClient -} = require('@aws-sdk/client-dynamodb'); var async = require('async'); var helpers = require(__dirname + '/../../helpers/aws'); @@ -30,9 +27,6 @@ var collectors = require(__dirname + '/../../collectors/aws'); var collectData = require(__dirname + '/../../helpers/shared.js'); // Override max sockets -// JS SDK v3 does not support global configuration. -// Codemod has attempted to pass values to each service client in this file. -// You may need to update clients outside of this file, if they use global config. const { Agent } = require('https'); const { NodeHttpHandler } = require('@aws-sdk/node-http-handler'); @@ -71,6 +65,11 @@ var collect = function(AWSConfig, settings, callback) { var debugMode = settings.debug_mode; if (debugMode) AWSXRay = require('aws-xray-sdk'); + const customRequestHandler = new NodeHttpHandler({ + httpsAgent: new Agent({maxSockets: 100}), + httpAgent: new HttpAgent({maxSockets: 100}) + }); + AWSConfig.requestHandler = customRequestHandler; AWSConfig.maxRetries = 8; AWSConfig.retryDelayOptions = {base: 100};