List Info

Thread: Inode density for database machines - newfs -i




Inode density for database machines - newfs -i
country flaguser name
2007-06-10 22:11:21
For my mailstore machines I usually do "newfs -i
32768" to decrease fsck 
time in case of problems.

For database machines, postgresql in particular, would it
help to have a 
number larger than 65536?

I am aware that ZFS and gjournal are in the horizon, but I
am looking at the 
next 3 months and neither of those two may be mature enough
to even get 
approval to install them.

Looking at one of my existing database machines, I have a
filesystem using 
1.2TB and only 2053 inodes. There are 3,539,385 free inodes.
If I recall 
correctly I used "newfs -i 65536" for that
filesystem.

Will fsck be significantly faster in case of crash if I used
say 
131072(128K)  or even 256K?

What is the best list to find the current status of
gjournal?
This list of geom? Looking at archives most of the gjournal
posts seem to be 
in current. 

_______________________________________________
freebsd-fsfreebsd.org mailing list

http://lists.freebsd.org/mailman/listinfo/freebsd-fs
To unsubscribe, send any mail to
"freebsd-fs-unsubscribefreebsd.org"

Re: Inode density for database machines - newfs -i
user name
2007-06-11 11:11:48
On Sun, Jun 10, 2007 at 11:11:21PM -0400, Francisco Reyes
wrote:
> For my mailstore machines I usually do "newfs -i
32768" to decrease fsck 
> time in case of problems.
> 
> For database machines, postgresql in particular, would
it help to have a 
> number larger than 65536?

It depends on the average size of the files, which is what
the inode
density refers to (actually it means "create an inode
for every N bytes of
filesystem" which amounts to the same thing).  Look at
the average file
size of those machines.  An easy computation can be
performed by using a
combination of "df" and "find | wc".

> Looking at one of my existing database machines, I have
a filesystem using 
> 1.2TB and only 2053 inodes. There are 3,539,385 free
inodes. If I recall 
> correctly I used "newfs -i 65536" for that
filesystem.

Then you guessed incorrectly.  Try a much larger number.. 
in your case you
want: "-i 20132659".  Note that specifying an
inode density means newfs
will minimize the number of inodes in each cylinder group. 
It tries to
create precisely the inode density you give it, but the
density is adjusted
as the number of cylinder groups increases.  Basically
there's a loop in
newfs which increases the number of cylinder groups until
the free bitmap
for each CG can fit into a single filesystem block.  Because
of that loop,
you won't always get the inode density you specify, but you
will minimize
the number of inodes created.

> Will fsck be significantly faster in case of crash if I
used say 
> 131072(128K)  or even 256K?

Of course, but it also depends on the number of cylinder
groups.
Specifying any number for the inode density will minimize
the number of
cylinder groups and also minimize the number of inodes per
CG.  Both of
these will reduce fsck time.  Using a higher inode density
means fewer
inodes will likely be created, meaning faster fsck time. 
However, make
sure you have enough inodes for your filesystem...  running
out is no fun
either.  "newfs" tells you how many inodes it
creates per cylinder group
and how many CGs it creates.  Multiply the two together, and
make sure that
number is larger than the number of inodes you need. 
Remember:  every
directory entry and almost every file entry uses 1 inode. 
Hard links don't
use an inode but each symbolic link does.

> What is the best list to find the current status of
gjournal?

freebsd-geom.

> This list of geom? Looking at archives most of the
gjournal posts seem to 
> be in current. 

Then that is a mistake, or it's cross-posted.

-- Rick C. Petty
_______________________________________________
freebsd-fsfreebsd.org mailing list

http://lists.freebsd.org/mailman/listinfo/freebsd-fs
To unsubscribe, send any mail to
"freebsd-fs-unsubscribefreebsd.org"

Re: Inode density for database machines - newfs -i
country flaguser name
2007-06-11 13:11:32
Rick C. Petty writes:

> It depends on the average size of the files, which is
what the inode
> density refers to (actually it means "create an
inode for every N bytes of

Given that I have a machine very simmilar to the next DB
machine I have a 
good idea of how many inodes I need.

> sure you have enough inodes for your filesystem... 
running out is no fun
> either.  "newfs" tells you how many inodes it
creates per cylinder group

Will do.

The current machine is using 2056 inodes for 1.2TB.. with
3,539,382 inodes 
free. For the next machine I will use a higher number in
newfs until I get 
the number of free Inodes close to 100K. That will give the
machine plenty of free inodes. 


Thanks for your feedback.
_______________________________________________
freebsd-fsfreebsd.org mailing list

http://lists.freebsd.org/mailman/listinfo/freebsd-fs
To unsubscribe, send any mail to
"freebsd-fs-unsubscribefreebsd.org"

Re: Inode density for database machines - newfs -i
user name
2007-06-11 15:44:13
On Mon, Jun 11, 2007 at 10:13:27PM +0200, Ivan Voras wrote:
> Francisco Reyes wrote:
> 
> > The current machine is using 2056 inodes for
1.2TB.. with 3,539,382
> > inodes free. For the next machine I will use a
higher number in newfs
> > until I get the number of free Inodes close to
100K. That will give the
> > machine plenty of free inodes.
> 
> How long fsck takes depends on the number of used
inodes, not the total
> number.

That's only true if using UFS2, softupdates, and if the
cylinder groups
were properly sync'd before shutdown.  Otherwise fsck will
scan all inodes.

> Barring a bug in UFS, you should be able to have as
little
> inodes as you want, especially if you know for sure
what number to expect.
> 
> The only thing that might bite you is if the machine is
(sometime in the
> future) reassigned to some other duty that suddely
requires a lot of inodes.

In which case, use growfs to reallocate the default number
of inodes.

-- 


-- Rick C. Petty
_______________________________________________
freebsd-fsfreebsd.org mailing list

http://lists.freebsd.org/mailman/listinfo/freebsd-fs
To unsubscribe, send any mail to
"freebsd-fs-unsubscribefreebsd.org"

Re: Inode density for database machines - newfs -i
country flaguser name
2007-06-11 15:51:26
Ivan Voras writes:

> How long fsck takes depends on the number of used
inodes, not the total
> number. Barring a bug in UFS, you should be able to
have as little
> inodes as you want, especially if you know for sure
what number to expect.

"man tuning" says otherwise.

>Decreasing the number of i-nodes in a file system can
greatly reduce 
>fsck(8) recovery times after a crash.

That man page was one of the reasons I was trying to get my
inodes as little 
as possible. It is the same area where they mention to use
"newfs -i" to 
reduce the number of inodes.

The second reason I am doing it, is to get some space back
since I will not 
be needing so many inodes anyway.

_______________________________________________
freebsd-fsfreebsd.org mailing list

http://lists.freebsd.org/mailman/listinfo/freebsd-fs
To unsubscribe, send any mail to
"freebsd-fs-unsubscribefreebsd.org"

[1-5]

about | contact  Other archives ( Real Estate discussion Medical topics )