1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Proxmox VEがZFSのARCを全然確保してくれなかった件

Last updated at Posted at 2025-08-05

はじめに

メモリ128GBを積んだPCにProxmox VE8.2をインストールし,VM用データストアにHDD4本でZFSを組みました。メモリを多めに積んだのはZFSのARCを期待したからです。
ところが,VMの利用メモリが少ないにもかかわらず,ARCをあまり使ってくれずディスクキャッシュが全然効きません。

発生事象

どれだけZFSにアクセスしても,ARC sizeが12.6GiBを越えてくれません。
MAX sizeが12.6GiBなので,どれだけ負荷をかけてきっと越えてくれないでしょう。
zpool iostat -vで確認しても,HDDアクセスが多い状況です。

root@pve-****:~# arc_summary 

------------------------------------------------------------------------
ZFS Subsystem Report                            Tue Aug 05 20:24:55 2025
Linux 6.8.12-10-pve                                           2.2.7-pve2
Machine: pve-**** (x86_64)                                    2.2.7-pve2

ARC status:                                                      HEALTHY
        Memory throttle count:                                         0

ARC size (current):                                   100.2 %   12.6 GiB
        Target size (adaptive):                       100.0 %   12.6 GiB
        Min size (hard limit):                         31.2 %    3.9 GiB
        Max size (high water):                            3:1   12.6 GiB
        Anonymous data size:                            0.6 %   82.5 MiB
        Anonymous metadata size:                        0.0 %    0 Bytes
        MFU data target:                               30.0 %    3.7 GiB
        MFU data size:                                 30.3 %    3.8 GiB
        MFU ghost data size:                                     4.3 GiB

原因

Proxmox VE8.1以降の新規インストールでは,ARCを物理メモリの10%に制限してしまうとのこと。確かに物理128GiBの10%は12.8GiBなので,Max sizeの12.6GiBに近いです。なんてこった。

For new installations starting with Proxmox VE 8.1, the ARC usage limit will be set to 10 % of the installed physical memory, clamped to a maximum of 16 GiB.

裏取り

上記URLに,固定的に変更するなら/etc/modprobe.d/zfs.confを修正してくださいと書いてあります。zfs.confの内容を確認すると,確かに約12.8GiBぐらいです。この値はおそらくインストール時に設定されたのでしょう。

root@pve-****:~# cat /etc/modprobe.d/zfs.conf
options zfs zfs_arc_max=13482590208
root@pve-****:~# cat /sys/module/zfs/parameters/zfs_arc_max
13482590208

対処

zfs.conf内の値を,48GiB(51539607552=48*1024^3)に変更して再起動。zfs_arc_maxの設定が48GiBになったことを確認しました。

root@pve-****:~# cat /etc/modprobe.d/zfs.conf
options zfs zfs_arc_max=51539607552
root@pve-****:~# cat /sys/module/zfs/parameters/zfs_arc_max
51539607552

結果

その後zfsにそれなりのアクセスをした後にarc_summaryを確認。無事にARCを48GiB近く利用してくれました。zpool iostat -vを確認すると,HDDへのReadが激減し,体感パフォーマンスも向上しました。

root@pve-****:~# arc_summary 

------------------------------------------------------------------------
ZFS Subsystem Report                            Tue Aug 05 21:37:53 2025
Linux 6.8.12-10-pve                                           2.2.7-pve2
Machine: pve-**** (x86_64)                                    2.2.7-pve2

ARC status:                                                      HEALTHY
        Memory throttle count:                                         0

ARC size (current):                                    92.7 %   44.5 GiB
        Target size (adaptive):                       100.0 %   48.0 GiB
        Min size (hard limit):                          8.2 %    3.9 GiB
        Max size (high water):                           12:1   48.0 GiB
        Anonymous data size:                          < 0.1 %    3.6 MiB
        Anonymous metadata size:                        0.0 %    0 Bytes
        MFU data target:                               37.5 %   16.6 GiB
        MFU data size:                                 39.0 %   17.3 GiB
        MFU ghost data size:                                     0 Bytes
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?