Managing Disk Quotas & Volume Size Limits
Apply quotas and size limits so one volume cannot exhaust the host disk.
In plain words
Define both the physical ceiling and the operational alert threshold for stateful data, not merely a quota flag in a compose file.
Think of it like…
A nominal room limit means little if all tenants share one water tank; the shared tank needs a low-water alarm and each outlet may need its own meter.
Where you’ve seen it
In practice, df -h /var/lib/docker; findmnt -T /var/lib/docker/volumes; xfs_quota -x -c report /srv/docker-data is the concrete move for this job: apply quotas and size limits so one volume cannot exhaust the host disk. The release is not accepted until fill only a dedicated test quota, observe ENOSPC behavior, and confirm Prometheus or host alerts fire before 90% use confirms the result.
Words you’ll hear
- Quotas
- The implementation control in
df -h /var/lib/docker; findmnt -T /var/lib/docker/volumes; xfs_quota -x -c report /srv/docker-datafor apply quotas and size limits so one volume cannot exhaust the host disk. - Size Limits
- The result to observe with
fill only a dedicated test quota, observe ENOSPC behavior, and confirm Prometheus or host alerts fire before 90% use, rather than infer from a successful command alone. - Disk Pressure
- The production boundary exposed when believing --storage-opt size= affects every storage driver, or watching percentage used while inode exhaustion is the real failure.
Visual diagram
Theory & deep dive
Quotas control path
The concrete mechanism is df -h /var/lib/docker; findmnt -T /var/lib/docker/volumes; xfs_quota -x -c report /srv/docker-data. The observable result is fill only a dedicated test quota, observe ENOSPC behavior, and confirm Prometheus or host alerts fire before 90% use; if those disagree, inspect the runtime evidence before changing unrelated settings.
Apply quotas and size limits so one volume cannot exhaust the host disk. Keep Quotas, Size Limits and Disk Pressure in the same deployment record so the intent and the observed state cannot drift apart.
df -h /var/lib/docker; findmnt -T /var/lib/docker/volumes; xfs_quota -x -c report /srv/docker-data
fill only a dedicated test quota, observe ENOSPC behavior, and confirm Prometheus or host alerts fire before 90% use, not with command success alone.Disk Pressure failure boundary
A full data volume can stall databases, write incomplete checkpoints and fill the shared Docker host. A quota at the VM disk can still allow one local volume to starve every image layer on the same filesystem. The narrow failure to design for is believing --storage-opt size= affects every storage driver, or watching percentage used while inode exhaustion is the real failure.
Accept this compromise explicitly: Per-volume quotas limit blast radius; separate filesystems/VM disks give stronger isolation at higher provisioning cost. The controlled check-fill only a dedicated test quota, observe ENOSPC behavior, and confirm Prometheus or host alerts fire before 90% use-also identifies the point where a different design is safer.
Exercise this failure safely: believing --storage-opt size= affects every storage driver, or watching percentage used while inode exhaustion is the real failure.
How it works, step by step
Step 1 of 41. State the boundary
Write down why the workload needs this: A full data volume can stall databases, write incomplete checkpoints and fill the shared Docker host. A quota at the VM disk can still allow one local volume to starve every image layer on the same filesystem.
- Intent
- Quotas
When to use it & trade-offs
What it is
Docker does not impose a universal logical size limit on local volumes. Enforce capacity at the filesystem, LVM/ZFS/Btrfs, cloud block-device, storage-driver or application layer, and alert before the host filesystem reaches its hard limit.
Why it matters: A full data volume can stall databases, write incomplete checkpoints and fill the shared Docker host. A quota at the VM disk can still allow one local volume to starve every image layer on the same filesystem.
When to reach for it
- The fit is strongest for this job: apply quotas and size limits so one volume cannot exhaust the host disk. Pair it with
fill only a dedicated test quota, observe ENOSPC behavior, and confirm Prometheus or host alerts fire before 90% usein the runbook. - Production Quotas changes should make Size Limits observable through
df -h /var/lib/docker; findmnt -T /var/lib/docker/volumes; xfs_quota -x -c report /srv/docker-data, rather than trusting the runtime default. - Keep a rollback example for the case where believing --storage-opt size= affects every storage driver, or watching percentage used while inode exhaustion is the real failure.
When to avoid or be careful
- Do not accept command success while the system can still fail by believing --storage-opt size= affects every storage driver, or watching percentage used while inode exhaustion is the real failure.
- Avoid erasing Disk Pressure protection merely to dodge this cost: “Per-volume quotas limit blast radius; separate filesystems/VM disks give stronger isolation at higher provisioning cost”.
- Do not replace the evidence path-
fill only a dedicated test quota, observe ENOSPC behavior, and confirm Prometheus or host alerts fire before 90% use-with a screenshot or a mutable tag.
df -h /var/lib/docker; findmnt -T /var/lib/docker/volumes; xfs_quota -x -c report /srv/docker-data: practical choices
Strengths: Docker does not impose a universal logical size limit on local volumes. Enforce capacity at the filesystem, LVM/ZFS/Btrfs, cloud block-device, storage-driver or application layer, and alert before the host filesystem reaches its hard limit.
Watch out: Per-volume quotas limit blast radius; separate filesystems/VM disks give stronger isolation at higher provisioning cost.
Strengths: It can begin with df -h /var/lib/docker; findmnt -T /var/lib/docker/volumes; xfs_quota -x -c report /srv/docker-data and fewer surrounding controls.
Watch out: It silently accepts believing --storage-opt size= affects every storage driver, or watching percentage used while inode exhaustion is the real failure, which makes the result hard to reproduce after promotion.
Strengths: A full data volume can stall databases, write incomplete checkpoints and fill the shared Docker host. A quota at the VM disk can still allow one local volume to starve every image layer on the same filesystem.
Watch out: The platform adds an ownership and debugging layer; retain fill only a dedicated test quota, observe ENOSPC behavior, and confirm Prometheus or host alerts fire before 90% use as the direct check.
Interview signals & numbers to know
When this topic comes up
- df -h /var/lib/docker; findmnt -T /var/lib/docker/volumes; xfs_quota -x -c report /srv/docker-data
- fill only a dedicated test quota, observe ENOSPC behavior, and confirm Prometheus or host alerts fire before 90% use
- Failure signature: believing --storage-opt size= affects every storage driver, or watching percentage used while inode exhaustion is the real failure
- Trade-off: Per-volume quotas limit blast radius; separate filesystems/VM disks give stronger isolation at higher provisioning cost.
Benchmarks & rules of thumb
- 90%
- common alert threshold, before hard full
- 100% blocks and 100% inodes
- both can independently produce ENOSPC behavior
- 1 underlying filesystem
- many local volumes may compete on the same disk
Common mistakes & follow-ups
Common interview mistakes
- Treating a successful
df -h /var/lib/docker; findmnt -T /var/lib/docker/volumes; xfs_quota -x -c report /srv/docker-dataas proof and skippingfill only a dedicated test quota, observe ENOSPC behavior, and confirm Prometheus or host alerts fire before 90% use. - Believing --storage-opt size= affects every storage driver, or watching percentage used while inode exhaustion is the real failure
- Optimizing Quotas without accepting that per-volume quotas limit blast radius; separate filesystems/VM disks give stronger isolation at higher provisioning cost.
Likely interviewer follow-ups
- Why does
df -h /var/lib/docker; findmnt -T /var/lib/docker/volumes; xfs_quota -x -c report /srv/docker-dataaddress Quotas here rather than through application code? - How would you distinguish healthy Size Limits from the failure “believing --storage-opt size= affects every storage driver, or watching percentage used while inode exhaustion is the real failure” using
fill only a dedicated test quota, observe ENOSPC behavior, and confirm Prometheus or host alerts fire before 90% use? - When would this trade-off-“Per-volume quotas limit blast radius; separate filesystems/VM disks give stronger isolation at higher provisioning cost”-justify a different Disk Pressure design?
df -h /var/lib/docker; findmnt -T /var/lib/docker/volumes; xfs_quota -x -c report /srv/docker-data-and one proof-fill only a dedicated test quota, observe ENOSPC behavior, and confirm Prometheus or host alerts fire before 90% use. Then name the boundary: believing --storage-opt size= affects every storage driver, or watching percentage used while inode exhaustion is the real failure.Knowledge check
Put it into practice
Practice related interview Q&A
Apply Managing Disk Quotas & Volume Size Limits with generative AI interview Q&A and hands-on practice.