SUMMARY : bytes/inode

From: Swee-Chuan Khoo (sckhoo@emtds1.nsc.com)
Date: Mon Oct 03 1994 - 09:09:21 CDT


   Thanx for all the advice. I received lots of them and convinced that I
doing the right thing.
   Most of the mail mentioned that I can go higher on the bytes/inode value
to 1MB, but keep the free-space% to about 5%. Another suggestion is to change
the size of cylinder group. I've yet to find out.
   Following is the original mail with the summary of reply attached after.

   Once again, Thank you very much.

rgds,
khoo

This is the best mail I receive, from Eckhard R|ggeberg, can't say better
than his( or hers ).

>You've done the Right Thing. The defaults are fine for a 100 MB disk holding
>/, /var and /tmp. But not for a 2 GB data disk.
>AFAIK, there is no limit to the -i parameter, if you already know the average
>file size, the you can use it. But values above 8K don't save much more. You
>can change the -c parameter, too, for disks with more than 500 cylinders it
>is ridiculous to use 16 cylinders per group.
>there will be no lifespan penalties, and performance will better if it changes.

----- Begin Included Message -----
>
>hi guys,
> Good morning.
>
> Need some advice from you. I have a 2GB harddisk which is in one partition
>(sd9g), and I know the average file size will be store in this harddisk will
>be 40MB.
> So, I newfs the harddisk with the option '-i 8192' ( 4x the default ),
>and also '-m 2' ( 10 is the default ). 10% of 2GB = 200MB!!!
>
>(using default setting)
>/dev/sd9g 1952573 9 1757307 0% /home/archive2
>
>(using newfs -i 8192 -m 2 )
>/dev/sd9g 2042861 9 2001995 0% /home/archive2
>
> Now you can see I claim back lots of harddisk space ( about 250MB ).
>The question is, is there a limit on how many bytes/inode on SUN. ANd how
>far can I go before I hit anything. Any advice from you experts?
> Is there any performance/lifespan affected by changing the default value?
>
>rgds,
>khoo
----- End Included Message -----

1) Gregory Bond <gnb@melba.bby.com.au>

We run some of our filesystems with -i 262144 (i.e. 256k) with no problems.
Like you, this is a filesystem with files ave size = 10M. You can afford to
go quoite a bit higher.....

2) Ruud van Poelgeest - Thijssen Veenendaal - NL

read the maual pages from newfs and limit.

( ????!?!!!!!???????!?!?!????????!!!!!??? ) :-)

3) casper <casper@fwi.uva.nl>

10% of 2GB is still only 10%. However, a minfree of 5 on large disk
is probably acceptable.

You can also safe space by increasing teh size of the cylinnder groups:

        -c 32

If the average filesize is 40MB, you can increase the number of bpi
to an even larger value. Try to experiment.

I don't think that decreasing the inodes and cylinder groups will
aversely affect performance: there will be only a few inodes, and they
will be cached.

4) Phil Blanchfield <phil@m31.dgbt.doc.ca>

-m free-space = 2% will start to kill performance once the disk starts
to fill up. The 4.2 FS tries to keep the inodes "close" to the corresponding
data and runs into trouble after the 90% full mark. I would bump this back up
to 5% at least.

The inode density (-i) increases in powers of 2, so for each incremental
increase you get half the space that the inodes used the last time. After
-i = 32k this doesn't amount to much (1 inode = 128 bytes) and running out
of inodes is a drag (to correct you have to dump, newfs, restore) so it's
better to have too many than too few. The -m can be adjusted with "tunefs"
so you can play with it after. What I usually do is take the default -m and
then wind it down to 5% with tunefs when things get tight.

Since you have 40MB files you can only get 51 of them on a 2GB partition.
I would set -m at 5 and -i at 32768. You could try higher (64k, 128k) but
this won't give you enough data space for even one more 40MB file since
1 inode = 128 bytes. With a 2GB drive going from -i = 32k to -i = 64k
will give you 4.1MB (0.2%).

You can use "df -i" and "df" to get a "feel" for a good inode density setting
for a particular file system. If you are using the same % for both this is
ideal. If "df -i" reports more than 50% you can't increase it.

For example here is a root partition that I have on a 4.1.3 system. I used
-i 4096 with newfs. Note that the %iused and the capacity are close to
the same percentage. There is no point in increasing this to 8192 because
that would bump up the iused to 80% which is to close to 100% for me.
Besides a disk inode

# df -i /
Filesystem iused ifree %iused Mounted on
/dev/sd0a 926 1378 40% /

# df /
Filesystem kbytes used avail capacity Mounted on
/dev/sd0a 12420 5451 5727 49% /

Hope this helps.

-- 
Phil Blanchfield
The Communications Research Centre 3701 Carling Avenue, Ottawa Ontario CANADA
Internet: Phil.Blanchfield@CRC.DOC.CA Tel: (613) 998-2761 Fax: (613) 998-9648

5) rad@getech.leeds.ac.uk

Dear Khoo, I have take bytes per inode up to 128k on some file systems- only danger that I have come across so far is using up all the (reduced number of) inodes when assumptions about the number of files breaks down.

Richard davis

6) charest@canr.hydro.qc.ca Claude Charest

Here we use also the "-i 8192" on all user filesystems because they have normally large files (around 10 Mb by file). I do not know where is the limits. Please tell me what you will get, or send a summary...

7) reynolds@camg2.icgmfg.mke.ab.com (Michael D. Reynolds)

I've change bytes/inode up to 1MB with no problems. I does give alot of space back. It also newfs's and fsck's alot faster. In your case I would make the bytes/inode 1MB or 10MB depending on what saftey factor you need.

8) dhb@ssd.ray.com (David H. Brierley)

When I create a large partition that I know will hold very large files, I do two things. I specify a large value for "-i" and I specify a large value for "-c". For example: newfs -c 96 -i 32768 sd9g

The -c option reduces the number of cylinder groups and thus reduces the file system overhead and the -i option of course reduces the number of inodes. You can also specify the -m option if you want but I would not recommend going below a value of 4 unless the file system is extremely stable.

9) z056716@uprc.com (LaCoursiere J. D. (Jeff))

it is suggested not to go under 5% for minfree, as you may experience some thrashing when the disk attempts defragmentation.

Of course, if speed is not an issue the extra space is certainly useful.

10) Daniel Edward Lovinger <del+@CMU.EDU>

You do not need to increase the number of inodes - inodes are index blocks which point to allocated file data blocks. I think you are confusing inodes for blocks which contain actual file data - this is not the case. You would potentially want extra inodes if you planned on having a very very large number files on this disk, but with a planned average filesize of 40mb I do not think this will occur.

I point you toward any good UNIX OS book, which would describe the basics of a UNIX filesystem.

I'd be leary of setting minfree down to 2%. The 10% "overhead" is used by the OS to perform access-time optimized data block allocation. If you set minfree too low and proceed to use the space, access time will suffer in comparison to a normal disk with the full 10%. This is the tradeoff.

11) Russ Poffenberger poffen@San-Jose.ate.slb.com

I always create my filesystems with -i 8192 or 16384. The default is way too generous for most uses. I don't know if there is a real limit or not.

12) Peter Samuel peter@uniq.com.au

I once created a database partion with "-i 655360". That's 640k bytes per inode. There were no problems with that. I do remember that newfs fell over with ratios that were higher but I can't remember how high.

PS I was creating a large dtabase filesystem - several gigabytes - which would only have 4 database files in it.

13) Birger.Wathne@vest.sdata.no (Birger A. Wathne)

When you do a newfs, you get some info like

# newfs -N /dev/rdsk/c0t3d0s2 /dev/rdsk/c0t3d0s2: 1044960 sectors in 1866 cylinders of 7 tracks, 80 sectors 510,2MB in 117 cyl groups (16 c/g, 4,38MB/g, 2112 i/g) super-block backups (for fsck -F ufs -o b=#) at: 32, 9072, 18112, 27152, 36192, 45232, 54272, 63312, 71712, 80752, 89792, 98832, 107872, 116912, 125952, 134992, 143392, 152432, 161472, 170512, 179552, 188592, 197632, 206672, 215072, 224112, 233152, . . .

As you increase the -i value, the i/g in the above output will decrease. If you get down to 0 i/g, newfs will fail.

Try newfs -N -i <40Mb in bytes> /dev/rdsk/whatever.

14) tap116@nocc.minsy.navy.mil (Tom Plesha)

I run my 2Gb drive with newfs -m 1 (1%) and it runs just fine.

( Thanks Tom, I feel much better after reading your mail ).

15) Eckhard R|ggeberg eckhard@ts.go.dlr.de

You've done the Right Thing. The defaults are fine for a 100 MB disk holding /, /var and /tmp. But not for a 2 GB data disk. AFAIK, there is no limit to the -i parameter, if you already know the average file size, the you can use it. But values above 8K don't save much more. You can change the -c parameter, too, for disks with more than 500 cylinders it is ridiculous to use 16 cylinders per group. There will be no lifespan penalties, and performance will better if it changes.



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:09:11 CDT