Performance-sensitive Sandboxes
Standard Sandboxes can be scheduled across many different underlying instance types, which can introduce variance in CPU performance between runs. Performance-sensitive Sandboxes are scheduled onto a consistent set of instance types with fast CPUs and low variance.
All performance sensitive hosts run on latest generation AMD Zen 5 EPYC hosts.
This is useful for workloads like benchmarking or CI, where consistency and low latency across runs matter.
Usage
Enable performance-sensitive scheduling by setting the performance_sensitive experimental option to True:
import modal
app = modal.App.lookup("my-app", create_if_missing=True)
sb = modal.Sandbox.create(
app=app,
experimental_options={"performance_sensitive": True},
)import { ModalClient } from "modal";
const modal = new ModalClient();
const app = await modal.apps.fromName("my-app", { createIfMissing: true });
const image = modal.images.fromRegistry("python:3.13-slim");
const sb = await modal.sandboxes.create(app, image, {
experimentalOptions: { performance_sensitive: true },
});package main
import (
"context"
modal "github.com/modal-labs/modal-client/go"
)
func main() {
ctx := context.Background()
mc, _ := modal.NewClient()
app, _ := mc.Apps.FromName(ctx, "my-app", &modal.AppFromNameParams{
CreateIfMissing: true,
})
image := mc.Images.FromRegistry("python:3.13-slim", nil)
sb, _ := mc.Sandboxes.Create(ctx, app, image, &modal.SandboxCreateParams{
ExperimentalOptions: map[string]any{"performance_sensitive": true},
})
_ = sb
}Limitations
- CPU only. Performance-sensitive scheduling is only available for CPU Sandboxes. GPU Sandboxes are not supported.
- Limited capacity. The pool of performance-sensitive instances is smaller
than the general pool. Avoid combining this feature with narrow region pinning
(e.g.
us-west) — this can cause scheduling delays due to limited supply. Broad regions likeuswork well.