많은 작은 파일에 가장 적합한 파일 시스템은 무엇입니까?

많은 작은 파일에 가장 적합한 파일 시스템은 무엇입니까?

나는 1억 2천만 개가 넘는 작은 파일을 저장하고 싶은 2TB 드라이브가 있는 Debian 10 서버를 가지고 있습니다. ext4를 사용하면 inode가 부족해집니다.

어떤 파일 시스템을 사용해야 합니까?

reiserfs 및 reiser4에 대해 읽었지만 여전히 지원되는지 확실하지 않습니다.

제가 사용할 수 있는 내장 데비안 패키지가 포함된 파일 시스템이 있나요?

주요 사용 사례는 Apache를 사용하여 256x256 래스터 지도 타일을 사용자에게 제공하는 것입니다. 제한 요소는 핑 시간이기 때문에 속도는 그다지 중요하지 않다고 생각합니다. 최대한 많은 바이트를 사용하는 것도 중요하지만, 디스크 여유 공간도 많습니다.

편집: 파일은 일반적으로 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.

관련 정보