Created
April 17, 2019 21:13
-
-
Save tbjers/e81b7a8c630db05cff9c7ca520d9ef18 to your computer and use it in GitHub Desktop.
Speed up Lambda invocation by using keep-alive
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const AWS = require('aws-sdk'); | |
const https = require('https'); | |
const sslAgent = new https.Agent({ | |
keepAlive: true, | |
maxSockets: 50, | |
rejectUnauthorized: true | |
}); | |
sslAgent.setMaxListeners(0); | |
AWS.config.update({ | |
httpOptions: { | |
agent: sslAgent | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment