Skip to content

Instantly share code, notes, and snippets.

@tbjers
Created April 17, 2019 21:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tbjers/e81b7a8c630db05cff9c7ca520d9ef18 to your computer and use it in GitHub Desktop.
Save tbjers/e81b7a8c630db05cff9c7ca520d9ef18 to your computer and use it in GitHub Desktop.
Speed up Lambda invocation by using keep-alive
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