flyio-performance-tuning
Optimize Fly.io application performance with auto-stop/start tuning, VM sizing, multi-region latency optimization, and connection pooling. Trigger: "fly.io performance", "fly.io cold start", "fly.io latency", "fly.io VM sizing".
Best use case
flyio-performance-tuning is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Optimize Fly.io application performance with auto-stop/start tuning, VM sizing, multi-region latency optimization, and connection pooling. Trigger: "fly.io performance", "fly.io cold start", "fly.io latency", "fly.io VM sizing".
Teams using flyio-performance-tuning should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/flyio-performance-tuning/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How flyio-performance-tuning Compares
| Feature / Agent | flyio-performance-tuning | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Optimize Fly.io application performance with auto-stop/start tuning, VM sizing, multi-region latency optimization, and connection pooling. Trigger: "fly.io performance", "fly.io cold start", "fly.io latency", "fly.io VM sizing".
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
ChatGPT vs Claude for Agent Skills
Compare ChatGPT and Claude for AI agent skills across coding, writing, research, and reusable workflow execution.
SKILL.md Source
# Fly.io Performance Tuning
## Overview
Optimize Fly.io performance: eliminate cold starts, right-size VMs, leverage multi-region for low latency, and tune concurrency settings.
## Instructions
### Step 1: Eliminate Cold Starts
```toml
# fly.toml — suspend instead of stop for faster resume (~100ms vs ~5s)
[http_service]
auto_stop_machines = "suspend" # Suspend to RAM, not full stop
auto_start_machines = true
min_machines_running = 1 # Always-warm in primary region
# For latency-critical: keep machines running in all regions
# min_machines_running applies globally
```
### Step 2: Right-Size VMs
```bash
# Check current allocation
fly scale show -a my-app
# Start small, scale up based on metrics
fly scale vm shared-cpu-1x --memory 256 # Start here
fly scale vm shared-cpu-1x --memory 512 # If memory-constrained
fly scale vm shared-cpu-2x --memory 1024 # If CPU-bound
fly scale vm performance-2x --memory 4096 # For compute-heavy workloads
```
| Workload | VM | Memory | When |
|----------|-------|--------|------|
| Static site / API proxy | shared-cpu-1x | 256mb | Low traffic |
| Node.js API | shared-cpu-1x | 512mb | Most apps |
| Heavy processing | shared-cpu-2x | 1gb | Background jobs |
| Database / ML | performance-2x | 4gb | Compute-intensive |
### Step 3: Multi-Region Latency Optimization
```bash
# Deploy close to your users
fly scale count 1 --region iad # US East
fly scale count 1 --region lhr # Europe
fly scale count 1 --region nrt # Asia Pacific
# Fly automatically routes to nearest region via Anycast
# Verify: curl with timing
curl -w "DNS: %{time_namelookup}s, Connect: %{time_connect}s, Total: %{time_total}s\n" \
-o /dev/null -s https://my-app.fly.dev/health
```
### Step 4: Connection Pooling for Postgres
```typescript
// Use connection pooling for Fly Postgres
// PgBouncer runs on port 5433 (pooled) vs 5432 (direct)
const pooledUrl = process.env.DATABASE_URL?.replace(':5432/', ':5433/');
// Prisma: add pgbouncer=true
// DATABASE_URL="postgres://user:pass@my-db.internal:5433/db?pgbouncer=true"
```
### Step 5: Tune Concurrency
```toml
[http_service.concurrency]
type = "requests" # or "connections"
hard_limit = 250 # Max before rejecting
soft_limit = 200 # Start scaling at this point
```
## Resources
- [Auto Stop/Start](https://fly.io/docs/launch/autostop-autostart/)
- [Machine Sizing](https://fly.io/docs/machines/)
- [Suspend/Resume](https://fly.io/docs/reference/suspend-resume/)
## Next Steps
For cost optimization, see `flyio-cost-tuning`.Related Skills
running-performance-tests
Execute load testing, stress testing, and performance benchmarking. Use when performing specialized testing. Trigger with phrases like "run load tests", "test performance", or "benchmark the system".
workhuman-performance-tuning
Workhuman performance tuning for employee recognition and rewards API. Use when integrating Workhuman Social Recognition, or building recognition workflows with HRIS systems. Trigger: "workhuman performance tuning".
workhuman-cost-tuning
Workhuman cost tuning for employee recognition and rewards API. Use when integrating Workhuman Social Recognition, or building recognition workflows with HRIS systems. Trigger: "workhuman cost tuning".
wispr-performance-tuning
Wispr Flow performance tuning for voice-to-text API integration. Use when integrating Wispr Flow dictation, WebSocket streaming, or building voice-powered applications. Trigger: "wispr performance tuning".
wispr-cost-tuning
Wispr Flow cost tuning for voice-to-text API integration. Use when integrating Wispr Flow dictation, WebSocket streaming, or building voice-powered applications. Trigger: "wispr cost tuning".
windsurf-performance-tuning
Optimize Windsurf IDE performance: indexing speed, Cascade responsiveness, and memory usage. Use when Windsurf is slow, indexing takes too long, Cascade times out, or the IDE uses too much memory. Trigger with phrases like "windsurf slow", "windsurf performance", "optimize windsurf", "windsurf memory", "cascade slow", "indexing slow".
windsurf-cost-tuning
Optimize Windsurf licensing costs through seat management, tier selection, and credit monitoring. Use when analyzing Windsurf billing, reducing per-seat costs, or implementing usage monitoring and budget controls. Trigger with phrases like "windsurf cost", "windsurf billing", "reduce windsurf costs", "windsurf pricing", "windsurf budget".
webflow-performance-tuning
Optimize Webflow API performance with response caching, bulk endpoint batching, CDN-cached live item reads, pagination optimization, and connection pooling. Use when experiencing slow API responses or optimizing request throughput. Trigger with phrases like "webflow performance", "optimize webflow", "webflow latency", "webflow caching", "webflow slow", "webflow batch".
webflow-cost-tuning
Optimize Webflow costs through plan selection, CDN read optimization, bulk endpoint usage, and API usage monitoring with budget alerts. Use when analyzing Webflow billing, reducing API costs, or implementing usage monitoring for Webflow integrations. Trigger with phrases like "webflow cost", "webflow billing", "reduce webflow costs", "webflow pricing", "webflow budget".
vercel-performance-tuning
Optimize Vercel deployment performance with caching, bundle optimization, and cold start reduction. Use when experiencing slow page loads, optimizing Core Web Vitals, or reducing serverless function cold start times. Trigger with phrases like "vercel performance", "optimize vercel", "vercel latency", "vercel caching", "vercel slow", "vercel cold start".
vercel-cost-tuning
Optimize Vercel costs through plan selection, function efficiency, and usage monitoring. Use when analyzing Vercel billing, reducing function execution costs, or implementing spend management and budget alerts. Trigger with phrases like "vercel cost", "vercel billing", "reduce vercel costs", "vercel pricing", "vercel expensive", "vercel budget".
veeva-performance-tuning
Veeva Vault performance tuning for REST API and clinical operations. Use when working with Veeva Vault document management and CRM. Trigger: "veeva performance tuning".