如何清除Linux上的磁盘I/O缓存? [英] How to purge disk I/O caches on Linux?

查看:266
本文介绍了如何清除Linux上的磁盘I/O缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要这样做以实现更可预测的基准测试.

I need to do it for more predictable benchmarking.

推荐答案

听起来像您想要同步命令,或 sync()函数.

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

如果要刷新磁盘缓存:echo 3 | sudo tee /proc/sys/vm/drop_caches

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

这篇关于如何清除Linux上的磁盘I/O缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆