[opensuse-kernel] optimizing ext4 bytes-per-inode on large arrays installed on opensuse?
I'm replacing a RAID array for a NAS. I'm about to create a the ext4 partition on the primary, full-disk LV. The original LV had been formatted ext4, with defaults, mkfs.ext4 /dev/VG0/NAS03 I'm looking at the original drive's usage, hoping to optimize the new drive. /bin/df /dev/VG0/NAS03 Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/VG0-NAS03 1548182724 1383153132 86363468 95% /NAS03 /bin/df -i /dev/VG0/NAS03 Filesystem Inodes IUsed IFree IUse% Mounted on /dev/mapper/VG0-NAS03 98312192 1182797 97129395 2% /NAS03 For 1383153132 1K blocks = 1,416,348,807,168 bytes in use results in an effective 'bytes-per-inode' 1,416,348,807,168 / 1182797 = 1,197,457 bytes/inode The ext4 fs defaults for mke2fs on opensuse are cat /etc/mke2fs.conf [defaults] base_features = sparse_super,filetype,resize_inode,dir_index,ext_attr default_mntopts = acl,user_xattr enable_periodic_fsck = 0 blocksize = 4096 inode_size = 256 inode_ratio = 16384 [fs_types] ... ext4 = { features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize auto_64-bit_support = 1 inode_size = 256 } ... The parameters are documented at https://ext4.wiki.kernel.org/index.php/Frequently_Asked_Questions http://man7.org/linux/man-pages/man5/ext4.5.html Assuming (correct?) that "inode_ratio" == "bytes-per-inode" Comparing the default vs effective ratios 16384 <<< 1,197,457 where the effective ratio for my current usage profile falls between largefile = { inode_ratio = 1048576 blocksize = -1 } & largefile4 = { inode_ratio = 4194304 blocksize = -1 } Assuming that usage over time will be similar for the new LV, and Usage: mkfs.ext4 [-c|-l filename] [-b block-size] [-C cluster-size] [-i bytes-per-inode] [-I inode-size] [-J journal-options] [-G flex-group-size] [-N number-of-inodes] [-m reserved-blocks-percentage] [-o creator-os] [-g blocks-per-group] [-L volume-label] [-M last-mounted-directory] [-O feature[,...]] [-r fs-revision] [-E extended-option[,...]] [-t fs-type] [-T usage-type ] [-U UUID] [-jnqvDFKSV] device [blocks-count] for optimal performance, *should* the new LV fs be created as mkfs.ext4 -T largefile ... ? Might as well get it right before locking it in. LT -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
I'm replacing a RAID array for a NAS.
I'm about to create a the ext4 partition on the primary, full-disk LV.
The original LV had been formatted ext4, with defaults,
mkfs.ext4 /dev/VG0/NAS03
I'm looking at the original drive's usage, hoping to optimize the new drive.
/bin/df /dev/VG0/NAS03 Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/VG0-NAS03 1548182724 1383153132 86363468 95% /NAS03
/bin/df -i /dev/VG0/NAS03 Filesystem Inodes IUsed IFree IUse% Mounted on /dev/mapper/VG0-NAS03 98312192 1182797 97129395 2% /NAS03
For
1383153132 1K blocks = 1,416,348,807,168 bytes in use
results in an effective 'bytes-per-inode'
1,416,348,807,168 / 1182797 = 1,197,457 bytes/inode
The ext4 fs defaults for mke2fs on opensuse are
cat /etc/mke2fs.conf [defaults] base_features = sparse_super,filetype,resize_inode,dir_index,ext_attr default_mntopts = acl,user_xattr enable_periodic_fsck = 0 blocksize = 4096 inode_size = 256 inode_ratio = 16384
[fs_types] ... ext4 = { features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize auto_64-bit_support = 1 inode_size = 256 } ...
The parameters are documented at
https://ext4.wiki.kernel.org/index.php/Frequently_Asked_Questions http://man7.org/linux/man-pages/man5/ext4.5.html
Assuming (correct?) that
"inode_ratio" == "bytes-per-inode"
Comparing the default vs effective ratios
16384 <<< 1,197,457
where the effective ratio for my current usage profile falls between
largefile = { inode_ratio = 1048576 blocksize = -1 }
& largefile4 = { inode_ratio = 4194304 blocksize = -1 }
Assuming that usage over time will be similar for the new LV, and
Usage: mkfs.ext4 [-c|-l filename] [-b block-size] [-C cluster-size] [-i bytes-per-inode] [-I inode-size] [-J journal-options] [-G flex-group-size] [-N number-of-inodes] [-m reserved-blocks-percentage] [-o creator-os] [-g blocks-per-group] [-L volume-label] [-M last-mounted-directory] [-O feature[,...]] [-r fs-revision] [-E extended-option[,...]] [-t fs-type] [-T usage-type ] [-U UUID] [-jnqvDFKSV] device [blocks-count]
for optimal performance, *should* the new LV fs be created as
mkfs.ext4 -T largefile ...
?
Might as well get it right before locking it in. So you are right, "-T largefile" may be OK for you. But seeing that your bytes-per-inode isn't *that* much over 1 MB, I'd be somewhat reluctant to do that. Number of inodes in the filesystem cannot be changed. So it is good idea to overprovision it just in case usage pattern of the filesystem changes somewhat. So in your case I'd go with inode ratio something like 131072 or 262144. Sure you'll have plenty of inodes free but it's better
On Sun 29-03-15 22:22:24, lyndat3@your-mail.com wrote: than having to recreate filesystem later when you find out you're running out of inodes. Honza
LT -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
-- Jan Kara <jack@suse.cz> SUSE Labs, CR -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
So you are right, "-T largefile" may be OK for you. But seeing that your bytes-per-inode isn't *that* much over 1 MB, I'd be somewhat reluctant to do that. Number of inodes in the filesystem cannot be changed. So it is good idea to overprovision it just in case usage pattern of the filesystem changes somewhat. So in your case I'd go with inode ratio something like 131072 or 262144. Sure you'll have plenty of inodes free but it's better than having to recreate filesystem later when you find out you're running out of inodes.
With some more thought about the facts that (1) the current content DOES contain a lot of large-files, and (2) I DO plan to add network backup stores on that drive -- including, no doubt, a lot of small-files, your 'better safe than sorry' advice makes good sense. It's ratio == 262144 for me. At least now it's a considered choice. Thanks LT -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
participants (2)
-
Jan Kara
-
lyndat3@your-mail.com