iops
The complexity of the iops command at present means that GUI support is not (yet) available. You must use it via the command line.
The iops command is an extremely powerful tool that can be used to test a wide variety of scenarios. By default, it runs a medium size random test good for a quick look at a hard drive or solid state drive.
Possibilities include:
- Transfer size from 1K to 256MB;
- Number of transfers to perform (too few is inaccurate);
- Either random or sequential I/O can be specified (random is the default);
- Multiple simultaneous I/O threads to simulate severely loaded servers (default is one I/O thread);
- With multiple threads, a “gap” between their disk areas can be specified to for seeking;
Mac OS X caching
DiskTester always tests using user-level (non kernel) public file system APIs . This is important; driver-level tests would not only be dangerous but misleading: no real program writes directly to disk; all real programs use file system APIs.
Unless caching is enabled explicitly with the --caching flag, DiskTester always bypasses the Mac OS X unified buffer cache, so that the true speed of the drive is measured. The Mac OS X UBC is very efficient at what it does, so enabling caching can be expected to yield absurdly fast results. On a machine with 64GB of memory, you can see 60GB or so used for caching (if allowed)! You can easily see 3GB/sec read speeds with caching enabled (after having written it).
Even though DiskTester bypasses the Unified Buffer Cache, the system might still coalesce very small sequential writes, yielding results near the peak speed of the drive. Slightly larger transfers might then plummet in speed. Since this is “real world”, the results are in fact what you need to know, more relevant than the raw drive speed by itself. At any rate, this behavior cannot be disabled.
Drive caching
Hard drives vary in the amount of onboard cache. In general, any test that transfers an amount of data less than twice the size of the onboard cache is testing “burst speed”, which is relevant, but highly misleading for sustained workloads. A test size of 40X the drive cache size is recommended eg 1GB total I/O for a drive with a 32MB cache. Quadruple that for a 4-drive striped RAID.
Solid state drives have a variety of caching algorithms. Some use no cache, and some use a lot of it.
Random transfers
For random tests (the default), DiskTester uses unique random offsets; no two transfers are at the same location. The read phase uses the same locations as the write phase, in the same order by playing back the same series, but with reads instead of writes.
Test size
The test size spans a test file of this size:
(number of transfers) * (transfer size) + (gap size) * (number of threads -1)
DiskTester emits all relevant information as part of the test.
Key gotchas
Due to drive caching as well as optimizations in Mac OS X itself, very small write transfers (1K - 8K) can actually run much faster than larger ones (16K on up). Be careful not to assume too much based on one test!
Tips for testing with the iops command
The following will help get the most reliable results:
- Erase the drive before testing to the native drive speed can be measured without being partially full and/or fragmented (unless the goal is to test speed as-is);
- If the drive is an already-used SSD, it’s performance can be highly erratic; recondition it before testing. Exceptions include over-provisioned drives such as the Mercury Extreme.
- Exclude the volume from Spotlight search and Time Machine backup prior to testing.
- Avoid the temptation to run quick tests (unless the goal is burst speed testing); they can be highly volatile due to caching at various levels.
- Write tests with small transfer sizes are often faster than reads because of very large onboard drive caches; reads have no such advantage.
Command line usage
The command line allows greater control. Please use disktester help fill-volume for details on the available options. In general, there is little reason to use the command line.
iops [--xfer|-x <size[K|M|G|T]>] "4M" [--transfers|-t <count>] "100000" [--sequential|-s] "true" [--threads|-n <count>] "1" [--caching|-c] "true" <volume-name>
Examples
Considerable variation is possible. In most cases, random testing is advised, since various other DiskTester command are designed for sequential I/O. Random is the default.
All examples below use volume “Scratch”; your volume is likely to have a different name. Use quotes if the volume name contains space(s), or eliminate the space(s).
Test random access speed with the default transfer size :
disktester iops Scratch
Test random speed with 1K transfer size and 1 million transfers:
disktester iops --xfer 1K --transfers 1000000 Scratch
Test sequential speed with 4K transfer size:
disktester iops --sequential --xfer 4K Scratch
Test speed with 2K transfer size and 4 simultaneous I/O threads:
disktester iops --xfer 2K --threads 4 Scratch
Test random access speed with the default transfer size (ultra fast reads):
disktester iops --caching Scratch
Copyright © 2008-2010 diglloyd Inc, all rights reserved