Соответствующий тип файловой системы Linux (ubuntu 10.04) для быстрого управления многими небольшими файлами и каталогами [дубликат]

Возможный дубликат:
Лучшая файловая система Linux для работы с 10000 файлов без перегрузки системы ввода-вывода

У меня есть хранилище изображений размером 240 ГБ, содержащее примерно 1,5 миллиона записей. Около половины этих записей - файлы изображений (от 4 до 100 КБ), а другая половина этих записей - глубоко вложенные каталоги. Примерно половина этих изображений являются дубликатами и с тех пор превратились в жесткие ссылки друг на друга.

Я собираю резервную копию этой файловой системы и помещаю ее на локальный тестовый сервер с намерением радикально изменить структуру каталогов и протестировать изменения.

Обычно я бы просто настроил файловую систему, в которой живут эти образы, как ext4 (не меняйте значение по умолчанию, если это не нужно), но мне интересно, есть ли лучший вариант для этого конкретного случая использования.

Я уже исследовал XFS, ext3, ext4 и btrfs, но не нашел ни одного надежного теста, демонстрирующего, что для этой конкретной задачи я должен выбирать один вместо другого.

Я также ограничен ядром, доступным по умолчанию в Ubuntu 10.04, но буду перекомпилировать, если причина будет достаточно веской.

0
задан 13 April 2017 в 15:14
1 ответ

In general, performance should be the last selection criteria for choosing a filesystem. Things to non-exhaustibly consider are:

  • how stable is the filesystem
  • does it support journalling / crash consistency
  • how well does it handle lots of files in a directoy
  • how long does it take to fsck (or does it even need fscking)
  • does it support xattrs
  • does it play well with NFS, etc.
  • can the filesystem be resized, if so, can it be done online
  • does it support tail packing
  • can it be adjusted to play nicely with an underlying raid controller

I use ext4 and xfs heavily in my environment which is fairly heavy on data. I use ext4 for just about all filesystems that I know will never need to grow beyond 16TB (at present, ext4 in the mainline kernel supports filesystems > 16TB) but the utilities can't actually create them). ext3's fsck times get excessive for very large filesystems. xfs is very stable these days but has had memory leaks in the past and silent corruption issues. I used to use it in place of ext3 for fsck times and > 8TB filesystem creation (since fixed when the -F flag was introduced to mkfs.ext3) but was still having issues with it as recently as ~2.6.28. I will however note that I haven't had any confirmed issues with it on rhel/centos patched 2.6.18. I still feel that ext4 is a little more solid and has an upgrade path to btrfs but xfs is definitely stable now. I have more faith in the ext4 fscker.

As for performance, you must configure both to match the stripe size/stride of the underlying device. Ext4 lets you set the iopriority of the journal (journal_ioprio) which may need to be played with along with the journaling mode. xfs performs better than ext4 with less tuning but they are pretty close after proper setup. You really need to setup the stripe/stride with ext4. xfs does better for lots of small files as it can pack them completely into an inode to save space and is noticibly better for certain operations, like deleting large directory trees.

My advice is, unless you need > 16TB support) to try ext4 created with lots of one inode for every block (-i 4096) and to set it up for your raid device. Fully populate it with your data and then see how long it takes to fsck and do common operations. Only convert to xfs if you have a specific issue with ext4.

0
ответ дан 5 December 2019 в 16:58

Теги

Похожие вопросы