Here's a super easy way to invalidate the disk cache, which is useful
for testing IO performance in the real world, where you can't rely on
all of your reads being served up from a super-fast RAM cache rather
than a vastly slower physical disk drive.
This will free up everything in the disk cache:
echo 3 > /proc/sys/vm/drop_caches
Or if you want more control over exactly what is being freed...
This frees up the pagecache (e.g., cache of contents of files):