ファイルメタデータの割合は平均ファイルサイズが小さければ大きくなるらしい
こんにちは、のんピ(@non____97)です。
以下記事でAmazon FSx for NetApp ONTAP(以降FSx for ONTAP)のボリュームとSSDのサイジング方法を整理してみました。
その中で「ファイルのメタデータ割合は平均ファイルサイズに応じてメタデータの割合が変動」すると紹介しています。
参照元のAWS公式ドキュメントをよくよく見ると、平均ファイルサイズが小さいほどファイルメタデータの割合は大きくなると記載されていました。
ファイルメタデータは、通常、ファイルが消費するストレージ容量の 3~7% を消費します。この割合は、平均ファイルサイズ (平均ファイルサイズが小さいほど多くのメタデータが必要になります) と、ファイルのストレージ効率化で、どれだけ節約できるかによって異なります。ファイルメタデータはストレージ効率化による節約の恩恵を受けないことに注意してください。ファイルシステム上のメタデータに使用される SSD ストレージの容量を見積もるには、次のガイドラインが使用できます。
平均ファイルサイズ ファイルデータに対する、メタデータサイズの割合 4 KB 7% 8 KB 3.50% 32 KB 以上 1~3%
これは本当でしょうか。
私は当初inodeのサイズとファイルサイズとの割合と考えていました。
1つのinodeのサイズは288Bです。そのため、ファイルサイズが4KiBの場合のinodeに対する割合は288B / 4096B * 100 ≒ 7.0%
と上述の表と一致します。
しかし、ファイルサイズが32KiBの場合のinodeに対する割合は288B / (4096 * 2^5) * 100 ≒ 0.2%
と上述の表と一致していません。
そのため、inode以外の何かしらのメタデータが付与されているような気がします。
気になったので確認してみます。
いきなりまとめ
- 平均ファイルサイズが小さいほどファイルメタデータの割合は大きくなる傾向がある
- 検証した限り、32KiBの場合は例外
平均ファイルサイズが4KiB、8KiB、32KiBの場合
テストファイル作成前の確認
早速確認してみます。
AWS公式ドキュメントに記載の通り、平均ファイルサイズが4KiB、8KiB、32KiBの時のメタデータの割合を確認します。
ファイルメタデータは階層化ポリシーをAllにしていてもプライマリストレージに保存されるという特性があります。そのため、階層化ポリシーをAllにした時に何%がプライマリストレージに保存されていのかという観点で確認をします。
平均ファイルサイズに対応したボリュームを作成します。ボリュームサイズは128MBです。
# ボリュームの確認
::> volume show -volume vol_4KiB, vol_8KiB, vol_32KiB -fields size, available, used, files, tiering-policy
vserver volume size available used files tiering-policy
------- --------- ----- --------- ----- ----- --------------
SVM vol_32KiB 128MB 121.3MB 280KB 3884 all
SVM vol_4KiB 128MB 121.3MB 280KB 3884 all
SVM vol_8KiB 128MB 121.3MB 280KB 3884 all
3 entries were displayed.
# ボリュームの階層毎のデータサイズの確認
::> volume show-footprint -volume vol_4KiB, vol_8KiB, vol_32KiB
Vserver : SVM
Volume : vol_32KiB
Feature Used Used%
-------------------------------- ---------- -----
Volume Data Footprint 280KB 0%
Footprint in Performance Tier 552KB 100%
Footprint in FSxFabricpoolObjectStore
0B 0%
Volume Guarantee 0B 0%
Flexible Volume Metadata 1.31MB 0%
Delayed Frees 272KB 0%
Total Footprint 1.85MB 0%
Vserver : SVM
Volume : vol_4KiB
Feature Used Used%
-------------------------------- ---------- -----
Volume Data Footprint 280KB 0%
Footprint in Performance Tier 552KB 100%
Footprint in FSxFabricpoolObjectStore
0B 0%
Volume Guarantee 0B 0%
Flexible Volume Metadata 1.31MB 0%
Delayed Frees 272KB 0%
Total Footprint 1.85MB 0%
Vserver : SVM
Volume : vol_8KiB
Feature Used Used%
-------------------------------- ---------- -----
Volume Data Footprint 280KB 0%
Footprint in Performance Tier 552KB 100%
Footprint in FSxFabricpoolObjectStore
0B 0%
Volume Guarantee 0B 0%
Flexible Volume Metadata 1.31MB 0%
Delayed Frees 272KB 0%
Total Footprint 1.85MB 0%
3 entries were displayed.
# ボリュームの使用量の確認
::> volume show-space -volume vol_4KiB, vol_8KiB, vol_32KiB
Vserver : SVM
Volume : vol_32KiB
Feature Used Used%
-------------------------------- ---------- ------
User Data 40KB 0%
Filesystem Metadata 220KB 0%
Inodes 8KB 0%
Snapshot Reserve 6.40MB 5%
Deduplication 4KB 0%
Performance Metadata 8KB 0%
Total Used 6.67MB 5%
Total Physical Used 280KB 0%
Vserver : SVM
Volume : vol_4KiB
Feature Used Used%
-------------------------------- ---------- ------
User Data 40KB 0%
Filesystem Metadata 220KB 0%
Inodes 8KB 0%
Snapshot Reserve 6.40MB 5%
Deduplication 4KB 0%
Performance Metadata 8KB 0%
Total Used 6.67MB 5%
Total Physical Used 280KB 0%
Vserver : SVM
Volume : vol_8KiB
Feature Used Used%
-------------------------------- ---------- ------
User Data 40KB 0%
Filesystem Metadata 220KB 0%
Inodes 8KB 0%
Snapshot Reserve 6.40MB 5%
Deduplication 4KB 0%
Performance Metadata 8KB 0%
Total Used 6.67MB 5%
Total Physical Used 280KB 0%
各ボリュームとも既にプライマリストレージに552KB消費しています。こちらの影響が少なくなるように、いずれのボリュームも80MiB消費するようなファイルを作成します。
そうなると平均ファイルサイズが4KiBの場合は20,000ファイル作ることになります。ボリュームサイズ128MBのデフォルトではinode数では足りないので、inodeを20,100個割り当てられるように変更します。
# inode数の使用状況の確認
::> df -i -volume vol_4KiB, vol_8KiB, vol_32KiB
Filesystem iused ifree %iused Mounted on Vserver
/vol/vol_32KiB/ 96 3788 2% /vol_32KiB SVM
/vol/vol_4KiB/ 96 3788 2% /vol_4KiB SVM
/vol/vol_8KiB/ 96 3788 2% /vol_8KiB SVM
3 entries were displayed.
# inodeを20,100個割り当てられるように変更
::> volume modify -volume vol_4KiB, vol_8KiB, vol_32KiB -files 20100
Volume modify successful on volume vol_32KiB of Vserver SVM.
Volume modify successful on volume vol_4KiB of Vserver SVM.
Volume modify successful on volume vol_8KiB of Vserver SVM.
3 entries were modified.
# inode数の使用状況の確認
::> df -i -volume vol_4KiB, vol_8KiB, vol_32KiB
Filesystem iused ifree %iused Mounted on Vserver
/vol/vol_32KiB/ 96 20001 0% /vol_32KiB SVM
/vol/vol_4KiB/ 96 20001 0% /vol_4KiB SVM
/vol/vol_8KiB/ 96 20001 0% /vol_8KiB SVM
3 entries were displayed.
# inodeを20,100個割り当てられるように変更した結果、各階層の使用量が変わるのか確認
::> volume show-footprint -volume vol_4KiB, vol_8KiB, vol_32KiB
Vserver : SVM
Volume : vol_32KiB
Feature Used Used%
-------------------------------- ---------- -----
Volume Data Footprint 260KB 0%
Footprint in Performance Tier 804KB 100%
Footprint in FSxFabricpoolObjectStore
0B 0%
Volume Guarantee 0B 0%
Flexible Volume Metadata 1.31MB 0%
Delayed Frees 544KB 0%
Total Footprint 2.09MB 0%
Vserver : SVM
Volume : vol_4KiB
Feature Used Used%
-------------------------------- ---------- -----
Volume Data Footprint 260KB 0%
Footprint in Performance Tier 804KB 100%
Footprint in FSxFabricpoolObjectStore
0B 0%
Volume Guarantee 0B 0%
Flexible Volume Metadata 1.31MB 0%
Delayed Frees 544KB 0%
Total Footprint 2.09MB 0%
Vserver : SVM
Volume : vol_8KiB
Feature Used Used%
-------------------------------- ---------- -----
Volume Data Footprint 260KB 0%
Footprint in Performance Tier 804KB 100%
Footprint in FSxFabricpoolObjectStore
0B 0%
Volume Guarantee 0B 0%
Flexible Volume Metadata 1.31MB 0%
Delayed Frees 544KB 0%
Total Footprint 2.09MB 0%
3 entries were displayed.
# inodeを20,100個割り当てられるように変更した結果、ボリュームの使用量の確認
::> volume show-space -volume vol_4KiB, vol_8KiB, vol_32KiB
Vserver : SVM
Volume : vol_32KiB
Feature Used Used%
-------------------------------- ---------- ------
User Data 40KB 0%
Filesystem Metadata 208KB 0%
Inodes 8KB 0%
Snapshot Reserve 6.40MB 5%
Deduplication 4KB 0%
Total Used 6.65MB 5%
Total Physical Used 260KB 0%
Vserver : SVM
Volume : vol_4KiB
Feature Used Used%
-------------------------------- ---------- ------
User Data 40KB 0%
Filesystem Metadata 208KB 0%
Inodes 8KB 0%
Snapshot Reserve 6.40MB 5%
Deduplication 4KB 0%
Total Used 6.65MB 5%
Total Physical Used 260KB 0%
Vserver : SVM
Volume : vol_8KiB
Feature Used Used%
-------------------------------- ---------- ------
User Data 40KB 0%
Filesystem Metadata 208KB 0%
Inodes 8KB 0%
Snapshot Reserve 6.40MB 5%
Deduplication 4KB 0%
Total Used 6.65MB 5%
Total Physical Used 260KB 0%
3 entries were displayed.
Inodes
は増えていませんが、Footprint in Performance Tier
は552KB
から804KB
に増加しました。Inodeの上限を変更するだけでもオーバーヘッドが増えるようですね。
テストファイル作成
それでは、テストファイルを作成します。
# SVMのルートボリュームをマウント
$ sudo mount -t nfs svm-0404cd705c847e961.fs-05f72eb8f8d03c709.fsx.us-east-1.amazonaws.com:/ /mnt/fsxn/
# SVMのルートボリュームがマウントできていることを確認
$ df -hT -t nfs4
Filesystem Type Size Used Avail Use% Mounted on
svm-0404cd705c847e961.fs-05f72eb8f8d03c709.fsx.us-east-1.amazonaws.com:/ nfs4 973M 2.0M 971M 1% /mnt/fsxn
# テストファイルを保存する各ボリュームにアクセスする
$ ls -l /mnt/fsxn/vol_4KiB/
total 0
$ ls -l /mnt/fsxn/vol_8KiB/
total 0
$ ls -l /mnt/fsxn/vol_32KiB/
total 0
# テストファイルを保存する各ボリュームを認識できているか確認
$ df -hT -t nfs4
Filesystem Type Size Used Avail Use% Mounted on
svm-0404cd705c847e961.fs-05f72eb8f8d03c709.fsx.us-east-1.amazonaws.com:/ nfs4 973M 2.0M 971M 1% /mnt/fsxn
svm-0404cd705c847e961.fs-05f72eb8f8d03c709.fsx.us-east-1.amazonaws.com:/vol_4KiB nfs4 122M 256K 122M 1% /mnt/fsxn/vol_4KiB
svm-0404cd705c847e961.fs-05f72eb8f8d03c709.fsx.us-east-1.amazonaws.com:/vol_8KiB nfs4 122M 320K 122M 1% /mnt/fsxn/vol_8KiB
svm-0404cd705c847e961.fs-05f72eb8f8d03c709.fsx.us-east-1.amazonaws.com:/vol_32KiB nfs4 122M 320K 122M 1% /mnt/fsxn/vol_32KiB
# 平均ファイルサイズが4KiBの書き込み
$ for i in {0000..19999}; do
sudo dd if=/dev/urandom of=/mnt/fsxn/vol_4KiB/random_block_file_${i} bs=4K count=1
done
# 平均ファイルサイズが8KiBの書き込み
$ for i in {0000..9999}; do
sudo dd if=/dev/urandom of=/mnt/fsxn/vol_8KiB/random_block_file_${i} bs=8K count=1
done
# 平均ファイルサイズが32KiBの書き込み
$ for i in {0000..2499}; do
sudo dd if=/dev/urandom of=/mnt/fsxn/vol_32KiB/random_block_file_${i} bs=32K count=1
done
# テストファイル作成後の各ボリュームの使用量を確認
$ df -hT -t nfs4
Filesystem Type Size Used Avail Use% Mounted on
svm-0404cd705c847e961.fs-05f72eb8f8d03c709.fsx.us-east-1.amazonaws.com:/ nfs4 973M 2.1M 971M 1% /mnt/fsxn
svm-0404cd705c847e961.fs-05f72eb8f8d03c709.fsx.us-east-1.amazonaws.com:/vol_4KiB nfs4 122M 86M 36M 71% /mnt/fsxn/vol_4KiB
svm-0404cd705c847e961.fs-05f72eb8f8d03c709.fsx.us-east-1.amazonaws.com:/vol_8KiB nfs4 122M 83M 40M 68% /mnt/fsxn/vol_8KiB
svm-0404cd705c847e961.fs-05f72eb8f8d03c709.fsx.us-east-1.amazonaws.com:/vol_32KiB nfs4 122M 90M 33M 74% /mnt/fsxn/vol_32KiB
ボリュームの使用量は32KiB > 4KiB > 8KiB
の順番です。
ONTAP CLIからも確認してみましょう。
# ボリュームの階層毎のデータサイズの確認
::> volume show-footprint -volume vol_4KiB, vol_8KiB, vol_32KiB
Vserver : SVM
Volume : vol_32KiB
Feature Used Used%
-------------------------------- ---------- -----
Volume Data Footprint 89.16MB 0%
Footprint in Performance Tier
11.89MB 13%
Footprint in FSxFabricpoolObjectStore
78.12MB 87%
Volume Guarantee 0B 0%
Flexible Volume Metadata 1.31MB 0%
Delayed Frees 868KB 0%
Total Footprint 91.32MB 0%
Vserver : SVM
Volume : vol_4KiB
Feature Used Used%
-------------------------------- ---------- -----
Volume Data Footprint 85.98MB 0%
Footprint in Performance Tier
7.98MB 9%
Footprint in FSxFabricpoolObjectStore
78.12MB 91%
Volume Guarantee 0B 0%
Flexible Volume Metadata 1.31MB 0%
Delayed Frees 120KB 0%
Total Footprint 87.41MB 0%
Vserver : SVM
Volume : vol_8KiB
Feature Used Used%
-------------------------------- ---------- -----
Volume Data Footprint 82.25MB 0%
Footprint in Performance Tier
4.68MB 6%
Footprint in FSxFabricpoolObjectStore
78.12MB 94%
Volume Guarantee 0B 0%
Flexible Volume Metadata 1.31MB 0%
Delayed Frees 564KB 0%
Total Footprint 84.11MB 0%
3 entries were displayed.
# ボリュームの使用量の確認
::> volume show-space -volume vol_4KiB, vol_8KiB, vol_32KiB
Vserver : SVM
Volume : vol_32KiB
Feature Used Used%
-------------------------------- ---------- ------
User Data 88.12MB 69%
Filesystem Metadata 244KB 0%
Inodes 728KB 1%
Snapshot Reserve 6.40MB 5%
Deduplication 4KB 0%
Performance Metadata 96KB 0%
Total Used 95.56MB 75%
Total Physical Used 89.16MB 70%
Vserver : SVM
Volume : vol_4KiB
Feature Used Used%
-------------------------------- ---------- ------
User Data 79.64MB 62%
Filesystem Metadata 244KB 0%
Inodes 5.62MB 4%
Snapshot Reserve 6.40MB 5%
Deduplication 4KB 0%
Performance Metadata 488KB 0%
Total Used 92.38MB 72%
Total Physical Used 85.98MB 67%
Vserver : SVM
Volume : vol_8KiB
Feature Used Used%
-------------------------------- ---------- ------
User Data 78.90MB 62%
Filesystem Metadata 240KB 0%
Inodes 2.82MB 2%
Snapshot Reserve 6.40MB 5%
Deduplication 4KB 0%
Performance Metadata 296KB 0%
Total Used 88.65MB 69%
Total Physical Used 82.25MB 64%
3 entries were displayed.
いずれのボリュームもFootprint in FSxFabricpoolObjectStore
は78.12MB
ですが、Footprint in Performance Tier
がそれぞれ異なりますね。また、平均ファイルサイズが小さいほど多くのinodeを消費しているため、Inodes
も異なります。
各使用量と割合をまとめると以下のようになります。
平均ファイルサイズ | プライマリストレージの使用量 | プライマリストレージの割合 | Inodesの使用量 | プライマリストレージの使用量 - Inodesの使用量 |
---|---|---|---|---|
4KiB | 7.98MB | 9% | 5.62MB | 2.36MB |
8KiB | 4.68MB | 6% | 2.82MB | 1.86MB |
32KiB | 11.89MB | 13% | 728KB | 11.162MB |
Inode分を差し引いても32KiB > 4KiB > 8KiB
の順番でした。
平均ファイルサイズが大きくなれば、ファイルメタデータの割合は小さくなるということにはなりませんでした。
平均ファイルサイズが32KiBのパターンをリトライ (その1)
平均ファイルサイズが32KiBのパターンの場合、最もプライマリストレージの消費量が多いということになりました。
たまたまなのか分からないので、もう一度チャレンジします。
検証用に新しくボリュームを作成します。パラメーターは先の検証と同じです。
# ボリュームの確認
::> volume show -volume vol_32KiB_2 -fields size, available, used, files, tiering-policy
vserver volume size available used files tiering-policy
------- ----------- ----- --------- ----- ----- --------------
SVM vol_32KiB_2 128MB 121.3MB 280KB 3884 all
# inodeを20,100個割り当てられるように変更
::> volume modify -volume vol_32KiB_2 -files 20100
Volume modify successful on volume vol_32KiB_2 of Vserver SVM.
# ボリュームの階層毎のデータサイズの確認
::> volume show-footprint -volume vol_32KiB_2
Vserver : SVM
Volume : vol_32KiB_2
Feature Used Used%
-------------------------------- ---------- -----
Volume Data Footprint 260KB 0%
Footprint in Performance Tier 804KB 100%
Footprint in FSxFabricpoolObjectStore
0B 0%
Volume Guarantee 0B 0%
Flexible Volume Metadata 1.31MB 0%
Delayed Frees 544KB 0%
Total Footprint 2.09MB 0%
テストファイルを作成します。
$ for i in {0000..2499}; do
sudo dd if=/dev/urandom of=/mnt/fsxn/vol_32KiB_2/random_block_file_${i} bs=32K count=1
done
テストファイル作成後、ONTAP CLIでボリュームの使用量を確認します。
# ボリュームの階層毎のデータサイズの確認
::> volume show-footprint -volume vol_32KiB_2
Vserver : SVM
Volume : vol_32KiB_2
Feature Used Used%
-------------------------------- ---------- -----
Volume Data Footprint 89.17MB 0%
Footprint in Performance Tier
12.18MB 13%
Footprint in FSxFabricpoolObjectStore
78.12MB 87%
Volume Guarantee 0B 0%
Flexible Volume Metadata 1.31MB 0%
Delayed Frees 1.14MB 0%
Total Footprint 91.62MB 0%
# ボリュームの使用量の確認
::> volume show-space -volume vol_32KiB_2
Vserver : SVM
Volume : vol_32KiB_2
Feature Used Used%
-------------------------------- ---------- ------
User Data 88.12MB 69%
Filesystem Metadata 244KB 0%
Inodes 728KB 1%
Snapshot Reserve 6.40MB 5%
Deduplication 4KB 0%
Performance Metadata 104KB 0%
Total Used 95.57MB 75%
Total Physical Used 89.17MB 70%
1回目と同じでプライマリストレージに保存している割合は13%となりました。
平均ファイルサイズが64KiB、128KiB、256KiBの場合
テストファイル作成前の確認
これ以上調査すると沼にハマるので、平均ファイルサイズがより大きい場合はどうなるのかを確認します。
試しに、平均ファイルサイズが64KiB、128KiB、256KiBで確認してみます。
# ボリュームの確認
::> volume show -volume vol_64KiB, vol_128KiB, vol_256KiB -fields size, available, used, files, tiering-policy
vserver volume size available used files tiering-policy
------- ---------- ----- --------- ----- ----- --------------
SVM vol_128KiB 128MB 121.3MB 280KB 3884 all
SVM vol_256KiB 128MB 121.3MB 280KB 3884 all
SVM vol_64KiB 128MB 121.3MB 280KB 3884 all
3 entries were displayed.
# inodeを20,100個割り当てられるように変更
::> volume modify -volume vol_64KiB, vol_128KiB, vol_256KiB -files 20100
Volume modify successful on volume vol_128KiB of Vserver SVM.
Volume modify successful on volume vol_256KiB of Vserver SVM.
Volume modify successful on volume vol_64KiB of Vserver SVM.
3 entries were modified.
# ボリュームの階層毎のデータサイズの確認
::> volume show-footprint -volume vol_64KiB, vol_128KiB, vol_256KiB
Vserver : SVM
Volume : vol_128KiB
Feature Used Used%
-------------------------------- ---------- -----
Volume Data Footprint 260KB 0%
Footprint in Performance Tier 804KB 100%
Footprint in FSxFabricpoolObjectStore
0B 0%
Volume Guarantee 0B 0%
Flexible Volume Metadata 1.31MB 0%
Delayed Frees 544KB 0%
Total Footprint 2.09MB 0%
Vserver : SVM
Volume : vol_256KiB
Feature Used Used%
-------------------------------- ---------- -----
Volume Data Footprint 260KB 0%
Footprint in Performance Tier 804KB 100%
Footprint in FSxFabricpoolObjectStore
0B 0%
Volume Guarantee 0B 0%
Flexible Volume Metadata 1.31MB 0%
Delayed Frees 544KB 0%
Total Footprint 2.09MB 0%
Vserver : SVM
Volume : vol_64KiB
Feature Used Used%
-------------------------------- ---------- -----
Volume Data Footprint 260KB 0%
Footprint in Performance Tier 804KB 100%
Footprint in FSxFabricpoolObjectStore
0B 0%
Volume Guarantee 0B 0%
Flexible Volume Metadata 1.31MB 0%
Delayed Frees 544KB 0%
Total Footprint 2.09MB 0%
3 entries were displayed.
# ボリュームの使用量の確認
::> volume show-space -volume vol_64KiB, vol_128KiB, vol_256KiB
Vserver : SVM
Volume : vol_128KiB
Feature Used Used%
-------------------------------- ---------- ------
User Data 40KB 0%
Filesystem Metadata 208KB 0%
Inodes 8KB 0%
Snapshot Reserve 6.40MB 5%
Deduplication 4KB 0%
Total Used 6.65MB 5%
Total Physical Used 260KB 0%
Vserver : SVM
Volume : vol_256KiB
Feature Used Used%
-------------------------------- ---------- ------
User Data 40KB 0%
Filesystem Metadata 208KB 0%
Inodes 8KB 0%
Snapshot Reserve 6.40MB 5%
Deduplication 4KB 0%
Total Used 6.65MB 5%
Total Physical Used 260KB 0%
Vserver : SVM
Volume : vol_64KiB
Feature Used Used%
-------------------------------- ---------- ------
User Data 40KB 0%
Filesystem Metadata 208KB 0%
Inodes 8KB 0%
Snapshot Reserve 6.40MB 5%
Deduplication 4KB 0%
Total Used 6.65MB 5%
Total Physical Used 260KB 0%
3 entries were displayed.
テストファイル作成
それでは、テストファイルを作成します。
# 平均ファイルサイズが64KiBの書き込み
for i in {0000..1249}; do
sudo dd if=/dev/urandom of=/mnt/fsxn/vol_64KiB/random_block_file_${i} bs=64K count=1
done
# 平均ファイルサイズが128KiBの書き込み
for i in {0000..624}; do
sudo dd if=/dev/urandom of=/mnt/fsxn/vol_128KiB/random_block_file_${i} bs=128K count=1
done
# 平均ファイルサイズが256KiBの書き込み
for i in {0000..312}; do
sudo dd if=/dev/urandom of=/mnt/fsxn/vol_256KiB/random_block_file_${i} bs=256K count=1
done
# テストファイル作成後の各ボリュームの使用量を確認
$ df -hT -t nfs4
Filesystem Type Size Used Avail Use% Mounted on
svm-0404cd705c847e961.fs-05f72eb8f8d03c709.fsx.us-east-1.amazonaws.com:/ nfs4 973M 2.2M 971M 1% /mnt/fsxn
svm-0404cd705c847e961.fs-05f72eb8f8d03c709.fsx.us-east-1.amazonaws.com:/vol_4KiB nfs4 122M 86M 36M 71% /mnt/fsxn/vol_4KiB
svm-0404cd705c847e961.fs-05f72eb8f8d03c709.fsx.us-east-1.amazonaws.com:/vol_8KiB nfs4 122M 83M 40M 68% /mnt/fsxn/vol_8KiB
svm-0404cd705c847e961.fs-05f72eb8f8d03c709.fsx.us-east-1.amazonaws.com:/vol_32KiB nfs4 122M 90M 33M 74% /mnt/fsxn/vol_32KiB
svm-0404cd705c847e961.fs-05f72eb8f8d03c709.fsx.us-east-1.amazonaws.com:/vol_32KiB_2 nfs4 122M 90M 33M 74% /mnt/fsxn/vol_32KiB_2
svm-0404cd705c847e961.fs-05f72eb8f8d03c709.fsx.us-east-1.amazonaws.com:/vol_64KiB nfs4 122M 84M 38M 69% /mnt/fsxn/vol_64KiB
svm-0404cd705c847e961.fs-05f72eb8f8d03c709.fsx.us-east-1.amazonaws.com:/vol_128KiB nfs4 122M 82M 41M 67% /mnt/fsxn/vol_128KiB
svm-0404cd705c847e961.fs-05f72eb8f8d03c709.fsx.us-east-1.amazonaws.com:/vol_256KiB nfs4 122M 80M 42M 66% /mnt/fsxn/vol_256KiB
ボリュームの使用量は64KiB > 127KiB > 256KiB
の順番です。
ONTAP CLIからも確認してみましょう。
# ボリュームの階層毎のデータサイズの確認
::> volume show-footprint -volume vol_64KiB, vol_128KiB, vol_256KiB
Vserver : SVM
Volume : vol_128KiB
Feature Used Used%
-------------------------------- ---------- -----
Volume Data Footprint 81.12MB 0%
Footprint in Performance Tier
4.21MB 5%
Footprint in FSxFabricpoolObjectStore
78.12MB 95%
Volume Guarantee 0B 0%
Flexible Volume Metadata 1.31MB 0%
Delayed Frees 1.21MB 0%
Total Footprint 83.64MB 0%
Vserver : SVM
Volume : vol_256KiB
Feature Used Used%
-------------------------------- ---------- -----
Volume Data Footprint 79.91MB 0%
Footprint in Performance Tier
2.73MB 3%
Footprint in FSxFabricpoolObjectStore
78.25MB 97%
Volume Guarantee 0B 0%
Flexible Volume Metadata 1.31MB 0%
Delayed Frees 1.07MB 0%
Total Footprint 82.29MB 0%
Vserver : SVM
Volume : vol_64KiB
Feature Used Used%
-------------------------------- ---------- -----
Volume Data Footprint 83.80MB 0%
Footprint in Performance Tier
5.92MB 7%
Footprint in FSxFabricpoolObjectStore
78.12MB 93%
Volume Guarantee 0B 0%
Flexible Volume Metadata 1.31MB 0%
Delayed Frees 252KB 0%
Total Footprint 85.35MB 0%
3 entries were displayed.
# ボリュームの使用量の確認
::> volume show-space -volume vol_64KiB, vol_128KiB, vol_256KiB
Vserver : SVM
Volume : vol_128KiB
Feature Used Used%
-------------------------------- ---------- ------
User Data 80.65MB 63%
Filesystem Metadata 240KB 0%
Inodes 192KB 0%
Snapshot Reserve 6.40MB 5%
Deduplication 4KB 0%
Performance Metadata 40KB 0%
Total Used 87.52MB 68%
Total Physical Used 81.12MB 63%
Vserver : SVM
Volume : vol_256KiB
Feature Used Used%
-------------------------------- ---------- ------
User Data 79.54MB 62%
Filesystem Metadata 240KB 0%
Inodes 104KB 0%
Snapshot Reserve 6.40MB 5%
Deduplication 4KB 0%
Performance Metadata 32KB 0%
Total Used 86.30MB 67%
Total Physical Used 79.91MB 62%
Vserver : SVM
Volume : vol_64KiB
Feature Used Used%
-------------------------------- ---------- ------
User Data 83.14MB 65%
Filesystem Metadata 240KB 0%
Inodes 372KB 0%
Snapshot Reserve 6.40MB 5%
Deduplication 4KB 0%
Performance Metadata 56KB 0%
Total Used 90.20MB 70%
Total Physical Used 83.80MB 65%
3 entries were displayed.
いずれのボリュームもFootprint in FSxFabricpoolObjectStore
は78.12MBですが、Footprint in Performance Tier
がそれぞれ異なります。
各使用量と割合をまとめると以下のようになります。
平均ファイルサイズ | プライマリストレージの使用量 | プライマリストレージの割合 |
---|---|---|
64KiB | 5.92MB | 7% |
128KiB | 4.21MB | 5% |
256KiB | 2.73MB | 3% |
平均ファイルサイズが512KiB、1024KiB、2048KiBの場合
テストファイル作成前の確認
この勢いのまま平均ファイルサイズをさらに大きくした場合の挙動を確認します。
平均ファイルサイズが512KiB、1,024KiB、2,048KiBで確認してみます。
# ボリュームの確認
::> volume show -volume vol_512KiB, vol_1024KiB, vol_2048KiB -fields size, available, used, files, tiering-policy
vserver volume size available used files tiering-policy
------- ----------- ----- --------- ----- ----- --------------
SVM vol_1024KiB 128MB 121.3MB 280KB 3884 all
SVM vol_2048KiB 128MB 121.3MB 280KB 3884 all
SVM vol_512KiB 128MB 121.3MB 280KB 3884 all
3 entries were displayed.
# inodeを20,100個割り当てられるように変更
::> volume modify -volume vol_512KiB, vol_1024KiB, vol_2048KiB -files 20100
Volume modify successful on volume vol_1024KiB of Vserver SVM.
Volume modify successful on volume vol_2048KiB of Vserver SVM.
Volume modify successful on volume vol_512KiB of Vserver SVM.
3 entries were modified.
# ボリュームの階層毎のデータサイズの確認
::> volume show-footprint -volume vol_512KiB, vol_1024KiB, vol_2048KiB
Vserver : SVM
Volume : vol_1024KiB
Feature Used Used%
-------------------------------- ---------- -----
Volume Data Footprint 260KB 0%
Footprint in Performance Tier 804KB 100%
Footprint in FSxFabricpoolObjectStore
0B 0%
Volume Guarantee 0B 0%
Flexible Volume Metadata 1.31MB 0%
Delayed Frees 544KB 0%
Total Footprint 2.09MB 0%
Vserver : SVM
Volume : vol_2048KiB
Feature Used Used%
-------------------------------- ---------- -----
Volume Data Footprint 260KB 0%
Footprint in Performance Tier 804KB 100%
Footprint in FSxFabricpoolObjectStore
0B 0%
Volume Guarantee 0B 0%
Flexible Volume Metadata 1.31MB 0%
Delayed Frees 544KB 0%
Total Footprint 2.09MB 0%
Vserver : SVM
Volume : vol_512KiB
Feature Used Used%
-------------------------------- ---------- -----
Volume Data Footprint 260KB 0%
Footprint in Performance Tier 804KB 100%
Footprint in FSxFabricpoolObjectStore
0B 0%
Volume Guarantee 0B 0%
Flexible Volume Metadata 1.31MB 0%
Delayed Frees 544KB 0%
Total Footprint 2.09MB 0%
3 entries were displayed.
# ボリュームの使用量の確認
::> volume show-space -volume vol_512KiB, vol_1024KiB, vol_2048KiB
Vserver : SVM
Volume : vol_1024KiB
Feature Used Used%
-------------------------------- ---------- ------
User Data 40KB 0%
Filesystem Metadata 208KB 0%
Inodes 8KB 0%
Snapshot Reserve 6.40MB 5%
Deduplication 4KB 0%
Total Used 6.65MB 5%
Total Physical Used 260KB 0%
Vserver : SVM
Volume : vol_2048KiB
Feature Used Used%
-------------------------------- ---------- ------
User Data 40KB 0%
Filesystem Metadata 208KB 0%
Inodes 8KB 0%
Snapshot Reserve 6.40MB 5%
Deduplication 4KB 0%
Total Used 6.65MB 5%
Total Physical Used 260KB 0%
Vserver : SVM
Volume : vol_512KiB
Feature Used Used%
-------------------------------- ---------- ------
User Data 40KB 0%
Filesystem Metadata 208KB 0%
Inodes 8KB 0%
Snapshot Reserve 6.40MB 5%
Deduplication 4KB 0%
Total Used 6.65MB 5%
Total Physical Used 260KB 0%
3 entries were displayed.
テストファイル作成
それでは、テストファイルを作成します。
# 平均ファイルサイズが512KiBの書き込み
for i in {0000..156}; do
sudo dd if=/dev/urandom of=/mnt/fsxn/vol_512KiB/random_block_file_${i} bs=512K count=1
done
# 平均ファイルサイズが1,024KiBの書き込み
for i in {0000..78}; do
sudo dd if=/dev/urandom of=/mnt/fsxn/vol_1024KiB/random_block_file_${i} bs=1024K count=1
done
# 平均ファイルサイズが2,048KiBの書き込み
for i in {0000..39}; do
sudo dd if=/dev/urandom of=/mnt/fsxn/vol_2048KiB/random_block_file_${i} bs=2048K count=1
done
# テストファイル作成後の各ボリュームの使用量を確認
$ df -hT -t nfs4
Filesystem Type Size Used Avail Use% Mounted on
svm-0404cd705c847e961.fs-05f72eb8f8d03c709.fsx.us-east-1.amazonaws.com:/ nfs4 973M 2.4M 971M 1% /mnt/fsxn
svm-0404cd705c847e961.fs-05f72eb8f8d03c709.fsx.us-east-1.amazonaws.com:/vol_4KiB nfs4 122M 86M 36M 71% /mnt/fsxn/vol_4KiB
svm-0404cd705c847e961.fs-05f72eb8f8d03c709.fsx.us-east-1.amazonaws.com:/vol_8KiB nfs4 122M 83M 40M 68% /mnt/fsxn/vol_8KiB
svm-0404cd705c847e961.fs-05f72eb8f8d03c709.fsx.us-east-1.amazonaws.com:/vol_32KiB nfs4 122M 90M 33M 74% /mnt/fsxn/vol_32KiB
svm-0404cd705c847e961.fs-05f72eb8f8d03c709.fsx.us-east-1.amazonaws.com:/vol_32KiB_2 nfs4 122M 90M 33M 74% /mnt/fsxn/vol_32KiB_2
svm-0404cd705c847e961.fs-05f72eb8f8d03c709.fsx.us-east-1.amazonaws.com:/vol_64KiB nfs4 122M 84M 38M 69% /mnt/fsxn/vol_64KiB
svm-0404cd705c847e961.fs-05f72eb8f8d03c709.fsx.us-east-1.amazonaws.com:/vol_128KiB nfs4 122M 82M 41M 67% /mnt/fsxn/vol_128KiB
svm-0404cd705c847e961.fs-05f72eb8f8d03c709.fsx.us-east-1.amazonaws.com:/vol_256KiB nfs4 122M 80M 42M 66% /mnt/fsxn/vol_256KiB
svm-0404cd705c847e961.fs-05f72eb8f8d03c709.fsx.us-east-1.amazonaws.com:/vol_512KiB nfs4 122M 80M 43M 66% /mnt/fsxn/vol_512KiB
svm-0404cd705c847e961.fs-05f72eb8f8d03c709.fsx.us-east-1.amazonaws.com:/vol_1024KiB nfs4 122M 80M 42M 66% /mnt/fsxn/vol_1024KiB
svm-0404cd705c847e961.fs-05f72eb8f8d03c709.fsx.us-east-1.amazonaws.com:/vol_2048KiB nfs4 122M 81M 41M 67% /mnt/fsxn/vol_2048KiB
ボリュームの使用量は2,048KiB > 512KiB > 1,024KiB
の順番です。ただ、これはファイル数を2の累乗にしていなかったため、作成されたテストファイルの総サイズが綺麗に80MiBとなっていないためです。
ONTAP CLIからも確認してみます。
# ボリュームの階層毎のデータサイズの確認
::> volume show-footprint -volume vol_512KiB, vol_1024KiB, vol_2048KiB
Vserver : SVM
Volume : vol_1024KiB
Feature Used Used%
-------------------------------- ---------- -----
Volume Data Footprint 79.99MB 0%
Footprint in Performance Tier
1.11MB 1%
Footprint in FSxFabricpoolObjectStore
79MB 99%
Volume Guarantee 0B 0%
Flexible Volume Metadata 1.31MB 0%
Delayed Frees 120KB 0%
Total Footprint 81.41MB 0%
Vserver : SVM
Volume : vol_2048KiB
Feature Used Used%
-------------------------------- ---------- -----
Volume Data Footprint 80.82MB 0%
Footprint in Performance Tier
1.07MB 1%
Footprint in FSxFabricpoolObjectStore
80MB 99%
Volume Guarantee 0B 0%
Flexible Volume Metadata 1.31MB 0%
Delayed Frees 252KB 0%
Total Footprint 82.38MB 0%
Vserver : SVM
Volume : vol_512KiB
Feature Used Used%
-------------------------------- ---------- -----
Volume Data Footprint 79.51MB 0%
Footprint in Performance Tier
1.26MB 2%
Footprint in FSxFabricpoolObjectStore
78.50MB 98%
Volume Guarantee 0B 0%
Flexible Volume Metadata 1.31MB 0%
Delayed Frees 252KB 0%
Total Footprint 81.07MB 0%
3 entries were displayed.
# ボリュームの使用量の確認
::> volume show-space -volume vol_512KiB, vol_1024KiB, vol_2048KiB
Vserver : SVM
Volume : vol_1024KiB
Feature Used Used%
-------------------------------- ---------- ------
User Data 79.66MB 62%
Filesystem Metadata 240KB 0%
Inodes 36KB 0%
Snapshot Reserve 6.40MB 5%
Deduplication 4KB 0%
Performance Metadata 56KB 0%
Total Used 86.39MB 67%
Total Physical Used 79.99MB 62%
Vserver : SVM
Volume : vol_2048KiB
Feature Used Used%
-------------------------------- ---------- ------
User Data 80.51MB 63%
Filesystem Metadata 240KB 0%
Inodes 24KB 0%
Snapshot Reserve 6.40MB 5%
Deduplication 4KB 0%
Performance Metadata 56KB 0%
Total Used 87.22MB 68%
Total Physical Used 80.82MB 63%
Vserver : SVM
Volume : vol_512KiB
Feature Used Used%
-------------------------------- ---------- ------
User Data 79.16MB 62%
Filesystem Metadata 240KB 0%
Inodes 60KB 0%
Snapshot Reserve 6.40MB 5%
Deduplication 4KB 0%
Performance Metadata 56KB 0%
Total Used 85.91MB 67%
Total Physical Used 79.51MB 62%
3 entries were displayed.
各ボリュームのFootprint in Performance Tier
の量と割合をまとめると以下のようになります。
平均ファイルサイズ | プライマリストレージの使用量 | プライマリストレージの割合 |
---|---|---|
512KiB | 1.26MB | 2% |
1,024KiB | 1.11MB | 1% |
2,048KiB | 1.07MB | 1% |
平均ファイルサイズが大きいほど、ファイルメタデータの割合は小さくなっていますね。
平均ファイルサイズが32KiBのパターンをリトライ (その2)
今までの検証の結果をまとめると以下になります。
平均ファイルサイズ | プライマリストレージの使用量 | プライマリストレージの割合 |
---|---|---|
4KiB | 7.98MB | 9% |
8KiB | 4.68MB | 6% |
32KiB | 11.89MB | 13% |
64KiB | 5.92MB | 7% |
128KiB | 4.21MB | 5% |
256KiB | 2.73MB | 3% |
512KiB | 1.26MB | 2% |
1,024KiB | 1.11MB | 1% |
2,048KiB | 1.07MB | 1% |
やはり32KiBのパターンが誤差というには、あまりにも外れています。
もしかしたら、ファイル数の影響もあるかもしれません。
ということで、作成するファイルの数をファイル数が1,250、625、313個と変えた場合合のプライマリストレージの割合を確認してみます。
各パターン専用のボリュームを用意して、テストファイルを作成します。
# 32KiBのファイルを1,250個作成
for i in {0000..1249}; do
sudo dd if=/dev/urandom of=/mnt/fsxn/vol_32KiB_files_1249/random_block_file_${i} bs=32K count=1
done
# 32KiBのファイルを625個作成
for i in {0000..624}; do
sudo dd if=/dev/urandom of=/mnt/fsxn/vol_32KiB_files_624/random_block_file_${i} bs=32K count=1
done
# 32KiBのファイルを313個作成
for i in {0000..312}; do
sudo dd if=/dev/urandom of=/mnt/fsxn/vol_32KiB_files_312/random_block_file_${i} bs=32K count=1
done
# ボリュームの使用量を確認
$ df -hT -t nfs4
Filesystem Type Size Used Avail Use% Mounted on
svm-0404cd705c847e961.fs-05f72eb8f8d03c709.fsx.us-east-1.amazonaws.com:/ nfs4 973M 1.9M 971M 1% /mnt/fsxn
svm-0404cd705c847e961.fs-05f72eb8f8d03c709.fsx.us-east-1.amazonaws.com:/vol_32KiB_files_1249 nfs4 122M 45M 77M 37% /mnt/fsxn/vol_32KiB_files_1249
svm-0404cd705c847e961.fs-05f72eb8f8d03c709.fsx.us-east-1.amazonaws.com:/vol_32KiB_files_624 nfs4 122M 23M 100M 19% /mnt/fsxn/vol_32KiB_files_624
svm-0404cd705c847e961.fs-05f72eb8f8d03c709.fsx.us-east-1.amazonaws.com:/vol_32KiB_files_312 nfs4 122M 12M 111M 10% /mnt/fsxn/vol_32KiB_files_312
ONTAP CLIでプライマリストレージの割合を確認します。
# ボリュームの階層毎のデータサイズの確認
::> volume show-footprint -volume vol_32KiB_files_1249, vol_32KiB_files_624, vol_32KiB_files_312
Vserver : SVM
Volume : vol_32KiB_files_1249
Feature Used Used%
-------------------------------- ---------- -----
Volume Data Footprint 44.74MB 0%
Footprint in Performance Tier
5.91MB 13%
Footprint in FSxFabricpoolObjectStore
39.06MB 87%
Volume Guarantee 0B 0%
Flexible Volume Metadata 1.31MB 0%
Delayed Frees 244KB 0%
Total Footprint 46.29MB 0%
Vserver : SVM
Volume : vol_32KiB_files_312
Feature Used Used%
-------------------------------- ---------- -----
Volume Data Footprint 11.43MB 0%
Footprint in Performance Tier
2.82MB 22%
Footprint in FSxFabricpoolObjectStore
9.78MB 78%
Volume Guarantee 0B 0%
Flexible Volume Metadata 1.31MB 0%
Delayed Frees 1.18MB 0%
Total Footprint 13.91MB 0%
Vserver : SVM
Volume : vol_32KiB_files_624
Feature Used Used%
-------------------------------- ---------- -----
Volume Data Footprint 22.51MB 0%
Footprint in Performance Tier
4.15MB 18%
Footprint in FSxFabricpoolObjectStore
19.53MB 82%
Volume Guarantee 0B 0%
Flexible Volume Metadata 1.31MB 0%
Delayed Frees 1.17MB 0%
Total Footprint 24.99MB 0%
3 entries were displayed.
# ボリュームの使用量の確認
::> volume show-space -volume vol_32KiB_files_1249, vol_32KiB_files_624, vol_32KiB_files_312
Vserver : SVM
Volume : vol_32KiB_files_1249
Feature Used Used%
-------------------------------- ---------- ------
User Data 44.08MB 34%
Filesystem Metadata 232KB 0%
Inodes 372KB 0%
Snapshot Reserve 6.40MB 5%
Deduplication 4KB 0%
Performance Metadata 68KB 0%
Total Used 51.14MB 40%
Total Physical Used 44.74MB 35%
Vserver : SVM
Volume : vol_32KiB_files_312
Feature Used Used%
-------------------------------- ---------- ------
User Data 11.07MB 9%
Filesystem Metadata 224KB 0%
Inodes 104KB 0%
Snapshot Reserve 6.40MB 5%
Deduplication 4KB 0%
Performance Metadata 40KB 0%
Total Used 17.83MB 14%
Total Physical Used 11.43MB 9%
Vserver : SVM
Volume : vol_32KiB_files_624
Feature Used Used%
-------------------------------- ---------- ------
User Data 22.06MB 17%
Filesystem Metadata 224KB 0%
Inodes 192KB 0%
Snapshot Reserve 6.40MB 5%
Deduplication 4KB 0%
Performance Metadata 40KB 0%
Total Used 28.91MB 23%
Total Physical Used 22.51MB 18%
3 entries were displayed.
各ボリュームのFootprint in Performance Tier
の割合をまとめると以下のようになります。
ファイル数 | プライマリストレージの割合 |
---|---|
312 | 22% |
624 | 18% |
1249 | 13% |
ファイル数が増える度にプライマリストレージの割合が減っていっていますね。ただ、AWS公式ドキュメントに記載の1〜3%とはかけ離れています。沼が見えているのでこれ以上は追求しません。
平均ファイルサイズが小さいほどファイルメタデータの割合は大きくなる傾向がある
Amazon FSx for NetApp ONTAPにおいて、平均ファイルサイズが小さいほどファイルメタデータの割合は大きくなるのか確認してみました。
結論、平均ファイルサイズが32KiBの場合を除いて、平均ファイルサイズが小さいほどファイルメタデータの割合は大きくなる傾向があることが分かりました。
この記事が誰かの助けになれば幸いです。
以上、AWS事業本部 コンサルティング部の のんピ(@non____97)でした!