IT Pro is supported by its audience. When you purchase through links on our site, we may earn an affiliate commission. Learn more

AWS Lambda SnapStart update speeds up application cold starts

The updated service utilises cache memory to store quickly-restored snapshots of functions as needed, reducing latency and cost

Amazon Web Services (AWS) has announced Lambda SnapStart, an update to the Lambda serverless compute service that greatly reduces application start latency.

SnapStart aims to speed up the cold start times of applications through the use of snapshots which can run multiple execution environments.

Related Resource

IBM FlashSystem 5000 and 5200 for mid-market enterprises

Manage rapid data growth within limited IT budgets

Chess pieces with three white pawns and one red king piece - whitepaper from IBMFree download

Once enabled within a Lambda function, Lambda SnapStart will begin its optimisation, storing an encrypted snapshot of the memory and disk state in the cache to be called upon at a later time. Snapshots that have not been called for 14 days are removed from the cache memory.

AWS Lambda runs functions within a secure execution environment that cycle through an initialisation (Init), invocation (Invoke), and shutdown phase. Running through these every time code is called upon can be slow and lead to increased costs.

With Lambda SnapStart, each snapshot can be retrieved and invoked without the need for the Init phase, and populates the execution environment in chunks as required. This results in far faster load and execution times, and AWS claims Lambda SnapStart can enable Java functions to start up ten times faster.

“Initialising the runtime for some languages can be expensive,” said Jeff Barr, chief evangelist at AWS, in a blog post

“For example, the Init phase for a Lambda function that uses one of the Java runtimes in conjunction with a framework such as Spring Boot, Quarkus, or Micronaut can sometimes take as long as ten seconds - this includes dependency injection, compilation of the code for the function, and classpath component scanning.” 

In the same post, Barr gave an example of the service in action, in which he reduced the initialisation of an example function from just over 6 seconds to under 200 milliseconds. This is possible through the restoration of the snapshot saved in the cache, and the subsequent invocation of the function handler.

For all its benefits, the introduction of Lambda SnapStart does necessitate any changes to existing developer practice. Code that has relied on generating content during the Init phase might require alteration, like pseudo random number generators, for example, as the restoration phase does not provide the unique conditions of initialisation. 

With this in mind, AWS has updated functions such as OpenSSL’s RAND_BYTES function so that it works in a SnapStart environment, as well as similar functions within Java and Amazon’s Linux.

Similarly, AWS has warned developers to check over code that downloads reference data during the Init phase, as this can be made stale through SnapStart’s caching. 

AWS Lambda is the firm’s serverless computing service, which allows companies to run code without the need to provision or manage servers in-house. Developers can use it to run apps and focus entirely on their maintenance, without the additional burden of servers or hardware. 

The announcement was made at the firm’s annual conference AWS re:Invent, held in Las Vegas. SnapStart is available now for Lambda customers at no extra cost, in the Asia Pacific, Europe, US East, and US West regions. 

Featured Resources

2023 Strategic roadmap for data security platform convergence

Capitalise on your data and share it securely using consolidated platforms

Free Download

The 3D trends report

Presenting one of the most exciting frontiers in visual culture

Free Download

The Total Economic Impact™ of IBM Cloud Pak® for Watson AIOps with Instana

Cost savings and business benefits

Free Download

Leverage automated APM to accelerate CI/CD and boost application performance

Constant change to meet fast-evolving application functionality

Free Download

Recommended

AWS launches Australia's first local zone in Perth
data centres

AWS launches Australia's first local zone in Perth

16 Jan 2023
Amazon, Salesforce to cut 26,000 jobs as tech layoff spree continues
Business strategy

Amazon, Salesforce to cut 26,000 jobs as tech layoff spree continues

5 Jan 2023
AWS Supply Chain: Cloud giant's new app locates bottlenecks and suggests fixes
Business operations

AWS Supply Chain: Cloud giant's new app locates bottlenecks and suggests fixes

30 Nov 2022
AWS plans to be 'water positive' by 2030
data centres

AWS plans to be 'water positive' by 2030

28 Nov 2022

Most Popular

What's powering Britain’s fibre broadband boom?
Network & Internet

What's powering Britain’s fibre broadband boom?

3 Feb 2023
Dutch hacker steals data from virtually entire population of Austria
data breaches

Dutch hacker steals data from virtually entire population of Austria

26 Jan 2023
Windows 10 users locked out of devices by unskippable Microsoft 365 advert
bugs

Windows 10 users locked out of devices by unskippable Microsoft 365 advert

3 Feb 2023