From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Lucas Carey Newsgroups: gmane.os.tru64.managers Subject: SUMMARY Fragmenting AdvFS and sync IO Date: Fri, 26 Jul 2002 12:26:28 -0400 Sender: tru64-unix-managers-owner@ornl.gov Message-ID: <3D417834.2090400@odd.bio.sunysb.edu> References: <0207251613.AA11328@nabeth.cxo.cpqcorp.net> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1027700790 23957 127.0.0.1 (26 Jul 2002 16:26:30 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 26 Jul 2002 16:26:30 +0000 (UTC) Return-path: Original-Received: from sws1.ctd.ornl.gov ([160.91.20.101]) by main.gmane.org with smtp (Exim 3.33 #1 (Debian)) id 17Y7vA-0006E9-00 for ; Fri, 26 Jul 2002 18:26:28 +0200 Original-Received: (qmail 25132 invoked by uid 5); 26 Jul 2002 16:26:46 -0000 Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 25124 invoked from network); 26 Jul 2002 16:26:46 -0000 Original-Received: from unknown (HELO emroute2.cind.ornl.gov) (128.219.159.41) by 0 with SMTP; 26 Jul 2002 16:26:46 -0000 Original-Received: from emroute2.cind.ornl.gov (LOCALHOST [127.0.0.1]) by emroute2.cind.ornl.gov (PMDF V6.1-1 #39060) with ESMTP id <0GZV00EYY70LRB@emroute2.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Fri, 26 Jul 2002 12:26:46 -0400 (EDT) Original-Received: from odd.bio.sunysb.edu (odd.bio.sunysb.edu [129.49.104.25]) by emroute2.cind.ornl.gov (PMDF V6.1-1 #39060) with ESMTP id <0GZV00DG970C72@emroute2.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Fri, 26 Jul 2002 12:26:37 -0400 (EDT) Original-Received: from odd.bio.sunysb.edu (sloppy.ams.sunysb.edu [129.49.108.174]) by odd.bio.sunysb.edu (8.12.5/8.12.5) with ESMTP id g6QGQTmw171623 for ; Fri, 26 Jul 2002 12:26:29 -0400 (EDT) Original-To: tru64-unix-managers X-Accept-Language: en-us, en User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0rc2) Gecko/20020513 Netscape/7.0b1 Xref: main.gmane.org gmane.os.tru64.managers:1117 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:1117 Thanks to Bob Harris and Alan, Frag File: Anyway, a file 'frag' is the last part of a file that does not use up the entire 8K if the amount of wasted space in the last 8K of the file is more than 5% of the file's total storage. If a file wastes less than 5% of the total space allocated, it does _NOT_ get a frag. Generally this means that any file greater than 163K will never get a frag, but again depending on the percentage of waste, smaller sized files may not have frags either. Frag sizes range from 1K to 7K and are stored together in the AdvFS "frag file". Disabling frags means that AdvFS will not apply the 5% rule when closing a file and will leave the tail end of the file where it is. So yes, more space will be used for small files. AdvFS also keeps track of whether a file has a frag and where that frag is located in the "frag file". In the presense of a frag file, defragment may try to put all the small files into the frag file, but normal file system operation would do the same. Defragmenting Filesystems: A fragmented file is one where all of the storage for the file is _NOT_ contiguous on disk. A fragmented file system is one where the free space on the disk is _NOT_ contiguous. The defragment utility tries to rearrange files on the disk to get contiguous files and as much contiguous free space as it can. Getting everything perfectly defragmented is never possible because there are a few file system metadata files that can not be moved so these may break up free space or a file may need to be located before and after a system metadata file (or some part of a metadata file). However, that is the exception case. AdvFS always keeps track of a file's data, whether it is contiguous or fragmented on the disk. The information is kept in an extent map as metadata for each file. AdvFS never actually kept any "separate" information about what files were fragmented and what files were contiguous. Since there is no special information kept about fragmented or defragmented files, the defragment utility finds out the state of domain fragmentation by scanning _ALL_ the extent maps for all the files on the disk and figures out how it wants to move things around to defragment the domain. And on synchronous writes for /var/spool/mail/ It depends on why the system crashes. There are lots of crash causes that are also the cause of corruption. A power failure may cause the disks to stop writing in the middle of I/O. Memory or data path problems can cause data corruption directly. One hopes that ECC and parity protection notice it, but there is small chance it won't. Still, if you have the I/O overhead to afford the potential loss of performance by going to synchronous writes, it may improve data reliability in some cases. --Original Question-- How are the frag file and defragmenting the filesystem related? On a system with lots of spare space, will there be a performance gain from disabling the frag file? Are there any thoughts on forcing ail spool files to do synchronous I/O for a mail server that does very little disk I/O?