How we turned up the heat on Node.js Lambda cold starts
Blog post from Momento
A customer utilizing Node.js Lambda functions with Momento reported unsatisfactory cold start times, prompting an investigation to optimize performance. Initially, efforts to adjust memory configurations yielded no significant improvements. However, by employing the serverless-esbuild plugin, the team significantly reduced the Lambda package size from 1.5mb to approximately 260kb, resulting in a 90% reduction in cold start times to around 100ms. Inspired by this, Momento experimented with their production Lambda functions, achieving substantial performance gains by minimizing the bundle size through esbuild, minifying code, and externalizing source maps, ultimately reducing cold start times by 40%. Despite testing different architectures, x86 consistently outperformed arm_64 within the Lambda environment. The refined approach not only enhanced performance but also streamlined development processes, providing a template for future projects.