[Proposal] Resolving the "Warm-up Paradox" via a rewrite in Rust 🦀
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 20/100
Research direction
The issue names no repository files or tests. Start by reviewing the existing Go implementation and the proposed mittens-rs proof of concept, especially its CLI and HTTP/gRPC probing logic using clap, reqwest, and tonic. Done would require a maintainer-approved migration scope and an agreed implementation plan before coding begins.
Written by the indexing model from the issue text.
Description
Hey there,
I’ve been following the progress on Mittens and I really love the mission. Solving cold starts in Kubernetes is a massive pain point. However, looking at the current Go implementation, I can’t help but notice a bit of an architectural paradox: we are using a Garbage Collected (GC) runtime to solve latency spikes that are often caused by... Garbage Collection (and other runtime warm-up issues).
Have you considered rewriting Mittens in Rust?
I believe migrating the codebase would align much more closely with the project's goal of being a lightweight, transparent "sidecar" utility. Here are a few technical reasons why a Rust port would be superior for this specific use case:
1. Zero-Cost Sidecar Footprint
In a K8s environment, every MB counts for sidecars. By moving away from the Go runtime, we can eliminate the GC overhead entirely. A Rust implementation would offer:
- Deterministic Memory Usage: No heap spikes during the warm-up phase.
- Tiny Binaries: Using
muslandstrip, we could get the image size down to a fraction of the current Go build, speeding up pod pull times.
2. Fearless Concurrency with Tokio
While Goroutines are easy to spin up, they still require the Go scheduler to manage them. Using Tokio for the HTTP/gRPC probes would allow for much more granular control over the executor. We can ensure that the warm-up requests themselves never introduce jitter or contention into the node's CPU budget.
3. Type-Safe gRPC/HTTP Probes
Instead of relying on the current reflection-heavy approach, we could leverage Tonic and Prost. This would move the validation of warm-up payloads to compile-time.
- No
nilpointer panics:Option<T>ensures we never crash while trying to warm up a target. - Exhaustive Pattern Matching: Using Enums for the
Providerlogic means the compiler will literally refuse to build if a new protocol is added but not handled.
4. Error Handling & Correctness
Replacing the if err != nil boilerplate with the ? operator and Result types would make the core logic—specifically the timing and retry loops—much more ergonomic and less prone to "swallowed" errors that leave services "half-warm."
I've already started a small proof-of-concept (POC) using clap for the CLI and reqwest/tonic for the probing logic. It’s significantly more memory-efficient and avoids the "cold start" of the warm-up tool itself.
I'd be happy to discuss how we can start a mittens-rs branch or perhaps a gradual migration of the core logic.
Stay safe (and memory safe)! 🦀
- Dominant language
- Go
- Stars
- 66
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
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 ExpediaGroup/mittens
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 42/100
ExpediaGroup/mittens#371 ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 45/100
ExpediaGroup/mittens#360 ·
-
Log output configuration optionsMay be free again A pull request for this issue was closed without being merged. Openenhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
ExpediaGroup/mittens#309 ·
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 35/100
ExpediaGroup/mittens#256 ·
-
More data in logsOpenenhancement
Difficulty 3/5 1-2 days Newbie friendliness 45/100
ExpediaGroup/mittens#203 ·
All issues in ExpediaGroup/mittens
Similar issues
-
mcpx scan: flag unsafe tool namesPossibly taken @zeyadbadawyy claimed this today. Openarea/scan enhancement good first issue priority/medium size/small
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
rohitgollarahalli/mcpx#45 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Mend: dependency security vulnerability
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Windows 主机
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Lee-xeo/Claude-Cage#1550 ·
Maintainers usually reply within 1 day