Zfs

ZFS“自動調整”何時以及多久發生一次?

  • June 8, 2021

我已閱讀“添加 TRIM 支持”文章,但未能找到“ZFS 何時以及多久autotrim發生一次?”的線索。以及如何觀察 的活動autotrim

提前感謝您的評論。

ZFS autotrim 確實是一個連續的、機會主義的操作,它在塊/範圍被釋放後執行。

手冊頁:

自動修剪 = 開 | 離開

當設置為最近釋放且不再由池分配的空間時,將定期修剪…**自動修剪不會在釋放後立即回收塊。**相反,它會樂觀地延遲允許將較小的範圍聚合成幾個較大的範圍。然後這些可以更有效地發佈到儲存。

有關更多詳細資訊,您可以查看以下程式碼註釋:

Automatic TRIM happens continuously in the background and operates
solely on recently freed blocks (ms_trim not ms_allocatable).
...
While the automatic TRIM process is highly effective it is more likely
than a manual TRIM to encounter tiny ranges.  Ranges less than or equal to
'zfs_trim_extent_bytes_min' (32k) are considered too small to efficiently
TRIM and are skipped.  This means small amounts of freed space may not
be automatically trimmed.

引用自:https://serverfault.com/questions/1047802