chore(electric): downsize Fly VM from performance-4x to shared-cpu-2x#2901
Conversation
The proxy handles ~200 req/min — performance-4x (8GB) is vastly over-provisioned. Saves ~$120/mo.
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
fly.toml (1)
8-10: Consider a more conservative configuration for the initial downsize.Given the magnitude of the resource reduction and the single-machine setup (line 21), consider starting with more conservative settings to reduce the risk of service disruption:
- Memory: Start with 1024mb or 2048mb rather than 512mb
- Concurrent requests: Reduce
ELECTRIC_MAX_CONCURRENT_REQUESTSproportionally (e.g., to{"initial": 1000, "existing": 3000})You can further optimize after monitoring actual resource usage at the intermediate tier. This staged approach provides a safety buffer while still achieving significant cost savings (~$62/mo for 1GB shared-cpu-2x vs ~$124/mo for performance-4x).
Also applies to: 14-14
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@fly.toml` around lines 8 - 10, Update the fly.toml resource and environment settings to use a more conservative initial downsize: change memory from "512mb" to "1024mb" (or "2048mb") and keep cpu_kind "shared" with cpus 2, and reduce the ELECTRIC_MAX_CONCURRENT_REQUESTS JSON to something like {"initial": 1000, "existing": 3000} so the first-tier concurrency is lower; locate and edit the memory/cpu_kind/cpus fields and the ELECTRIC_MAX_CONCURRENT_REQUESTS env var in the same manifest to apply these safer defaults for the single-machine deployment.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@fly.toml`:
- Around line 8-10: Update the fly.toml resource and environment settings to use
a more conservative initial downsize: change memory from "512mb" to "1024mb" (or
"2048mb") and keep cpu_kind "shared" with cpus 2, and reduce the
ELECTRIC_MAX_CONCURRENT_REQUESTS JSON to something like {"initial": 1000,
"existing": 3000} so the first-tier concurrency is lower; locate and edit the
memory/cpu_kind/cpus fields and the ELECTRIC_MAX_CONCURRENT_REQUESTS env var in
the same manifest to apply these safer defaults for the single-machine
deployment.
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
Summary
superset-electricFly VM fromperformance-4x(4 dedicated CPUs, 8GB RAM, ~$124/mo) toshared-cpu-2x(2 shared CPUs, 512MB, ~$4/mo)fly machines updateresizes to revert on every deployTest plan
Summary by cubic
Downsizes the Fly VM for the
superset-electricproxy from performance-4x (4 dedicated CPUs, 8GB) to shared-cpu-2x (2 shared CPUs, 512MB) to match ~200 req/min load and save about $120/month. Sets the size infly.tomlso deploys use the intended config and stop reverting manual resizes.Written for commit f46e402. Summary will update on new commits.
Summary by CodeRabbit