Outils pour utilisateurs

Outils du site


tech:disque_cache_flush_sync_io_purge

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
tech:disque_cache_flush_sync_io_purge [2025/03/24 15:06] – créée - modification externe 127.0.0.1tech:disque_cache_flush_sync_io_purge [2026/07/17 10:35] (Version actuelle) Jean-Baptiste
Ligne 1: Ligne 1:
 +<!DOCTYPE markdown>
 +{{tag>Brouillon FS Cache}}
 +
 +# Disque cache flush sync io purge
 +
 +Source : 
 +* http://stackoverflow.com/questions/9551838/how-to-purge-disk-i-o-caches-on-linux
 +* https://www.kernel.org/doc/Documentation/sysctl/vm.txt
 +* https://en.wikipedia.org/wiki/Sync_(Unix)
 +
 +`drop_caches.sh`
 +~~~bash
 +echo 3 | sudo tee /proc/sys/vm/drop_caches
 +~~~
 +
 +~~~bash
 +#!/bin/bash
 +sync
 +echo 3 >/proc/sys/vm/drop_caches
 +swapoff -a && swapon -a
 +~~~
 +
 +~~~bash
 +# (move data, modified through FS -> HDD cache) + flush HDD cache
 +sync
 +
 +# (slab + pagecache) -> HDD (https://www.kernel.org/doc/Documentation/sysctl/vm.txt)
 +echo 3 > /proc/sys/vm/drop_caches 
 +
 +blockdev --flushbufs /dev/sda
 +hdparm -F /dev/sda
 +
 +#  Command that should be run before unplug, flushes everything guaranteed
 +echo 1 > /sys/block/sdX/device/delete
 +~~~
 +
 +watch the progress of a `sync` operation
 +Source : http://unix.stackexchange.com/questions/48235/can-i-watch-the-progress-of-a-sync-operation
 +~~~bash
 +watch grep -e Dirty: -e Writeback: /proc/meminfo
 +awk '{print $9}' /sys/block/sda/stat
 +~~~
 +
  

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki