Saturday, January 13, 2018

Meltdown patch reduces mkfile(8) throughput to less than 1/3 on macOS

In a previous post, I noted that mkfile was severely syscall limited on OSX due to too small transaction sizes, managing only around 250MB/s on the built-in SSD hardware that could achieve 2GB/s with larger buffer size.

I just retested the stock mkfile after the meltdown patch, and I/O rates are now down to a measly 61.5MB/s, measured both by wall-clock (well, time) and iostat. That's actually 1/4 the throughtput measured before, but the new timing is also with APFS enabled. Using large buffers to minimize the number of sys calls and presumably effectively eliminates the meltdown penalty shows the maximum throughput with APFS to be reduced by about 20% compared to before, to 1.6GBs. Just to put that graphically, here's disk throughput pre-APFS/Meltdown and post, using either very large block sizes (1MB) or the 512 byte block sizes used by mkfile:

So more than ever: use (really) large batches for I/O!