tmpfs
Tmpfs is a memory-backed filesystem that can speed up tasks with substantial filesystem I/O. The task's writable files and Docker data are stored in RAM and can be swapped to disk under memory pressure.
Tmpfs is disabled by default. To enable it, set tmpfs: true in the runner specification:
tasks:
- key: pnpm-install
use: [code, install-pnpm, system-packages]
runner:
tmpfs: true
run: pnpm install --frozen-lockfile
filter:
- .npmrc
- pnpm-lock.yaml
- pnpm-workspace.yaml
- package.json
- packages/*/package.json
Tasks can still reuse runners with tmpfs enabled.
Disk and RAM accounting
Enabling tmpfs doesn't load the entire filesystem from previous tasks into RAM.
| Data | Storage with tmpfs enabled |
|---|---|
| Previous task layers, non-Docker tool caches, and the base filesystem | Read-only layers backed by disk. These files don't all need to fit in RAM. |
| Current writable layer | Tmpfs, including new and modified workspace files and writes to /tmp. |
| Docker data | Images, container layers, volumes, and build cache share the writable layer's tmpfs. With docker: preserve-data, a baseline copy of restored Docker data also occupies space. |
Capacity
Tmpfs capacity is available task RAM plus disk-backed swap:
- RAM: configured runner memory minus 1.75 GB reserved for RWX.
- Swap: configured disk size minus the archive sizes of non-Docker input layers, including the prebuilt base when needed.
Docker data takes up space in tmpfs rather than reducing the swap allocation.
For example, a runner with 8 GB RAM, a 50 GB disk, and 20 GB of non-Docker input layers has 36.25 GB of tmpfs capacity: 6.25 GB of RAM plus 30 GB of swap.
Files and processes share RAM and swap, so leave room for process memory when estimating file storage. Tasks perform best when frequently accessed files and process memory fit in RAM; heavy swapping can erase the benefit of tmpfs.