Skip to content

chore: holding pattern cost reduction (~56% monthly savings) - #80

Merged
JaminB merged 1 commit into
mainfrom
chore/holding-pattern-cost-reduction
May 18, 2026
Merged

chore: holding pattern cost reduction (~56% monthly savings)#80
JaminB merged 1 commit into
mainfrom
chore/holding-pattern-cost-reduction

Conversation

@JaminB

@JaminB JaminB commented May 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds "under active development" banner to all pages with link to GitHub repo
  • Disables user registration (set via SSM — no code change needed)
  • Shrinks all ECS task definitions to Fargate minimum (0.25 vCPU / 512 MB)
  • Reduces Gunicorn/Celery concurrency to 1 to match smaller CPU
  • Caps autoscaling max at 1 for api/ui/worker (prevents scale-out)

Cost impact

Before After
ECS compute ~$99/mo ~$36/mo
Aurora ~$44/mo ~$44/mo
Redis ~$13/mo ~$13/mo
ALB + misc ~$12/mo ~$12/mo
Total ~$168/mo ~$74/mo

Deploy steps

  1. Merge this PR
  2. cd terraform && terraform apply to resize ECS tasks and cap autoscaling
  3. ECS will roll new task revisions automatically

Notes

  • Worker/beat kept running (OAuth2 token refresh for GDrive/Dropbox connections)
  • Registration already disabled in SSM — takes effect on next deploy
  • Site remains fully functional; just slower under sustained load (acceptable for holding pattern)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added a development banner notice to the application interface, displayed beneath the top navigation with a link to the project repository.
  • Chores

    • Adjusted ECS task resource allocation and modified auto-scaling configuration limits across services.

Review Change Stack

- Add "under active development" banner to base template linking to GitHub repo
- Disable user registration via SSM (FILEPROXY_REGISTRATION_ENABLED=False)
- Shrink all ECS task definitions to Fargate minimum (0.25 vCPU / 512 MB)
- Reduce Gunicorn and Celery worker counts to 1 to match smaller CPU allocation
- Cap autoscaling max to 1 for api/ui/worker (prevent scale-out)

Reduces estimated monthly cost from ~$168 to ~$74/mo (~56% reduction).
Requires `terraform apply` to take effect.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 18, 2026 00:22
@coderabbitai

coderabbitai Bot commented May 18, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8ee5ef8b-0b21-490d-9b92-98c85989b591

📥 Commits

Reviewing files that changed from the base of the PR and between 39a1c64 and b225d49.

📒 Files selected for processing (2)
  • fileproxy/templates/base.html
  • terraform/ecs.tf

📝 Walkthrough

Walkthrough

This PR downscales a development environment by adding a visual indicator to the UI and reducing ECS task resources. The dev banner notifies users they are working in a development environment with a GitHub link, while infrastructure changes constrain CPU, memory, worker processes, and auto-scaling limits across all services to minimal levels.

Changes

Development Environment Configuration Downscale

Layer / File(s) Summary
Development Environment Banner
fileproxy/templates/base.html
Adds a centered warning-styled banner below the top navigation indicating development environment status with a link to the GitHub repository.
ECS Task Resource and Scaling Configuration
terraform/ecs.tf
Reduces task-level CPU from 1024/512 to 256 and memory from 2048/1024 to 512 across api, ui, and worker services. Container environment variables GUNICORN_WORKERS and CELERY_WORKERS are set to "1". Auto-scaling max limits are constrained to 1 for all three services while preserving min, target_cpu, and scale_in values.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A banner now waves, dev environment's true,
With scaled-down resources, lean and light through and through,
Fewer processes spinning, small containers run fleet,
The dev environment downscale is finally complete! 🌾

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the main change: implementing cost reduction measures as a holding pattern, with a quantified savings metric (~56% monthly savings). It directly relates to both major changes in the PR (dev banner and infrastructure downsizing).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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 chore/holding-pattern-cost-reduction

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR reduces holding-pattern infrastructure costs by downsizing ECS/Fargate resources, limiting service scale-out, and adding an active-development notice to the shared UI layout.

Changes:

  • Shrinks API, UI, and worker task definitions to 0.25 vCPU / 512 MB.
  • Reduces Gunicorn and Celery worker concurrency to 1.
  • Caps API/UI/worker autoscaling maximum capacity at 1 and adds a development banner to the base template.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
terraform/ecs.tf Reduces ECS task sizing, runtime concurrency, and autoscaling maximums for cost savings.
fileproxy/templates/base.html Adds a site-wide active-development banner with a link to the GitHub repository.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@JaminB
JaminB merged commit 9e7b084 into main May 18, 2026
16 checks passed
@JaminB
JaminB deleted the chore/holding-pattern-cost-reduction branch May 18, 2026 00:30
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.

2 participants