ReadingResearchRadarInvestment framework
Sign in / Sign up
← Back to reading
NewsMaterial3 min readDisconfirmAI Editorial

AgentCore Runtime V2 Snapshot Mechanism: Recommendations to Reverse Cold-Start Optimization

Amazon Web Services explains how AgentCore runtime V2 changes session startup behavior by initializing once and restoring snapshots, indicating that traditional cold-start recommendations must be reversed.

2026-11-14 06:02 GMT+8

Traditional cold-start advice is to delay imports and minimize initialization so the first request triggers actual work as quickly as possible. In an engineering blog post published on November 13, 2026, Amazon Web Services states that this advice needs to be reversed for AgentCore runtime V2: initialization runs only once and is frozen into the snapshot, while deferred static work in the handler incurs a cost with every new session.

The V2 mechanism works as follows: when creating or updating a runtime, the platform starts the container, waits for the health check to pass (within 120 seconds), clears the operating system file cache, freezes the microVM, and saves memory and disk state as a snapshot. Subsequently, each new session no longer pulls the image or runs initialization code; instead, it restores the snapshot into a new microVM, allowing the process to resume from the frozen point, with imported libraries, created objects, and clients already present in memory.

This brings three direct implications. First, complete memory restoration: any data held during the initialization phase, including content on RAM-backed file systems, becomes available at memory speed from the first access. Second, file reads do not carry over: because the file cache is cleared before freezing, files read during initialization must still be fetched from the image in restored sessions. Third, image files are loaded on demand: the first time a specific data block is read, it is pulled from snapshot storage and then cached closer to the host.

Therefore, the correct refactoring direction is to move static work into initialization. Create objects rather than merely importing modules, because object creation loads their dependencies and keeps them in active memory. Create boto3 clients during initialization; endpoint resolution and credential resolution are restored with the snapshot, and sockets automatically reconnect on the first call. Read static data such as prompts, configurations, and small indexes into memory-held objects rather than reading from the image with every request. For files that cannot be held within the process—such as independently running CLI toolchains or browser binaries—they can be copied to RAM disks like /dev/shm, or pre-warmed using build hooks during snapshot construction.

Sign in / Sign up
ReadingResearchRadarInvestment framework

However, there is a trade-off that must be measured: data retained in memory during initialization increases snapshot size, which in turn increases restore time, and you pay for that memory in every session. The article explicitly recommends measuring end-to-end session start times before and after changes to confirm that latency is indeed reduced rather than merely shifted from the handler to the restore phase.

At the same time, certain values must remain in the handler. Random numbers, timestamps, credential refreshes, dynamic tool catalogs, and feature flags—if created during initialization, they would be frozen into the snapshot, causing every session to carry identical random states or expired time bases. The article draws an analogy to known pitfalls in AWS Lambda SnapStart and offers a module-level caching pattern with expiration times as a compromise for dynamic data.

For interactive scenarios, even a 2-second session startup is considered too slow. The article suggests initiating warm-up requests when the user opens a chat window or application, utilizing the time window before the user sends their first message to have the session ready. Running sessions respond in approximately 200 milliseconds, while new session startups take about 2 seconds—pre-warming hides the latter within user operation latency.

It should be noted that the aforementioned performance figures and mechanism descriptions come from Amazon Web Services' own explanations of its platform, representing vendor-reported data without independent third-party replication.

Sources

  • aws.amazon.comAmazon Web Services↗
Continue researching →