Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Apr 2007 07:42:10 -0500
From:      Eric Anderson <anderson@centtech.com>
To:        Pawel Jakub Dawidek <pjd@FreeBSD.org>
Cc:        "freebsd-fs@freebsd.org" <freebsd-fs@FreeBSD.org>
Subject:   Re: fsck times/memory sizes/etc
Message-ID:  <4624C0A2.5010101@centtech.com>
In-Reply-To: <20070214233848.GA13680@garage.freebsd.pl>
References:  <45D321F8.2000808@centtech.com> <20070214233848.GA13680@garage.freebsd.pl>

next in thread | previous in thread | raw e-mail | index | archive | help
On 02/14/07 17:38, Pawel Jakub Dawidek wrote:
> On Wed, Feb 14, 2007 at 08:51:36AM -0600, Eric Anderson wrote:
>> I just did some quick playing around, doing newfs and fsck's on fresh file systems.  I did one set on a 1Gb malloc'ed md, and another on a 65GB real disk device.  The disk 
>> was only being used for this test, nothing else.
>>
>> I don't claim these numbers are perfect, but I did run each test 3-4 times to make sure they were consistent.
>>
>> I found it interesting that the fsck times didn't reduce once all the files/directories were deleted.
> 
> This may be because of UFS2 has lazy inodes allocator - it doesn't
> initialize all inode blocks at newfs time, so fsck verifies only
> allocated inode blocks, thus runs faster on new file system.
> When you fill your file system, inode blocks are allocated, but are not
> reclaimed when you delete file/directories.
> You may try the same tests with UFS1, which allocates all inode blocks
> at newfs time.
> 


Finally got around to doing this:


##################################################
# newfs -O1 /dev/ad2s2a
/dev/ad2s2a: 65397.4MB (133933888 sectors) block size 16384, fragment 
size 2048
         using 357 cylinder groups of 183.69MB, 11756 blks, 23552 inodes.

# time fsck -f /dev/ad2s2a
** /dev/ad2s2a
** Last Mounted on
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
2 files, 2 used, 32952243 free (19 frags, 4119028 blocks, 0.0% 
fragmentation)

real    0m50.056s
user    0m3.914s
sys     0m0.460s

# memory usage reached max of 7184kb (7MB)

# fill it up

# df -i /mnt
Filesystem  1K-blocks   Used    Avail Capacity iused ifree %iused 
Mounted on
/dev/ad2s2a  65904490 138742 60493390     0% 8408062     0  100%   /mnt

# time fsck -f /dev/ad2s2a
** /dev/ad2s2a
** Last Mounted on /mnt
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
8408062 files, 69371 used, 32882874 free (18 frags, 4110357 blocks, 0.0% 
fragmentation)

real    1m2.790s
user    0m11.167s
sys     0m0.553s

# memory usage reached max of 39952kb (39MB)

# mount, rm -rf all created files/dirs
# df -i /mnt
Filesystem  1K-blocks Used    Avail Capacity iused   ifree %iused 
Mounted on
/dev/ad2s2a  65904490    6 60632126     0%       2 8408060    0%   /mnt

# time fsck -f /dev/ad2s2a
** /dev/ad2s2a
** Last Mounted on /mnt
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
2 files, 3 used, 32952242 free (18 frags, 4119028 blocks, 0.0% 
fragmentation)

real    0m49.576s
user    0m2.281s
sys     0m0.166s

# memory usage reached max of 7184kb (7MB)

##################################################
# newfs -O1 -b 16384 -f 2048 -i 262144 /dev/ad2s2a
/dev/ad2s2a: 65397.4MB (133933888 sectors) block size 16384, fragment 
size 2048
         using 294 cylinder groups of 223.02MB, 14273 blks, 896 inodes.

# time fsck -f /dev/ad2s2a
** /dev/ad2s2a
** Last Mounted on
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
2 files, 2 used, 33462291 free (19 frags, 4182784 blocks, 0.0% 
fragmentation)

real    0m8.147s
user    0m0.496s
sys     0m0.015s

# memory usage reached max of 7184kb (7MB)

# fill it up

# df -i /mnt
Filesystem  1K-blocks Used    Avail Capacity iused ifree %iused  Mounted on
/dev/ad2s2a  66924586 4342 61566278     0%  263422     0  100%   /mnt

# time fsck -f /dev/ad2s2a
** /dev/ad2s2a
** Last Mounted on /mnt
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
263422 files, 2171 used, 33460122 free (26 frags, 4182512 blocks, 0.0% 
fragmentation)

real    0m8.229s
user    0m0.578s
sys     0m0.104s

# memory usage reached max of 8208kb (8MB)

# mount, rm -rf all created files/dirs

# df -i /mnt
Filesystem  1K-blocks Used    Avail Capacity iused  ifree %iused  Mounted on
/dev/ad2s2a  66924586    4 61570616     0%       2 263420    0%   /mnt

# time fsck -f /dev/ad2s2a
** /dev/ad2s2a
** Last Mounted on /mnt
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
2 files, 2 used, 33462291 free (19 frags, 4182784 blocks, 0.0% 
fragmentation)

real    0m7.797s
user    0m0.473s
sys     0m0.035s

# memory usage reached max of 7184kb (7MB)

##################################################


Full report here:
http://www.googlebit.com/doku.php?id=fsck_times_memory_sizes


Eric



-- 
------------------------------------------------------------------------
Eric Anderson        Sr. Systems Administrator        Centaur Technology
An undefined problem has an infinite number of solutions.
------------------------------------------------------------------------



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4624C0A2.5010101>