Repository navigation
dfc2: move to a cheaper instance type (m6a.large → t3a.large), only once the measurements allow it - #26
Draft
atalyaalon wants to merge 2 commits into
Conversation
atalyaalon
force-pushed
the
claude/laughing-galileo-165xk1-machine-size
branch
from
November 28, 2026 07:08
dcc084c to
48d286f
Compare
This was referenced Nov 28, 2026
atalyaalon
pushed a commit
that referenced
this pull request
Nov 29, 2026
- targeted apply for removing the old disk (no untargeted apply) - stop if the add-disk plan touches the instance (#26 pulled in) - final rsync with --modify-window=-1 (or --checksum) so same-second DB changes aren't skipped - find the new disk by its volume-ID serial before mkfs - run long steps in tmux, daemon-reload after fstab, keep mount options, check cron jobs, note rollback data loss and snapshot cost Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XtN7GhfRRihvBTHsWxGZoV
1 task done
atalyaalon
pushed a commit
that referenced
this pull request
Nov 30, 2026
- targeted apply for removing the old disk (no untargeted apply) - stop if the add-disk plan touches the instance (#26 pulled in) - final rsync with --modify-window=-1 (or --checksum) so same-second DB changes aren't skipped - find the new disk by its volume-ID serial before mkfs - run long steps in tmux, daemon-reload after fstab, keep mount options, check cron jobs, note rollback data loss and snapshot cost Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XtN7GhfRRihvBTHsWxGZoV
atalyaalon
force-pushed
the
claude/laughing-galileo-165xk1-machine-size
branch
from
November 30, 2026 00:35
48d286f to
3d54647
Compare
atalyaalon
changed the base branch from
claude/laughing-galileo-165xk1-monitoring
to
claude/laughing-galileo-165xk1-shutdown-dfc
November 30, 2026 00:36
dfc2 moves from m6a.large to t3a.large (same 2 vCPU / 8 GiB, burstable CPU, ~$13/month cheaper). The dfc server keeps the m6a.large default. Burstable types get an explicit credit_specification (unlimited by default, so the CPU is never throttled). Only merge once the measurements show it fits, see the PR description. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XtN7GhfRRihvBTHsWxGZoV
substr(type, 0, 1) == "t" also matched non-burstable trn* types. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XtN7GhfRRihvBTHsWxGZoV
atalyaalon
pushed a commit
that referenced
this pull request
Nov 30, 2026
- targeted apply for removing the old disk (no untargeted apply) - stop if the add-disk plan touches the instance (#26 pulled in) - final rsync with --modify-window=-1 (or --checksum) so same-second DB changes aren't skipped - find the new disk by its volume-ID serial before mkfs - run long steps in tmux, daemon-reload after fstab, keep mount options, check cron jobs, note rollback data loss and snapshot cost Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XtN7GhfRRihvBTHsWxGZoV
atalyaalon
force-pushed
the
claude/laughing-galileo-165xk1-machine-size
branch
from
November 30, 2026 01:31
3d54647 to
a1db928
Compare
This was referenced Nov 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related PRs
mainStacked on #25 (base
claude/laughing-galileo-165xk1-monitoring), so this diff shows only this PR's change.Change
modules/dfc/variables.tf: newinstance_typevariable (defaultm6a.large, so the dfc server doesn't change) and acpu_creditsvariable (defaultunlimited).modules/dfc/main_docker.tf:var.instance_typecredit_specificationonly for burstablet*typesunlimitedmeans the CPU is never slowed down; time above the baseline is billed at ~$0.05 per vCPU-hour insteadmodules.tf:module "dfc2"setsinstance_type = "t3a.large".⛔ Conditions to merge (all must be true)
Based on the measurements requested from @tkalir in #25, including while the heaviest Airflow DAGs run:
Memory:
usedinfree -mon dfc2 stays under ~6 GB while the heaviest DAGs rundmesgshows no out-of-memory killst3a.largehas the same 8 GB as today, so this mostly confirms there's headroom. If item 1 (moving dfc's Vault/Redash to dfc2) happens first, add their memory.CPU:
CPUUtilizationon dfc2 is under ~25%t3a.large's free baseline is 30%. Time above it costs extra, and if it adds up to more than about 260 vCPU-hours a month, it cancels the saving.Timing:
If the numbers point elsewhere, change the value in
modules.tfbefore merging, or close this PR:instance_typetot3a.medium(4 GB)t3a.large(this PR)m6a.large)m6a.xlarge(16 GB)✅ Checks before
terraform apply/datais in/etc/fstabby UUID or LABEL, not by a device name like/dev/nvme1n1. Device names can change on a stop/start.bin/apps-dfc2.py ssh "cat /etc/fstab; lsblk -f"/datais missing from fstab, or uses a device name, fix that first. Otherwise the server can boot without/data, and Postgres would start on an empty directory.dfc2-main-docker→ Create snapshot), or note that this month's DLM snapshot exists.terraform planmust showmodule.dfc2.aws_instance.main_dockerupdated in-place (~), withinstance_typem6a.large → t3a.largeand the newcredit_specification.-/+(destroy and then create), stop: that would replace the server.module.dfcshould change.What happens on apply
restart: unless-stopped).✅ Checks after apply
aws ec2 describe-instances --region eu-central-1 --filters Name=tag:Name,Values=dfc2-main-docker \ --query 'Reservations[].Instances[].[InstanceType,State.Name]' --output textbin/apps-dfc2.py ssh "df -h /data; docker ps --format '{{.Names}} {{.Status}}'"airflow.anyway.co.il/healthis healthy.CPUSurplusCreditsChargedfor the instance (EC2 → Monitoring). If it's regularly above 0, the instance pays for extra CPU and the saving shrinks. Consider going back.Rollback
Set
instance_typeback tom6a.largeinmodules.tfandterraform apply. That's another ~3–5 minute stop/start, and no data is touched.Later
t3a.Testing
terraform validateorterraform planhere, because the Terraform registry is blocked. CI'sterraform planon this PR is the first check.substr()is used instead ofstartswith(), becausestartswith()only exists from Terraform 1.3 and CI uses 1.2.9.🤖 Generated with Claude Code
https://claude.ai/code/session_01XtN7GhfRRihvBTHsWxGZoV