Search code examples
linuxcachingiodisk

How to purge disk I/O caches on Linux?


I need to do it for more predictable benchmarking.


Solution

  • Sounds like you want the sync command, or the sync() function.

    If you want disk cache flushing: echo 3 | sudo tee /proc/sys/vm/drop_caches