# How we keep sleeping computers cheap

Why a sleeping computer costs you nothing on homemade, and the engineering that keeps it cheap for us: diff snapshots, sparse memory and deep sleep.

20 Nov 20266 min readhomemade team

On homemade, a sleeping computer costs you nothing in running time. You pay per second while a computer runs, and when it sleeps the meter stops. Hobby keeps a sleeping computer for 7 days, Pro for 30, and the Unlimited sleep add-on keeps it until you delete it.

That only works as a business if sleeping computers are cheap for us too. A sleeping computer still has a disk full of your files and, for a while, a copy of its whole memory. Multiply that by every branch and every agent task people leave lying around, and storage becomes the main cost of the product.

This post is about where that cost comes from and what we do about it. The numbers are from our own measurements on our staging environment in November 2026.

## What a sleeping computer holds

When a computer goes to sleep, we keep two things:

- **Its memory**, so running processes, open terminals and your dev server come back exactly as they were.
- **Its disk**, so every file is there, including installed packages and build caches.

Memory is the expensive one to keep around. A medium computer has 16 GB of memory, and a naive snapshot is a 16 GB file, every time.

## Write only what changed

The first time a computer sleeps, it writes a full snapshot of its memory. Every later sleep writes only the pages that changed since the last snapshot. For a computer you use every day, most of its memory doesn't change between sessions: the operating system, your editor's language server, the parts of `node_modules` that were loaded. A diff is a fraction of the full size, and much faster to write.

This also makes waking after a short sleep fast. In our measurements, a wake after a short sleep reached a typed echo in the terminal in 0.58 to 0.86 s.

## Most memory is zeros

When we looked at what memory files actually contained, most of it was empty. A 16 GB memory file from one of our templates was 92% zero pages. That is normal: a fresh computer with 16 GB of memory uses a few gigabytes, and the rest has never been touched.

A plain copy of that file still takes 16 GB of disk. So we now punch holes where the zeros are. The file keeps its size on paper, but the zero regions take no space on disk, and reading them back gives zeros as before.

In our lab, memory files for three projects came out at 467 MB, 698 to 758 MB and 2.3 GB on disk, against 4, 16 and 16 GB before. On staging, the first new snapshot after the change used 2.8 GB of real disk for 16 GB of memory, and the whole stored entry went from about 18.8 GB to 6.7 GB.

That fix is in the warm snapshots we restore new computers from. The idea is simple: store what is there, not the empty space around it.

## Don't save the page cache

Linux uses spare memory as a cache for files it has read. It's useful while a computer runs and worthless in a snapshot, because the same files are on disk anyway. Before we take a warm snapshot, we now ask the guest to drop that cache. That frees 1.5 to 4.3 GB per capture before anything is written. One of our own projects freed 4.25 GB.

## Deep sleep: give the host back

A computer that stays asleep on its host still takes up room there: its memory snapshot and disk sit on that host's drives, and it counts against the host's capacity.

So after an hour asleep, a computer goes into deep sleep. Its disk moves off the host into storage, and the computer steps aside completely. It no longer counts toward your plan's limit of computers at once, and the host can use the room for running computers. Waking it brings up a fresh computer with the same disk on a host with room.

Storage for deep-asleep disks is split into chunks and stored by content. Two chunks with the same content are stored once. Many computers in the same project start from the same base image and the same template, so a large part of their disks is shared, and we only store each shared chunk once.

## Waking from storage without re-downloading

The risk with moving disks off the host is that waking becomes slow and expensive: every wake would download the disk again.

Two things keep it cheap.

- **The host keeps a cache of chunks.** When a computer wakes on the host it slept on, most of its chunks are still there. We copy them into the new disk without downloading or duplicating the data.
- **Chunks load in the order they are needed.** The host learns the order a project's computers read their disk while booting, and fetches chunks in that order, so a booting computer rarely waits on a chunk.

We found one bug here worth telling. Every deep wake was downloading 84 to 110 chunks it should already have had: the computer's own most recent writes. They were in the host's cache when the computer went to sleep, but a cleanup step that ran right after deep sleep threw them away, and the next wake asked for exactly those chunks. After the fix, deep wakes faulted zero chunks from storage (about 1,620 came from the cache), and the median deep wake went from 2.40 s to 1.80 s over 30 wakes.

## Clean up what nobody will use

Some of the cheapest storage is the storage you delete. A few rules keep old data from piling up:

- **Snapshots of replaced templates go.** When a template is rebuilt, snapshots of the old version can never be restored, so we drop them. On the first run of that cleanup, the store on one staging host went from 56 GB to 27 GB.
- **Idle snapshots expire.** Warm snapshots nobody has used in 7 days are removed.
- **Sleeping computers have a keep time.** That is the 7 days on Hobby and 30 on Pro. We email you before a computer is deleted (2 days before on Hobby, 7 days and 1 day before on Pro), and waking it resets the count.
- **Tool files aren't uploaded twice.** Each computer's tools (language runtimes and the like) come from a shared drive. We used to re-upload all of a computer's tool files on its first deep sleep after a host restart, about 12 GB and 10 minutes. Now the host keeps the parts each computer uses, and four computers went into deep sleep in 30 s with nothing uploaded.

## What this means for your bill

All of this is why we can offer:

- **Free sleep.** No running-time charge while a computer sleeps, on every plan.
- **Disk included in the hourly price.** A running computer's price covers its disk; there's no separate storage line for running computers.
- **Unlimited sleep for $6 a month on Pro**, with 200 GB of sleeping disk included and about $0.04 per GB-month past that.

As a rough example, a medium computer (8 vCPU, 16 GB) costs $0.0648 an hour. Left running all month, that's $47.30. Used four hours a day on workdays and asleep the rest of the time, it's about $5.70, and it wakes each morning with your terminals where you left them.

## What we'd still like to cut

- **The first sleep of a large computer** writes a full memory snapshot, which takes a while for 16 GB. A wake that arrives during that write waits for it.
- **Deep wakes** are a cold boot from disk, so running processes don't survive them. Keeping memory for longer costs more storage, which is the trade-off this whole post is about.

For how this looks from the user side, read [sleep and wake, explained](/blog/sleep-and-wake-explained). Prices are on the [pricing page](/pricing).

## Try homemade

Every project gets its own cloud computers, with Claude Code and Codex signed in. The Hobby plan is free.

[Start free](/login?signup=1)[See pricing](/pricing)

## Related posts

- [Sleep and wake, explained What happens when a cloud computer goes to sleep: memory snapshots, deep sleep, waking from a preview link, and what you pay while it sleeps.](/blog/sleep-and-wake-explained)
- [How we got click to terminal under 4 seconds From pressing Create to typing in a terminal: what took the time on a new cloud computer, what we cut, and the numbers before and after.](/blog/click-to-terminal-under-4-seconds)
- [Benchmarking a cloud computer with V8 How we ran the V8 Web Tooling Benchmark on a 4 vCPU homemade computer, what it scored, what it says about CPU speed, and what it doesn't.](/blog/v8-web-tooling-benchmark-cloud-computer)
- [All posts Every post](/blog)

Make yourself at home.

## Product

- [Pricing](/pricing)
- [Integrations](/integrations)
- [CLI](/cli)
- [MCP](/mcp)
- [API](/api)

## Use cases

- [Claude Code in the cloud](/claude-code-in-the-cloud)
- [Codex in the cloud](/codex-in-the-cloud)
- [AI agent sandbox](/ai-agent-sandbox)
- [Cloud dev environment](/cloud-dev-environment)
- [Preview environments](/preview-environments)

## Compare

- [All comparisons](/compare)

## Resources

- [Docs](https://docs.homemade.dev)
- [Blog](/blog)
- [llms.txt](https://docs.homemade.dev/llms.txt)

## Company

- [Contact](mailto:hello@homemade.dev)
- [GitHub](https://github.com/usehomemade/homemade)

## Legal

- [Impressum](/impressum)
- [Terms](/terms)
- [Privacy](/privacy)

© 2026 homemade.dev

---

Canonical: https://www.homemade.dev/blog/keeping-sleeping-computers-cheap
More pages: https://www.homemade.dev/llms.txt
