linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* mkfs.ext4: high default -i value undocumented
@ 2009-03-03 23:12 Jan Engelhardt
  2009-03-03 23:19 ` Eric Sandeen
  0 siblings, 1 reply; 9+ messages in thread
From: Jan Engelhardt @ 2009-03-03 23:12 UTC (permalink / raw)
  To: linux-ext4; +Cc: kzak

Hi,


Creating an ext4 filesystem on a 4 GB image file (to be loop-mounted 
later) gives me 256K inodes. Choosing -i 4096 instead gives 1M, which 
would mean the default for -i is 16384. Besides me finding 16384 a 
little unreasonable (XFS offers 2M inodes by default), the big 
point is that the mke2fs manpage (belonging to util-linux, hence Cc) 
does not mention this 16384 default.
Hope this can be addressed.

# rpm -q e2fsprogs util-linux
e2fsprogs-1.41.4-2.2
util-linux-2.14.2-2.2

Jan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: mkfs.ext4: high default -i value undocumented
  2009-03-03 23:12 mkfs.ext4: high default -i value undocumented Jan Engelhardt
@ 2009-03-03 23:19 ` Eric Sandeen
  2009-03-04  0:36   ` Jan Engelhardt
  2009-03-09 14:17   ` Goswin von Brederlow
  0 siblings, 2 replies; 9+ messages in thread
From: Eric Sandeen @ 2009-03-03 23:19 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: linux-ext4, kzak

Jan Engelhardt wrote:
> Hi,
> 
> 
> Creating an ext4 filesystem on a 4 GB image file (to be loop-mounted 
> later) gives me 256K inodes. Choosing -i 4096 instead gives 1M, which 
> would mean the default for -i is 16384. 

That's right, look in /etc/mke2fs.conf:

[defaults]
        base_features =
sparse_super,filetype,resize_inode,dir_index,ext_attr
        blocksize = 4096
        inode_size = 256
        inode_ratio = 16384

> Besides me finding 16384 a 
> little unreasonable (XFS offers 2M inodes by default), 

XFS is a totally different beast, because it dynamically allocates
inodes.  It doesn't really offer *anything* by default.

Which part of a 16384-data-bytes-to-inode-count ratio do you find
unreasonable?  Do you find it unreasonably high, or unreasonably low?

> the big 
> point is that the mke2fs manpage (belonging to util-linux, hence Cc) 

not so much:
$ rpm -qf /usr/share/man/man8/mke2fs.8.gz
e2fsprogs-1.41.3-2.fc10.x86_64

> does not mention this 16384 default.
> Hope this can be addressed.

You could send a patch :)

-Eric

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: mkfs.ext4: high default -i value undocumented
  2009-03-03 23:19 ` Eric Sandeen
@ 2009-03-04  0:36   ` Jan Engelhardt
  2009-03-04  0:43     ` Eric Sandeen
  2009-03-04  2:49     ` Theodore Tso
  2009-03-09 14:17   ` Goswin von Brederlow
  1 sibling, 2 replies; 9+ messages in thread
From: Jan Engelhardt @ 2009-03-04  0:36 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-ext4, kzak


On Wednesday 2009-03-04 00:19, Eric Sandeen wrote:
>> 
>> Creating an ext4 filesystem on a 4 GB image file (to be loop-mounted 
>> later) gives me 256K inodes. Choosing -i 4096 instead gives 1M, which 
>> would mean the default for -i is 16384. 
>
>That's right, look in /etc/mke2fs.conf:
>
>[defaults]
>        base_features =
>sparse_super,filetype,resize_inode,dir_index,ext_attr
>        blocksize = 4096
>        inode_size = 256
>        inode_ratio = 16384

Interesting - thanks for the hint.

>> Besides me finding 16384 a 
>> little unreasonable (XFS offers 2M inodes by default), 
>
>XFS is a totally different beast, because it dynamically allocates
>inodes.  It doesn't really offer *anything* by default.
>
>Which part of a 16384-data-bytes-to-inode-count ratio do you find
>unreasonable?  Do you find it unreasonably high, or unreasonably low?

I think it's a bit too high, causing the amount of usable inodes
to be a bit too low. 

>> the big 
>> point is that the mke2fs manpage (belonging to util-linux, hence Cc) 
>
>not so much:
>$ rpm -qf /usr/share/man/man8/mke2fs.8.gz
>e2fsprogs-1.41.3-2.fc10.x86_64

Sorry, I had looked for man8/mkfs.ext2.8.gz. I am not quite sure
what makes some developers deviate(*) from the mkfs.$name/fsck.$name
scheme ;-)

(*) e2, reiser(3), dosfs

>> does not mention this 16384 default.
>> Hope this can be addressed.
>
>You could send a patch :)

parent b2ca48f40eb33bd86b8d53d4373e7fce96bced4a (v1.41.4)
commit ca28058c4004ceaa42edeb6ba61bc2aa53d7c03d
Author: Jan Engelhardt <jengelh@medozas.de>
Date:   Wed Mar 4 01:36:09 2009 +0100

doc: mention default for mke2fs -i

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
---
 misc/mke2fs.8.in |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/misc/mke2fs.8.in b/misc/mke2fs.8.in
index 1605895..38ddf6d 100644
--- a/misc/mke2fs.8.in
+++ b/misc/mke2fs.8.in
@@ -276,7 +276,7 @@ be smaller than the blocksize of the filesystem, since in that case more
 inodes would be made than can ever be used.  Be warned that it is not
 possible to expand the number
 of inodes on a filesystem after it is created, so be careful deciding the
-correct value for this parameter.
+correct value for this parameter. The default value is 16384.
 .TP
 .BI \-I " inode-size"
 Specify the size of each inode in bytes.
-- 
# Created with git-export-patch

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: mkfs.ext4: high default -i value undocumented
  2009-03-04  0:36   ` Jan Engelhardt
@ 2009-03-04  0:43     ` Eric Sandeen
  2009-03-04  0:57       ` Jan Engelhardt
  2009-03-04  2:49     ` Theodore Tso
  1 sibling, 1 reply; 9+ messages in thread
From: Eric Sandeen @ 2009-03-04  0:43 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: linux-ext4, kzak

Jan Engelhardt wrote:
> On Wednesday 2009-03-04 00:19, Eric Sandeen wrote:
>>> Creating an ext4 filesystem on a 4 GB image file (to be loop-mounted 
>>> later) gives me 256K inodes. Choosing -i 4096 instead gives 1M, which 
>>> would mean the default for -i is 16384. 
>> That's right, look in /etc/mke2fs.conf:
>>
>> [defaults]
>>        base_features =
>> sparse_super,filetype,resize_inode,dir_index,ext_attr
>>        blocksize = 4096
>>        inode_size = 256
>>        inode_ratio = 16384
> 
> Interesting - thanks for the hint.
> 
>>> Besides me finding 16384 a 
>>> little unreasonable (XFS offers 2M inodes by default), 
>> XFS is a totally different beast, because it dynamically allocates
>> inodes.  It doesn't really offer *anything* by default.
>>
>> Which part of a 16384-data-bytes-to-inode-count ratio do you find
>> unreasonable?  Do you find it unreasonably high, or unreasonably low?
> 
> I think it's a bit too high, causing the amount of usable inodes
> to be a bit too low. 

When we doubled the size of inodes by default, we halved the count.  I
also have a sneaking suspicion that it may be too low for some
scenarios, but probably ok for most.

>>> the big 
>>> point is that the mke2fs manpage (belonging to util-linux, hence Cc) 
>> not so much:
>> $ rpm -qf /usr/share/man/man8/mke2fs.8.gz
>> e2fsprogs-1.41.3-2.fc10.x86_64
> 
> Sorry, I had looked for man8/mkfs.ext2.8.gz. I am not quite sure
> what makes some developers deviate(*) from the mkfs.$name/fsck.$name
> scheme ;-)

$ rpm -qf /usr/share/man/man8/mkfs.ext2.8.gz
e2fsprogs-1.41.3-2.fc10.x86_64

:)

> (*) e2, reiser(3), dosfs
> 
>>> does not mention this 16384 default.
>>> Hope this can be addressed.
>> You could send a patch :)
> 
> parent b2ca48f40eb33bd86b8d53d4373e7fce96bced4a (v1.41.4)
> commit ca28058c4004ceaa42edeb6ba61bc2aa53d7c03d
> Author: Jan Engelhardt <jengelh@medozas.de>
> Date:   Wed Mar 4 01:36:09 2009 +0100
> 
> doc: mention default for mke2fs -i

thanks :)  (up to Ted now)

-Eric

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: mkfs.ext4: high default -i value undocumented
  2009-03-04  0:43     ` Eric Sandeen
@ 2009-03-04  0:57       ` Jan Engelhardt
  0 siblings, 0 replies; 9+ messages in thread
From: Jan Engelhardt @ 2009-03-04  0:57 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-ext4, kzak


On Wednesday 2009-03-04 01:43, Eric Sandeen wrote:
>>>> the big 
>>>> point is that the mke2fs manpage (belonging to util-linux, hence Cc) 
>>> not so much:
>>> $ rpm -qf /usr/share/man/man8/mke2fs.8.gz
>>> e2fsprogs-1.41.3-2.fc10.x86_64
>> 
>> Sorry, I had looked for man8/mkfs.ext2.8.gz. I am not quite sure
>> what makes some developers deviate(*) from the mkfs.$name/fsck.$name
>> scheme ;-)
>
>$ rpm -qf /usr/share/man/man8/mkfs.ext2.8.gz
>e2fsprogs-1.41.3-2.fc10.x86_64
>:)

/me silently scrubs the cosmic particles from his room.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: mkfs.ext4: high default -i value undocumented
  2009-03-04  0:36   ` Jan Engelhardt
  2009-03-04  0:43     ` Eric Sandeen
@ 2009-03-04  2:49     ` Theodore Tso
  2009-03-04  3:11       ` Jan Engelhardt
  1 sibling, 1 reply; 9+ messages in thread
From: Theodore Tso @ 2009-03-04  2:49 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: Eric Sandeen, linux-ext4, kzak

On Wed, Mar 04, 2009 at 01:36:44AM +0100, Jan Engelhardt wrote:
> >> 
> >> Creating an ext4 filesystem on a 4 GB image file (to be loop-mounted 
> >> later) gives me 256K inodes. Choosing -i 4096 instead gives 1M, which 
> >> would mean the default for -i is 16384. 
> >
> >Which part of a 16384-data-bytes-to-inode-count ratio do you find
> >unreasonable?  Do you find it unreasonably high, or unreasonably low?
> 
> I think it's a bit too high, causing the amount of usable inodes
> to be a bit too low.

So out of curiosity, what are you storing on the filesystem such that
you're worried about running out of inodes?  The assumption was that
on most filesystems the average file size would indeed be bigger than
4k these days, although obviously things will vary depending on what
you plan to store.  Even if you're using maildir stores, or squid
caches, it seemed like 16k was a good default.

> >> does not mention this 16384 default.
> >> Hope this can be addressed.
> >
> >You could send a patch :)

The problem is the default isn't as simple as 16384.  See the
description under the -T option:

      -T usage-type[,...]
              Specify how the filesystem is going to be used, so  that  mke2fs
              can  choose  optimal  filesystem  parameters  for that use.  The
              usage types that are supported are defined in the  configuration
              file  /etc/mke2fs.conf(5).   The  user  may  specify one or more
              usage types using a comma separated list.

              If this option is is not specified, mke2fs will  pick  a  single
              default  usage  type  based  on the size of the filesystem to be
              created.  If the filesystem size is less  than  or  equal  to  3
              megabytes,  mke2fs  will use the filesystem type floppy.  If the
              filesystem size is greater than 3 but less than or equal to  512
              megabytes,  mke2fs(8) will use the filesystem small.  Otherwise,
              mke2fs(8) will use the default filesystem type default.


So for example, if you say "-T news" the default mke2fs.conf file will
cause the default inode ratio to be 4096.  (As I said, that's probably
not right, since the average size for Usenet spools is probably way
over 8k these days; the fact that -T news uses a default inode ratio
of 4096 is historic, and dates back to before p0rn sites dropped huge
numbers of uuencoded image files in the alt.* hierarchy.  :-)

As another example, if the file is smaller that 512 megabytes, the
"small" type will be used, and that causes the default inode ratio to
be 4096, the inode size to be 128, and the block size to be 1024.

   	     	   	      	   - Ted

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: mkfs.ext4: high default -i value undocumented
  2009-03-04  2:49     ` Theodore Tso
@ 2009-03-04  3:11       ` Jan Engelhardt
  0 siblings, 0 replies; 9+ messages in thread
From: Jan Engelhardt @ 2009-03-04  3:11 UTC (permalink / raw)
  To: Theodore Tso; +Cc: Eric Sandeen, linux-ext4, kzak


On Wednesday 2009-03-04 03:49, Theodore Tso wrote:
>On Wed, Mar 04, 2009 at 01:36:44AM +0100, Jan Engelhardt wrote:
>> >> 
>> >> Creating an ext4 filesystem on a 4 GB image file (to be loop-mounted 
>> >> later) gives me 256K inodes. Choosing -i 4096 instead gives 1M, which 
>> >> would mean the default for -i is 16384. 
>> >
>> >Which part of a 16384-data-bytes-to-inode-count ratio do you find
>> >unreasonable?  Do you find it unreasonably high, or unreasonably low?
>> 
>> I think it's a bit too high, causing the amount of usable inodes
>> to be a bit too low.
>
>So out of curiosity, what are you storing on the filesystem such that
>you're worried about running out of inodes?  The assumption was that
>on most filesystems the average file size would indeed be bigger than
>4k these days, although obviously things will vary depending on what
>you plan to store.  Even if you're using maildir stores, or squid
>caches, it seemed like 16k was a good default.

The source and module_prepare'd obj dirs for the trees
2.6.{17.14,18.8,19.7,20.21,21.7,22.19,23.17,24.7,25.20,26.8,27.8,28}.

Filesystem    Type    1K-blocks      Used Available Use% Mounted on
/dev/loop0     xfs      4184064   3676644    507420  88% /lo/kernel

Filesystem    Type    Inodes   IUsed   IFree IUse% Mounted on
/dev/loop0     xfs   2343280  313466 2029814   14% /lo/kernel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: mkfs.ext4: high default -i value undocumented
  2009-03-03 23:19 ` Eric Sandeen
  2009-03-04  0:36   ` Jan Engelhardt
@ 2009-03-09 14:17   ` Goswin von Brederlow
  2009-03-09 15:56     ` Eric Sandeen
  1 sibling, 1 reply; 9+ messages in thread
From: Goswin von Brederlow @ 2009-03-09 14:17 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Jan Engelhardt, linux-ext4, kzak

Eric Sandeen <sandeen@redhat.com> writes:

> Jan Engelhardt wrote:
>> Hi,
>> 
>> 
>> Creating an ext4 filesystem on a 4 GB image file (to be loop-mounted 
>> later) gives me 256K inodes. Choosing -i 4096 instead gives 1M, which 
>> would mean the default for -i is 16384. 
>
> That's right, look in /etc/mke2fs.conf:
>
> [defaults]
>         base_features =
> sparse_super,filetype,resize_inode,dir_index,ext_attr
>         blocksize = 4096
>         inode_size = 256
>         inode_ratio = 16384
>
>> Besides me finding 16384 a 
>> little unreasonable (XFS offers 2M inodes by default), 
>
> XFS is a totally different beast, because it dynamically allocates
> inodes.  It doesn't really offer *anything* by default.
>
> Which part of a 16384-data-bytes-to-inode-count ratio do you find
> unreasonable?  Do you find it unreasonably high, or unreasonably low?

Too high for 4G, to low for 6 TiB.

MfG
        Goswin

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: mkfs.ext4: high default -i value undocumented
  2009-03-09 14:17   ` Goswin von Brederlow
@ 2009-03-09 15:56     ` Eric Sandeen
  0 siblings, 0 replies; 9+ messages in thread
From: Eric Sandeen @ 2009-03-09 15:56 UTC (permalink / raw)
  To: Goswin von Brederlow; +Cc: Jan Engelhardt, linux-ext4, kzak

Goswin von Brederlow wrote:
> Eric Sandeen <sandeen@redhat.com> writes:
> 
>> Jan Engelhardt wrote:
>>> Hi,
>>>
>>>
>>> Creating an ext4 filesystem on a 4 GB image file (to be loop-mounted 
>>> later) gives me 256K inodes. Choosing -i 4096 instead gives 1M, which 
>>> would mean the default for -i is 16384. 
>> That's right, look in /etc/mke2fs.conf:
>>
>> [defaults]
>>         base_features =
>> sparse_super,filetype,resize_inode,dir_index,ext_attr
>>         blocksize = 4096
>>         inode_size = 256
>>         inode_ratio = 16384
>>
>>> Besides me finding 16384 a 
>>> little unreasonable (XFS offers 2M inodes by default), 
>> XFS is a totally different beast, because it dynamically allocates
>> inodes.  It doesn't really offer *anything* by default.
>>
>> Which part of a 16384-data-bytes-to-inode-count ratio do you find
>> unreasonable?  Do you find it unreasonably high, or unreasonably low?
> 
> Too high for 4G, to low for 6 TiB.

I think it's hard to make a blanket statement like that; it depends very
much on the average size of the files on the fs.

The only thing that makes it too high or too low is whether the average
file size is significantly different than 16k, really (with the caveat
that we should bias towards overprovisioning vs. underprovisioning, by
default)

-Eric

> MfG
>         Goswin


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-03-09 15:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-03 23:12 mkfs.ext4: high default -i value undocumented Jan Engelhardt
2009-03-03 23:19 ` Eric Sandeen
2009-03-04  0:36   ` Jan Engelhardt
2009-03-04  0:43     ` Eric Sandeen
2009-03-04  0:57       ` Jan Engelhardt
2009-03-04  2:49     ` Theodore Tso
2009-03-04  3:11       ` Jan Engelhardt
2009-03-09 14:17   ` Goswin von Brederlow
2009-03-09 15:56     ` Eric Sandeen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).