Start the container image from a trained AOT cache
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 22/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- clickhouse, docker, github-actions, java, spring-boot
- Domain
- backend, ci-cd, devops, infrastructure, performance
Research direction
Work lives on branch feat/987-aot-cache (no PR yet); training replays src/test/resources/flows against a throwaway ClickHouse during the image build and ships /app/riptide.aot. Read the proposed image/ENTRYPOINT changes, make aot-clickhouse-up, host-network docker build, and the PR image job plus release.yml cosign/provenance impact. Done is the two acceptance scenarios (AOT-linked classes before Starting RiptideApplication, and a failing aot-check if the JVM rejects the cache) plus answers to the open questions on warm-up, QEMU arm64 time, and host-network CI—shipping is deferred until those costs are known.
Written by the indexing model from the issue text.
Description
Split out of #924 (Phase 1, "Implement AOT Method Profiling (JEP 515 / Project Leyden)") so #924 can close without it. A working prototype exists on a branch with no PR yet. The decision to ship it is deferred until the costs below are understood.
Problem statement
#924 states that the JVM's warm-up after a restart causes packet drops, and that an AOT cache trained on the daemon would remove that window. Neither the drop window nor the gain has been measured on riptide: edge-01 averages about 0.03 cores, and the prototype's only start-up figure is one local sample. Who is hurt, and how often, is Unknown.
User story
- As an operator restarting or redeploying riptide while exporters keep sending,
- I want to riptide to reach full decoding speed sooner after start,
- so that fewer flows are lost in the first minute after a restart.
Proposed solution
The prototype on branch feat/987-aot-cache trains a JDK 25 AOT cache (JEP 483/514/515) during the image build. It replays the flow captures in src/test/resources/flows through the image's own JVM against a throwaway ClickHouse, ships /app/riptide.aot, and fails the build if the JVM rejects the cache. Container image only. The deb/rpm and Nix paths stay without a cache.
Alternatives considered
- Train in a separate CI job and layer the cache on: works for any ClickHouse binary, but needs per-arch builds and a manifest merge, and changes the cosign and provenance steps in
release.yml. - Switch the base image to glibc (
eclipse-temurin:25) so ClickHouse runs inside the build: bigger image and a base change operators see. - Do nothing: no build-time cost and no image change. The warm-up cost, if there is one, stays.
Acceptance criteria
Scenario: the image uses its cache
- Given an image built from the branch,
- When it starts with
JDK_JAVA_OPTIONS=-Xlog:aot, - Then the log shows
Using AOT-linked classes: truebeforeStarting RiptideApplication.
Scenario: a cache the JVM rejects never ships
- Given a build where the class path changes between training and the end of the build,
- When the image is built,
- Then the build fails with
aot-check: the JVM did not use the AOT cacheand nothing is pushed.
Business impact & priority
- Value: shorter warm-up after restarts, if a warm-up loss exists (Unknown)
- Frequency: every container start. edge-01 restarted 2 to 3 times a day in September 2026 (Pyroscope, cause unknown).
- Target metric: time from process start to
/readyzand UDP drops in the first 60 s under load, on the flow-knee lab. Current and target values Unknown. - Priority: Unknown
What the prototype showed
Build time:
- Each image build runs riptide for about 45 s of training per architecture, plus a ClickHouse start. A local multi-arch build took 1 min 40 s.
- The arm64 half trains under QEMU on a GitHub runner, never measured.
publish-rctakes 4 min 31 s to 5 min 36 s today. - The build needs a ClickHouse on the build host's network:
make aot-clickhouse-up,docker build --network host, and in CI a host-network buildx builder with thenetwork.hostentitlement. - No PR built the image before. The prototype adds a PR
imagejob (amd64).
Runtime compatibility, all measured on the prototype image:
- The cache is valid only for the image's JDK, class path and
-XX:+UseCompactObjectHeaders. - The JVM skips it, with one warning line and no failure, under
-XX:-UseCompactObjectHeaders,-XX:+UseZGC, a heap of about 30 GiB or more (-Xmx40g, orMaxRAM=120gwith no container memory limit), or any class path change.-Xmx8g,-Xmx512mand-XX:+UseParallelGCkeep it. - The image runs the extracted Spring Boot layout.
/app/riptide.jaris now a thin jar with/app/lib/, and a replacedCMDnaming-jar /app/riptide.jarkeeps working. -XX:AOTCachesits on theENTRYPOINT. Replacing the entrypoint drops the cache.- The image grows by the cache, 83 MB uncompressed on arm64.
Start-up: one local sample, not a measurement, Spring context start 1.367 s without the cache and 0.469 s with it.
Training excludes the Cisco WLC captures because of #985.
Open questions
- Is there a warm-up drop window at all at production load? This decides whether the rest matters.
- How long does arm64 training under QEMU take on a GitHub runner, and is that acceptable for every
publish-rcand release? - Is a build-time dependency on a host-network ClickHouse and the
network.hostentitlement acceptable for the release pipeline? - Do operators run ZGC, heaps of 30 GiB or more, or unlimited containers on large hosts, where the cache is skipped?
- What priority does this get?
- Dominant language
- Java
- Stars
- 2
- Forks
- 0
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 52
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Riptide-Labs/riptide
-
enhancement priority: low
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Riptide-Labs/riptide#1060 ·
Maintainers usually reply within 1 day
-
enhancement priority: medium
Difficulty 4/5 3-5 days Newbie friendliness 55/100
Riptide-Labs/riptide#1059 ·
Maintainers usually reply within 1 day
-
dependencies javascript priority: low
Difficulty 1/5 Under an hour Newbie friendliness 15/100
Riptide-Labs/riptide#1045 ·
Maintainers usually reply within 1 day
-
enhancement priority: low
Difficulty 5/5 Over a week Newbie friendliness 25/100
Riptide-Labs/riptide#983 ·
Maintainers usually reply within 1 day
-
enhancement priority: low
Difficulty 4/5 3-5 days Newbie friendliness 64/100
Riptide-Labs/riptide#980 ·
Maintainers usually reply within 1 day
All issues in Riptide-Labs/riptide
Similar issues
-
getRawTextContent() returns the lines of every page in reverse order (bottom to top) since 4.0.3Open
Difficulty 1/5 1-3 hours Newbie friendliness 90/100
-
bug subsystem:agent-harness triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ShaftHQ/SHAFT_ENGINE#7797 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
NationalSecurityAgency/ghidra#10155 ·
Maintainers usually reply within 2 days
-
area:data coverage
Difficulty 1/5 Under an hour Newbie friendliness 67/100
reacher-z/Awesome-CUA#4864 ·
Maintainers usually reply within 19 days
-
bug web-ui
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
jenkinsci/jenkins#27705 · 3 comments ·
Maintainers usually reply within 1 day