Skip to content

chore(electric): downsize Fly VM from performance-4x to shared-cpu-2x#2901

Merged
saddlepaddle merged 1 commit into
mainfrom
saddlepaddle/downsize-electric-vm
Mar 26, 2026
Merged

chore(electric): downsize Fly VM from performance-4x to shared-cpu-2x#2901
saddlepaddle merged 1 commit into
mainfrom
saddlepaddle/downsize-electric-vm

Conversation

@saddlepaddle
Copy link
Copy Markdown
Collaborator

@saddlepaddle saddlepaddle commented Mar 26, 2026

Summary

  • Downsizes superset-electric Fly VM from performance-4x (4 dedicated CPUs, 8GB RAM, ~$124/mo) to shared-cpu-2x (2 shared CPUs, 512MB, ~$4/mo)
  • The machine handles ~200 req/min — massively over-provisioned at current size
  • This was also causing manual fly machines update resizes to revert on every deploy

Test plan

  • Merge and verify deploy sets the correct VM size
  • Monitor Electric SQL health checks post-deploy

Summary by cubic

Downsizes the Fly VM for the superset-electric proxy 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 in fly.toml so deploys use the intended config and stop reverting manual resizes.

Written for commit f46e402. Summary will update on new commits.

Summary by CodeRabbit

  • Chores
    • Updated deployment infrastructure resource configuration.

The proxy handles ~200 req/min — performance-4x (8GB) is vastly
over-provisioned. Saves ~$120/mo.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 26, 2026

📝 Walkthrough

Walkthrough

The fly.toml configuration file is updated to reduce VM resource allocation: memory decreases from 8192mb to 512mb, CPU kind changes from performance to shared, and CPU count reduces from 4 to 2.

Changes

Cohort / File(s) Summary
Fly VM Configuration
fly.toml
Reduced VM resource allocation: memory from 8192mb to 512mb, CPU kind from performance to shared, CPUs from 4 to 2.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A rabbit hops through config land,
Where resources shrink by my small hand,
Four CPUs down to but two,
Eight gigs to five-twelve—a downsizing brew,
Performance traded for shared delight,
Fly's VM now lean and light! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: downsizing the Fly VM configuration from a high-performance to shared CPU instance.
Description check ✅ Passed The description covers the key context (current over-provisioning, cost savings, deployment issue) but lacks explicit sections matching the template structure (Type of Change, Testing details).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch saddlepaddle/downsize-electric-vm

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 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_REQUESTS proportionally (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.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5deeff91-38fb-4ca0-bcba-5f545a871324

📥 Commits

Reviewing files that changed from the base of the PR and between 2153a95 and f46e402.

📒 Files selected for processing (1)
  • fly.toml

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 26, 2026

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ✅ Neon database branch
  • ✅ Electric Fly.io app

Thank you for your contribution! 🎉

@saddlepaddle saddlepaddle merged commit 1850d3f into main Mar 26, 2026
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant