How to Slow Down Your Disk I/O by 60× on macOS Using dmc
Learn how to use macOS’s built-in dmc utility to artificially throttle disk read/write speeds, configure various HDD/SSD profiles, and verify the impact with fio benchmarks, enabling realistic performance testing on low-speed machines without complex cgroup or Docker setups.
How to Reduce Your Disk Read/Write Speed by 60×
During development you may need to simulate a slow disk to verify that your code still works on low‑performance machines. While tools like cgroup or Docker can do this, they are cumbersome on a MacBook. macOS provides a built‑in utility called dmc that can achieve the same effect.
dmc Usage
Run dmc -h to see the available commands:
usage: dmc <commands>...
# commands:
start <mount>(profile_name|profile_index [-boot])
stop <mount>
status <mount>[-json]
show profile_name|profile_index
list
select <mount>(profile_name|profile_index)
configure <mount> <type> <access_time> <read_throughput> <write_throughput> [ioqueue_depth maxreadcnt maxwritecnt segreadcnt segwritecnt]
help | -hdmc includes several predefined disk profiles:
0: Faulty 5400 HDD
1: 5400 HDD
2: 7200 HDD
3: Slow SSD
4: SATA II SSD
5: SATA III SSD
6: PCIe 2 SSD
7: PCIe 3 SSDEach profile defines access time, read/write throughput, queue depth, and other limits. For example, profile 0 (Faulty 5400 HDD) has 52 222 µs access time and 50 MB/s throughput, while profile 7 (PCIe 3 SSD) offers 3 µs access time and up to 3072 MB/s read throughput.
Applying a Profile
Assume the target mount point is /tmp/data. To apply profile 0 (the slowest), run: sudo dmc start /tmp/data 0 Check the status to confirm the profile is active:
dmc status /tmp/data
Disk Mount Conditioner: ON
Profile: Custom
Type: HDD
Access time: 52222 us
Read throughput: 50 MB/s
Write throughput: 50 MB/s
I/O Queue Depth: 16
Max Read Bytes: 1048576
Max Write Bytes: 1048576
Max Read Segments: 128
Max Write Segments: 128Verification with fio
Use fio to benchmark the disk. First, with the slow profile active:
fio --filename=./data/test1 --direct=1 --rw=write --ioengine=posixaio --bs=1m --iodepth=32 --size=1G --numjobs=1 --runtime=60 --time_base=1 --group_reporting --name=test-seq-read --log_avg_msec=1000The sequential write of a 1 GB file yields only about 95 MB/s and 91 IOPS.
Now stop the profile and run the same command:
sudo dmc stop /tmp/data
fio --filename=./data/test1 --direct=1 --rw=write --ioengine=posixaio --bs=1m --iodepth=32 --size=1G --numjobs=1 --runtime=60 --time_base=1 --group_reporting --name=test-seq-read --log_avg_msec=1000The result jumps to roughly 3210 MB/s and 3060 IOPS, reflecting the disk’s true performance.
Conclusion
The dmc tool is handy for creating realistic low‑speed disk scenarios on macOS without the overhead of containers or cgroups. It simplifies performance testing and helps ensure your software behaves correctly under constrained I/O conditions.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
