From CloudRun to Fly where to host your AI agent swarms

I’ve been optimizing my agent swarm, PailSwarm, and ran into challenges with processing time and cold starts on Cloud Run. Switching to Fly.io solved these issues, offering faster task execution and cost-effective always-on performance.

From CloudRun to Fly where to host your AI agent swarms
Do not index
Do not index
I’ve been deep into agent swarms lately, building and optimizing one I call PailSwarm. It started as a simple project using the AgencySwarm framework, but as I moved it into production, I ran into a few challenges—especially with longer-running agents.

The Challenges

The first issue was processing time. Some tasks took longer than Cloud Run’s limits, causing frustrating timeouts. I tried async threading and having bots post updates in Slack threads, but it still felt clunky for the kind of tasks I needed to handle.
The second issue was cold starts. After being idle, my bot would take a long time to spin back up when I needed it. Cloud Run does offer the option to keep the CPU always allocated, but that can get expensive quickly—especially for a small-scale project like mine.
notion image

Why Fly.io

That’s when I switched to Fly.io. It works better for my needs because it allows me to set a minimum of one machine running, avoiding cold starts entirely. Even better, Fly.io only charges for actual usage—so I’m not paying for idle CPU time, even when the machine is always live.
The setup was straightforward, and so far, it’s been faster and more reliable than Cloud Run. Tasks that used to take minutes now execute in seconds.

Lessons Learned

Fly.io has been a great fit for hosting my swarm. Keeping at least one machine live ensures everything runs smoothly, and I’m no longer dealing with timeouts or delays. If you’re working with agent swarms or similar workloads, choosing the right hosting setup can save you time, money, and headaches.
Are you implementing or curious about AI agent swarms?Let’s chat

We build third-party apps and integrations

Partner with us →

Written by

Lola
Lola

Lola is the founder of Lunch Pail Labs. She enjoys discussing product, SaaS integrations, and running a business. Feel free to connect with her on Twitter or LinkedIn.