Amazon Bedrock AgentCore V2 Session Start Acceleration Architecture Deep Dive

Amazon Bedrock AgentCore Runtime V2 has significantly reduced session start times by performing container initialization only once as a snapshot and restoring it for each session. It eliminates image pulling overhead compared to V1 and restores the memory state as is, reducing first request latency. The OverheadLatency metric in CloudWatch allows for separate measurement of platform overhead, and the pattern of moving initialization tasks to build time is a key optimization strategy. Through build hooks, separate process tools can also be included in the snapshot.

Background: Challenges of AgentCore Runtime and Session Start

Amazon Bedrock AgentCore Runtime provides a fully managed serverless environment for agent workloads. Each session runs in an isolated microVM, scaling down to zero when idle and charging only for the actual resources consumed. In the existing V1 architecture, every time a session started, it had to pull the container image from Amazon ECR, start the container, and only then could it process the first request. In this process, image pulling time acted as the dominant factor of cold start, leading to structural limitations where start delays increased in proportion to image size.

"AgentCore Runtime runs each session in a new microVM. In V1, AgentCore pulls the user's container image from Amazon ECR, starts the container, and only then can it process the first request. Since image pulling is dominant, cold starts increase in proportion to image size."

V2 Architecture: Snapshot-Based Session Restoration Mechanism

V2 (platformVersion "V2") fundamentally changes this paradigm. At the time of runtime creation or update, the container is started once, and after receiving the first healthy ping (GET /ping, must arrive within 120 seconds), the operating system file cache is cleared, and the microVM is frozen to save the memory and disk state as a snapshot. When a new session request comes in, this snapshot is restored to a new microVM, resuming the process exactly from the frozen point. Imported libraries, created objects, client connections, etc., are all preserved in memory.

In this process, it takes several minutes to complete runtime creation or update, but this is transitioned to a one-time build cost rather than a recurring cost per session. V2 also recovers unused memory from sessions to ensure that billing aligns with actual usage.

StepV1 (Existing)V2 (Snapshot-Based)
Image PullingPerformed every sessionPerformed once at build
Container StartPerformed every sessionPerformed once at build
Initialization Code ExecutionPerformed every sessionPerformed once at build (before app.run())
Session Start DelayProportional to image sizeFixed to snapshot restoration time
Memory BillingBased on total allocated memoryBilled after recovery based on actual usage

Memory and File System: What Snapshots Preserve and What They Don’t

During snapshot restoration, the memory state is fully restored. Everything the process held at the snapshot point, as well as the contents of RAM-backed file systems like `/dev/shm`, is available at memory speed from the first access. In contrast, file read states are not transferred. Since the file cache is cleared before freezing, even if files are read during initialization, they cannot be accessed quickly in the restored session. Container image files are fetched in blocks from snapshot storage and cached near the host at the first read point.

This characteristic affects different agent types differently. Agents that can maintain everything they need within their own process will see maximum benefits, but CLI tools or browser binaries that run as separate processes and terminate will need to read from the image again upon restoration after reading during initialization.

Measurement Strategy: CloudWatch Metrics and Latency Breakdown

AgentCore Runtime provides two CloudWatch metrics under the `AWS/Bedrock-AgentCore` namespace.

Initialization time does not appear in these metrics. This is because, in V2, it is only reflected in the time taken to reach the READY state during build when executed once. The initialization duration should be logged once just before `app.run()` to be checked in the build logs.

OverheadLatency45
Handler_Execution35
Model_Call15
Streaming_Buffer5

*The above chart is an illustrative ratio; actual distribution may vary based on the new session ratio.*

Points to note during measurement include:

Optimization Pattern: Moving Initialization Tasks to Snapshot Time

Common cold start advice is "deferred imports and minimal initialization," but in V2, the opposite strategy is effective. Initialization is executed once at build time, and tasks deferred to the handler incur repeated costs for every new session. This applies to static tasks (imports, client creation, loading data into images). Dynamic data cannot be snapshotted.

The agents that see the greatest benefit are those that read large files from images at request time.

Utilizing AgentCore Observability (custom span support), measure tool setup, file loading, and deferred import intervals to identify residual initialization tasks within the handler and move them before `app.run()`.

Build Hooks and Exception Handling: Responding to Separate Process Tools

For cases where it is not possible to maintain all state within a single process (separate process CLI, browser binaries, etc.), the AgentCore Runtime supports build hooks. Hooks run during the build phase to prepare artifacts that will be included in the snapshot. As shown in Figure 3, hooks are executed after container startup and before the healthy ping during the build process, allowing the binary or cache of separate process tools to be preloaded into snapshot memory/disk.

---

Verified figures

Our take

The snapshot architecture of AgentCore V2 has scaled the proven pattern of Lambda SnapStart to fit agent workloads. The support for build hooks that resolve practical constraints such as browser automation or CLI toolchains demonstrates its readiness for production services. However, the limitations of not being able to snapshot dynamic data and the increase in deployment time remain trade-offs.

Open questions

Source

Back to catalog