Skip to content
Skillv1.0.0

flyio-cost-tuning

Optimize Fly.io costs with auto-stop/suspend, right-sizing VMs, volume management, and monitoring spend across apps and regions. Trigger: "fly.io costs", "fly.io pricing", "fly.io billing", "reduce fl

by jeremylongshore(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from jeremylongshore/tons-of-skills-marketplace (skills/.curated/flyio-cost-tuning/SKILL.md). Install upstream with npx skills add jeremylongshore/tons-of-skills-marketplace --skill flyio-cost-tuning. Copyright stays with the author (MIT).

Fly.io Cost Tuning

Overview

Fly.io charges per-second for running machines plus storage. Key levers: auto-stop idle machines, suspend instead of stop, right-size VMs, and clean up unused volumes.

Prerequisites

  • Current contract/billing data reviewed by the account owner, aggregate resource usage, and a named cost owner.
  • Availability, latency, durability, and retention requirements that constrain autoscaling and volume decisions.
  • Synthetic staging load and a rollback plan for each cost-control change.

Output

Produce a cost-control receipt with measurement window, aggregate usage, approved setting change, expected effect, owner, verification date, and rollback result. Never include tokens, customer data, or internal billing details.

Error Handling

  • Do not remove volumes or capacity without confirmed retention, backup, and recovery requirements.
  • Revert a cost change that breaches availability, latency, or data-durability thresholds.
  • Quarantine unexpected resource changes for review rather than applying bulk cleanup.

Examples

Apply a suspend policy to a fictional staging app, compare aggregate idle cost and cold-start health, and roll back when a synthetic health check breaches the agreed latency threshold. Do not delete any volume as part of an exploratory test.

Pricing Quick Reference

Resource Free Tier Cost
shared-cpu-1x (256mb) 3 VMs free ~$1.94/month each
shared-cpu-1x (512mb) included ~$3.88/month
shared-cpu-2x (1gb) - ~$11.62/month
Volumes 3GB free $0.15/GB/month
Bandwidth 100GB free $0.02/GB after
IPv4 1 free per org $2/month each

Instructions

Strategy 1: Auto-Stop Idle Machines

# fly.toml — stop machines when no traffic
[http_service]
  auto_stop_machines = "stop"     # Full stop (cheapest, ~5s cold start)
  auto_start_machines = true
  min_machines_running = 0        # Allow all machines to stop
  # Use min_machines_running = 1 only for production apps

Strategy 2: Suspend for Faster Resume

# Suspend keeps memory state — resumes in ~100ms but costs ~$0.50/month
[http_service]
  auto_stop_machines = "suspend"

Strategy 3: Audit and Clean Up

# List all apps and their machine counts
fly apps list

# Find idle/stopped machines
fly machine list -a my-app --json | jq '.[] | select(.state != "started") | {id, state, region}'

# Destroy unused apps
fly apps destroy old-app --yes

# List and delete orphaned volumes
fly volumes list -a my-app
fly volumes destroy vol_xxx

Strategy 4: Right-Size VMs

# Check memory usage to see if oversized
fly ssh console -a my-app -C "cat /proc/meminfo | head -3"

# Downgrade if using <50% of allocated memory
fly scale vm shared-cpu-1x --memory 256 -a my-app

Cost Monitoring

# Check current month's usage
fly billing  # Shows org-level billing

# Estimate per-app cost
fly scale show -a my-app  # See VM count and size

Resources

Next Steps

For architecture design, see flyio-reference-architecture.

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/jeremylongshore-tons-of-skills-marketplace-flyio-cost-tuning/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

jeremylongshore-tons-of-skills-marketplace-flyio-cost-tuning.ocm.jsonjson
{
  "ocm": "1",
  "id": "jeremylongshore-tons-of-skills-marketplace-flyio-cost-tuning",
  "kind": "skill",
  "name": "flyio-cost-tuning",
  "description": "Optimize Fly.io costs with auto-stop/suspend, right-sizing VMs, volume management, and monitoring spend across apps and regions. Trigger: \"fly.io costs\", \"fly.io pricing\", \"fly.io billing\", \"reduce fly.io spend\".",
  "publisher": "jeremylongshore",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "general"
    ],
    "tags": [
      "skill-md",
      "saas",
      "edge-compute",
      "flyio",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Optimize Fly.io costs with auto-stop/suspend, right-sizing VMs, volume management, and monitoring spend across apps and regions. Trigger: \"fly.io costs\", \"fly.io pricing\", \"fly.io billing\", \"reduce fly.io spend\"."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/jeremylongshore/tons-of-skills-marketplace",
      "path": "skills/.curated/flyio-cost-tuning/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/jeremylongshore/tons-of-skills-marketplace/blob/HEAD/skills/.curated/flyio-cost-tuning/SKILL.md",
      "key": "jeremylongshore/tons-of-skills-marketplace/skills/.curated/flyio-cost-tuning/SKILL.md"
    },
    "compatibility": "Designed for Claude Code",
    "allowed_tools": [
      "Read,",
      "Write,",
      "Edit,",
      "Bash(fly:*)"
    ],
    "license": "MIT"
  },
  "instructions": "# Fly.io Cost Tuning\n\n## Overview\n\nFly.io charges per-second for running machines plus storage. Key levers: auto-stop idle machines, suspend instead of stop, right-size VMs, and clean up unused volumes.\n\n## Prerequisites\n\n- Current contract/billing data reviewed by the account owner, aggregate resource usage, and a named cost owner.\n- Availability, latency, durability, and retention requirements that constrain autoscaling and volume decisions.\n- Synthetic staging load and a rollback plan for each cost-control change.\n\n## Output\n\nProduce a cost-control receipt with measurement window, aggregate",
  "cost": {
    "context_tokens": 807
  }
}

Fetch it by URL: GET /api/v1/registry/jeremylongshore-tons-of-skills-marketplace-flyio-cost-tuning/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.