Simon Paradis
05/29/2026, 1:43 PMallin1 test container to boot faster ? It needs 20 seconds...Rocky
05/29/2026, 1:43 PMallin1 container is typical because it isn't just starting a single process; it orchestrates a full StarRocks cluster (Frontend, Backend, and auxiliary services) inside one container.
While there isn't a single environment variable to "fast-boot" the image, here is why it takes that long and how you can potentially shave off some time:
Why it takes ~20 seconds
1. Service Orchestration: The container uses supervisord to manage feservice (Java-based Frontend) and beservice (C++ Backend).
2. FE JVM Startup: The StarRocks Frontend is a Java application. Initializing the JVM and the Berkeley DB (BDB) metadata store typically takes 10–15 seconds.
3. Registration Loop: The entrypoint script includes a polling loop. It waits for the FE to be "alive" (responding on port 9030) before it automatically executes the ALTER SYSTEM ADD BACKEND command to link the BE to the FE. If the FE hasn't finished its own internal startup, this script loops with sleep intervals.
Tips to improve boot speed
* Persist Metadata and Data:
If you are running tests repeatedly, don't let the container re-initialize the metadata from scratch. Map local volumes to the internal storage paths. This allows StarRocks to skip certain first-run initialization steps:
* FE Metadata: /data/deploy/starrocks/fe/meta
* BE Storage: /data/deploy/starrocks/be/storage
bash
docker run -v $(pwd)/fe_meta:/data/deploy/starrocks/fe/meta \
-v $(pwd)/be_storage:/data/deploy/starrocks/be/storage ...
* Resource Allocation:
StarRocks is resource-intensive. If Docker is capped at 2GB RAM or 1-2 CPUs, the Java FE startup and C++ BE initialization will be significantly throttled. Ensure Docker has at least 4GB–8GB RAM and 4 CPUs assigned to it for a snappier startup.
* Custom JVM Options (Advanced):
You can try passing faster JVM startup flags to the FE by overriding the fe.conf or passing environment variables if the specific image version supports it (e.g., reducing the heap size -Xms / -Xmx so the OS doesn't spend time allocating large memory pages).
* Skip "All-in-1" for CI:
If you are using this for automated testing (CI), the allin1 image is often slower than using a pre-warmed "Shared Data" (compute-node) environment or a specialized "lite" mock if your tests only require SQL syntax validation.
Summary: 20 seconds is the standard "healthy" threshold for a full StarRocks stack. If you need sub-5-second boots for unit testing, you may need to look at reusing a running container or using a persistent volume to skip the first-time setup.
References
• developers/development-environment/dev-env-setup.md
• quick_start/shared-nothing.md
• deployment/environment_configurations.md
• quick_start/routine-load.md
• quick_start/shared-data.md
• knowledge/usage/best-practice.md