how to clear FS cache

Miroslav Lachman 000.fbsd at quip.cz
Thu Nov 24 21:44:16 UTC 2016


Konstantin Belousov wrote on 2016/11/24 22:34:
> On Thu, Nov 24, 2016 at 10:08:28PM +0100, Miroslav Lachman wrote:
>> Is there a way to clear FS read cache between some benchmar runs?
>>
>> I am looking for something like this on linux
>>
>> $ sh -c "sync && echo 3 > /proc/sys/vm/drop_caches"
>
> cd /your/mount/point
> umount /your/mount/point
>
> First command makes the mount point busy, so the unmount fails.  But before
> failing, it flushes everything that is not used.

Nice trick, thank you! :)

Miroslav Lachman


More information about the freebsd-fs mailing list