From owner-freebsd-fs@FreeBSD.ORG Tue Apr 17 13:19:46 2007 Return-Path: X-Original-To: freebsd-fs@FreeBSD.org Delivered-To: freebsd-fs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 314FF16A403 for ; Tue, 17 Apr 2007 13:19:46 +0000 (UTC) (envelope-from anderson@centtech.com) Received: from mh2.centtech.com (moat3.centtech.com [64.129.166.50]) by mx1.freebsd.org (Postfix) with ESMTP id F20A113C45D for ; Tue, 17 Apr 2007 13:19:45 +0000 (UTC) (envelope-from anderson@centtech.com) Received: from [10.177.171.220] (neutrino.centtech.com [10.177.171.220]) by mh2.centtech.com (8.13.8/8.13.8) with ESMTP id l3HCgA7l043614; Tue, 17 Apr 2007 07:42:10 -0500 (CDT) (envelope-from anderson@centtech.com) Message-ID: <4624C0A2.5010101@centtech.com> Date: Tue, 17 Apr 2007 07:42:10 -0500 From: Eric Anderson User-Agent: Thunderbird 1.5.0.10 (X11/20070320) MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <45D321F8.2000808@centtech.com> <20070214233848.GA13680@garage.freebsd.pl> In-Reply-To: <20070214233848.GA13680@garage.freebsd.pl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.88.4/3109/Mon Apr 16 22:59:17 2007 on mh2.centtech.com X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=8.0 tests=BAYES_00 autolearn=ham version=3.1.6 X-Spam-Checker-Version: SpamAssassin 3.1.6 (2006-10-03) on mh2.centtech.com Cc: "freebsd-fs@freebsd.org" Subject: Re: fsck times/memory sizes/etc X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2007 13:19:46 -0000 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. ------------------------------------------------------------------------