Reserving a machine before booting it
Suppose two agents ask for the last available slot at the same time. Both check capacity, both see room, and both start a machine. That’s an easy race to write and an expensive one to ignore. Mainbrella reserves capacity before asking a machine to boot, so the second request sees the slot as taken while the first machine is still starting.
Reserve first, boot second
The dashboard and every API key on an account draw from the same capacity and monthly start allowance. Creating another key won’t get you another quota. We serialize the reservations, then let readiness checks run in parallel. A burst of launches can boot together without each request spending the same remaining allowance.
Once a reservation succeeds, it consumes a monthly start even if boot fails or you stop the machine immediately. A request rejected because the account is full doesn’t consume one. That leaves an awkward case for the client: a missing response doesn’t tell you whether a reservation happened. Keep the creation key and use the returned creation record to find out before asking for another machine.
What we run on Cloudflare
The machines run on Cloudflare Containers. Cloudflare runs each instance as a Linux container inside a Firecracker microVM with its own kernel and network. We handle the account API, reservations, and session policy around that runtime. The security overview explains the isolation and access controls in more detail.
Cloudflare’s network footprint doesn’t give Mainbrella customers a region picker. We offer five machine sizes, from Lite with 256 MiB of RAM to XL with 4 vCPUs and 12 GiB of RAM. Larger machines use the compute allowance faster and take more of the account’s concurrent capacity. Check the account limits before planning a burst; a hundred slots won’t help if the requested machines exhaust the compute budget first.
Save the files before the lease ends
Commands and terminal activity renew an Ad Hoc machine’s idle deadline. Polling its status doesn’t, and even a busy agent eventually hits the hard session deadline. Legacy subscription sessions are also bounded by the paid period recognized at creation; renewing the subscription doesn’t lengthen a session already running. The automation API and platform availability page describe the supported lifecycles.
Stopping a machine discards unsaved filesystem changes. If you’ll need the files again, save a workspace or export them before cleanup. A saved workspace restores files into a fresh machine, subject to its quota and retention period. It won’t bring back the processes that were running, and it doesn’t replace an independent backup. “The agent finished” is a lousy time to discover that its only copy of the report went away with the machine.