Call me a noob here. So the timing functions used ioping goes through vsyscall (I assume gettimeofday) on both ends of the heavier aio/block io calls. Sure, the file system calls get hit with the context switch, but where does the inaccuracy come in? Are we saying that it doesn't measure the raw disk spindle, which I thought was a given as the test was designed as a kernel-userland interface test? Or did I misunderstand and there's something more fundamental elsewhere? I'm curious.
Where does the inaccuracy come from?
- Gettimeofday, on Linux, is setup with a shared page designed to cache/not perform a full read from hardware (depending on how good your timesources are), which makes it less expensive to call. It's not going to be completely accurate this way, either. Speed != Accuracy. That is why other OS's like FreeBSD have slower gettimeofday()/clock_gettime() because they perform a full lookup directly from the hardware. Mac has commpage, which is similar. This is a pessimistic issue, though (you're talking about ~50uS maybe on VPS's and modern CPUs)
- VPS's do not give direct access to hardware. You need ring0 to access say, the PIT/ACPI, but you don't need either to call rdtsc(). Some/most instructions are emulated,
- VPS's when they call write() do some funky caching stuff because, again, they do not have direct access to hardware.
ioping is only useful on dedicated servers, not VPS containers. You'll see wild results and they won't be consistent.