<#7146 perf(sandbox): reduce startup time from ~30...
# flyte-github
a
#7146 perf(sandbox): reduce startup time from ~30s to &lt;10s for UI Pull request opened by pingsutw Tracking issue N/A Why are the changes needed?
make sandbox-run
currently takes ~30 seconds before the console UI is accessible at
localhost:30080
. This is a poor developer experience — users should see feedback almost immediately. What changes were proposed in this pull request? Three categories of optimizations to reduce sandbox startup time: A. Reduce probe delays • flyte-binary: Added
startupProbe
with 1s period, removed 5s
initialDelaySeconds
from liveness/readiness probes • Console: Same treatment —
startupProbe
with 1s period, readiness period reduced from 10s to 1s • wait-for-db init container: Poll interval reduced from 0.5s to 0.1s B. Parallelize postgres + K3s startup • Previously, the entrypoint waited for embedded PostgreSQL to be ready (~3-5s) before starting K3s • Now, postgres startup and manifest rendering run in background subshells while K3s starts immediately • K3s takes ~5-10s to initialize its API server — by that time, postgres and the manifest are already ready C. Loading page for instant feedback • Added a lightweight busybox httpd pod that serves a "Starting Flyte Sandbox" loading page • Uses
rancher/mirrored-library-busybox:1.34.1
(already pre-loaded in K3s agent images, starts in <1s) • Configured as Traefik's lowest-priority catch-all route (
priority: 1
) • The page polls
/v2
every second and auto-redirects to the console once it's ready Expected timeline | Metric | Before | After | | -------------------- | ------ | ------- | | Loading page visible | N/A | ~3-5s | | Console fully ready | ~30s | ~10-15s | How was this patch tested? • Verified
startupProbe
is supported by the flyte-binary Helm template (
deployment.yaml
lines 143-145) • Regenerated manifests via
make manifests
and verified all changes appear in rendered output • Manual testing:
make build && make start
and observed loading page appears within seconds Labels • changed: Probe tuning and startup parallelization • added: Loading page for sandbox startup Check all the applicable boxes • I updated the documentation accordingly. • All new and existing tests passed. • All commits are signed-off. •
main
• #6583 • perf(sandbox): reduce startup time from ~30s to <10s for UI 👈 flyteorg/flyte