Understanding Fluid Compute on Vercel
Fluid compute is Vercel's next-generation execution model for Functions that provides a hybrid solution combining the flexibility of serverless with the efficiency of server-like capabilities. 12
What is Fluid Compute?
Fluid compute offers a blend of serverless flexibility and server-like capabilities, overcoming the limitations of both traditional approaches. Unlike standard serverless architectures that can face issues like cold starts and limited functionalities, Fluid compute delivers advantages of both worlds. 1
Key Benefits of Fluid Compute
Optimized Concurrency
Multiple invocations can share a single function instance, allowing for more efficient resource usage. This is especially valuable for I/O-bound tasks like fetching embeddings, querying vector databases, or calling external APIs. 13
Dynamic Scaling
Fluid compute automatically optimizes existing resources before scaling up to meet traffic demands. This ensures low latency during high-traffic events and cost efficiency during quieter periods. 12
Background Processing
After fulfilling user requests, you can continue executing background tasks using waitUntil
. This allows for a responsive user experience while performing time-consuming operations like logging and analytics in the background. 12
Cold Start Optimizations
Fluid compute reduces cold starts through:
- Bytecode caching: Automatically pre-compiles function code to minimize startup time
- Pre-warmed instances: Keeps functions ready to handle requests without cold start delays 12
Cross-Region Failover
Ensures high availability by first failing over to another availability zone within the same region if one goes down. If all zones in that region are unavailable, Vercel automatically redirects traffic to the next closest region. 12
How to Enable Fluid Compute
To enable Fluid compute:
- Navigate to your project in the Vercel dashboard
- Click on the Settings tab and select the Functions section
- Scroll to the Fluid Compute section and enable the toggle
- Redeploy your project to apply the changes 13
Supported Runtimes
Fluid compute is currently available for:
Default Settings by Plan
Fluid Compute includes default settings that vary by plan:
Settings | Hobby | Pro | Enterprise |
---|---|---|---|
CPU configuration | Managed | Standard / Performance | Standard / Performance |
Default / Max duration | 60s / 60s | 90s / 800s | 90s / 800s |
Multi-region failover | ✓ | ✓ | ✓ |
Multi-region functions | - | Up to 3 | All |