Home / Companies / Vercel / Blog / Post Details
Content Deep Dive

Optimizing Vercel Sandbox snapshots

Blog post from Vercel

Post Details
Company
Date Published
Author
-
Word Count
793
Language
English
Hacker News Points
-
Summary

Vercel recently improved the performance of its filesystem snapshots in Vercel Sandbox by significantly reducing snapshot restore times from over 40 seconds to under one second. Initially focused on reliability, the team faced performance challenges when snapshot restore times were lengthy, prompting them to implement parallelization and local caching. By leveraging the AWS Go SDK's transfermanager API and performing parallel S3 range requests, they accelerated download times by 2-5 times. Additionally, they enhanced decompression speed by using multiple goroutines, further reducing restore times by 2-4 times. The team also introduced a local disk cache using LRU eviction, achieving a 95% cache hit rate, which allowed most snapshot restores to bypass both download and decompression entirely. These optimizations have not only improved snapshot restore performance but also support Automatic Persistence, ensuring an instantaneous experience when stopping and resuming sandboxes.