
私は1億2000万個を超える小さなファイルを保存したい2TBドライブを搭載したDebian 10サーバーを持っています。 ext4を使用すると、inodeが不足します。
どのファイルシステムを使用する必要がありますか?
reiserfsとreiser4について読みましたが、それでもサポートされているかどうかはわかりません。
私が使用できる組み込みのDebianパッケージを含むファイルシステムはありますか?
主なユースケースは、Apacheを使用して256x256ラスターマップタイルをユーザーに提供することです。制限要因はping時間なので、速度はそれほど重要ではないと思います。できるだけ多くのバイトを使用することも重要ですが、ディスクの空き容量もたくさんあります。
編集:ファイルは通常1kbから3kbです。
答え1
「小さい」サイズを指定しませんが、ファイルが十分に小さく圧縮可能な場合、embedded_data
この機能が有効になっているZFSプールはブロックポインタ自体に「小さい」ファイルを格納できるため、ブロック(またはそれ以上)を割り当てる必要はありません。 )ファイルストレージスペースを提供し、ファイルデータがファイルメタデータとともにブロックポインタ自体に書き込まれるため、ファイルを読み書きするためのI / O呼び出しも削除されます。
また、ZFSにはinodeが不足していません。
embedded_data This feature improves the performance and compression ratio of highly-compressible blocks. Blocks whose contents can compress to 112 bytes or smaller can take advantage of this feature. When this feature is enabled, the contents of highly- compressible blocks are stored in the block "pointer" itself (a misnomer in this case, as it contains the compressed data, rather than a pointer to its location on disk). Thus the space of the block (one sector, typically 512 bytes or 4KB) is saved, and no additional i/o is needed to read and write the data block.
答え2
ディスク容量の使用を最適化したいとします(inodeの数だけでなくアクセス時間も可能です)。
ファイルシステムが必要な場合があります。ブロック再割り当て/テールマージ小さなデータを物理ディスクの割り当て単位(「クラスタ」)に統合します。
また、状況によっては、ファイルシステムのクラスタサイズを制御してスペースを節約することが賢明かもしれません。最適値は試験によって決定することができる。
Linuxの確かな候補はbtrfs
。
もちろん、これに満足していればext4
(スペース最適化ではないかもしれません)、多くのinodeを選択してファイルシステムを再作成することができます(最初にバックアップしたい場合は、別の場所にデータをコピーしてください)。
からmke2fs(8)
:
-N number-of-inodes
Overrides the default calculation of the number of inodes that
should be reserved for the filesystem (which is based on the number
of blocks and the bytes-per-inode ratio). This allows the user to
specify the number of desired inodes directly.