> ## Documentation Index
> Fetch the complete documentation index at: https://docs.archil.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Latency

> One script that measures disk create, delete, mount, checkpoint, branch, 4 KiB cache-miss reads, and durable 4 KiB writes on your own account.

These are the numbers in the [latency table on the Limits page](https://docs.archil.com/reference/limits.md#latency).

You can measure every latency row yourself with one script that uses the public API, the `archil` CLI, and `fio`.
Run it in the same cloud region as the disk, since a cross-region round trip is larger than most of these figures.

It needs `curl`, `jq`, `fio`, `journalctl`, the `archil` CLI, and an [API key](https://docs.archil.com/api-reference/introduction.md#authentication)
in `ARCHIL_API_KEY`. Set `API` to your region's [control plane endpoint](https://docs.archil.com/api-reference/introduction.md#base-url) and
`REGION` to match, then run it as root with `sudo -E bash latency.sh`. It takes about two minutes, creates disks named
`latency-test-*`, and deletes them when it finishes.

```bash latency.sh theme={null}
#!/usr/bin/env bash
set -euo pipefail
API="https://<control-plane-endpoint>"
REGION=aws-us-east-1
MNT=/mnt/latency-test
N=40
T=$(date +%s)
cd "$(mktemp -d)"

pct() { sort -n | awk -v p=$1 '{ a[NR] = $1 } END { print a[int((NR * p + 99) / 100)] }'; }
stats() { local v=$(cat); echo "p50 $(pct 50 <<< "$v"), p95 $(pct 95 <<< "$v")"; }
ms() { local s=$(date +%s%N); "$@" > /dev/null; echo $(( ($(date +%s%N) - s) / 1000000 )); }
api() { curl -sf -H "Authorization: Bearer $ARCHIL_API_KEY" -H 'Content-Type: application/json' "$@"; }
fiostat() { jq -r ".jobs[0].$1.clat_ns.percentile | \"p50 \(.[\"50.000000\"] / 1e6), p95 \(.[\"95.000000\"] / 1e6)\""; }

# Create and delete: request time after the TLS handshake
for i in $(seq $N); do
  api -o create.json -w '%{time_appconnect} %{time_total}\n' -X POST "$API/api/disks" \
    -d "{\"name\":\"latency-test-$T-$i\"}" >> create.txt
  api -o /dev/null -w '%{time_appconnect} %{time_total}\n' -X DELETE \
    "$API/api/disks/$(jq -r .data.diskId create.json)" >> delete.txt
done
echo "create ms: $(awk '{ print ($2 - $1) * 1000 }' create.txt | stats)"
echo "delete ms: $(awk '{ print ($2 - $1) * 1000 }' delete.txt | stats)"

api -o disk.json -X POST "$API/api/disks" -d "{\"name\":\"latency-test-$T\"}"
DISK=$(jq -r .data.diskId disk.json)
export ARCHIL_MOUNT_TOKEN=$(jq -r '.data.authorizedUsers[0].token' disk.json)
mkdir -p $MNT

# Mount: wall time of `archil mount`, and the time the client logs for itself
START=$(date '+%F %T')
for i in $(seq $N); do
  ms archil mount -q $DISK $MNT --region $REGION >> mount.txt
  archil unmount $MNT > /dev/null
done
echo "mount ms, wall: $(stats < mount.txt)"
echo "mount ms, client log: $(journalctl -t "archil-$DISK" --since "$START" \
  | grep -o 'Mounted disk in [0-9]*' | awk '{ print $4 }' | stats)"

# Checkpoint and branch: wall time of the CLI
archil mount -q $DISK $MNT --region $REGION > /dev/null
for i in $(seq $N); do ms archil checkpoints create $MNT cp-$i >> checkpoint.txt; done
for i in $(seq $N); do
  ms archil branches create $DISK br-$i --from-checkpoint cp-$i --region $REGION >> branch.txt
done
echo "checkpoint ms: $(stats < checkpoint.txt)"
echo "branch ms: $(stats < branch.txt)"

# Durable 4 KiB writes, one at a time
FIO="fio --name=t --bs=4k --iodepth=1 --direct=1 --time_based --runtime=30 --output-format=json"
echo "O_SYNC write ms: $($FIO --filename=$MNT/w --size=1G --rw=randwrite --sync=1 | fiostat write)"

# 4 KiB reads that miss the client cache: a fresh mount has a cold client cache, and the server
# still holds the file it just received. Read-ahead off so no read hits locally.
fio --name=fill --filename=$MNT/r --size=4G --rw=write --bs=1M --end_fsync=1 > /dev/null
archil unmount $MNT > /dev/null
archil mount -q $DISK $MNT --region $REGION --read-ahead 0 > /dev/null
echo "cache-miss read ms: $($FIO --filename=$MNT/r --size=4G --rw=randread | fiostat read)"

archil unmount $MNT > /dev/null
api -o /dev/null -X DELETE "$API/api/disks/$DISK"
```

Our run, from a c7gn.2xlarge in AWS `us-east-1` on October 27, 2026:

| Script line | p50 | p95 |
| - | - | - |
| `create ms` | 9.3 ms | 11 ms |
| `delete ms` | 8.1 ms | 10 ms |
| `mount ms, client log` | 41 ms | 49 ms |
| `mount ms, wall` | 50 ms | 58 ms |
| `checkpoint ms` | 13 ms | 19 ms |
| `branch ms` | 33 ms | 36 ms |
| `O_SYNC write ms` | 2.0 ms | 8.2 ms |
| `cache-miss read ms` | 0.50 ms | 0.75 ms |

* Create and delete leave out the TLS handshake, about 10 ms on a new connection.
* `mount ms, wall` includes starting the CLI. The client log line doesn't.
* Checkpoint and branch are CLI wall times, so they include starting the CLI, and branch also opens a new TLS
  connection.
* The read test mounts with `--read-ahead 0`. With the default, random reads also pull in neighboring blocks, so about
  a third of them hit the client cache.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.