<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Transitional//EN">
<HTML>
<HEAD>
  <!--
    *************************************************************************************
    * Copyright (c) 2005 VERITAS Software Corporation. All rights reserved. *

      For third-party license citations, please see the bottom of this file.
    *************************************************************************************
  -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="TEMPLATEBASE" content="vx_vxhelp_2005c">
<meta name="LASTUPDATED" content="06/13/05 10:02:06">
<meta name="PRODUCTNAME" content="VERITAS Software Documentation">
<meta name="FILENAME" content="02.performance.fm">
     
<title>Monitoring Free Space</title>

</HEAD>

<BODY bgcolor="#FFFFFF" link="#000066" vlink="#0000ff" marginheight="0" topmargin="0">
<basefont=1>

<a name="120295"></a>

<div align="left">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
 <tr>
   <td height="2" border="0" cellspacing="0" cellpadding="0" colspan="2" bgcolor="#000000">
   </td>
 </tr>
 <tr>
   <td height="15" width="50%" border="0" cellspacing="0" cellpadding="0" bgcolor="#cccccc">
    <img src="images/vxsymbol.gif" height="20" width="31" border="0" cellspacing="0" cellpadding="0" align="left">
     
     
   </td>
   <td align="right" width="50%" bgcolor="#cccccc">

<!-- Header Breadcrumbs -->
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="-2">&lt;&nbsp;<a href="02_performance_vxfs32_120095.html" title="Previous - Kernel Tunables">Previous</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="02_performance_vxfs34_120371.html" title="Next - I/O Tuning">Next</a>
&nbsp;&gt;&nbsp;&nbsp;</font>
   </td>
 </tr>

 <tr>
  <td bgcolor="#CCCCCC" colspan="2" height="15" align="right">
  <font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="1">Product:  
<a href="vxfs_splashpage_docCD_vxfs1_103036.vxhd" title="File System Guides title page ">File System Guides</a>
  &nbsp;&nbsp;
  </font>
  </td>
 </tr>
 <tr>
  <td bgcolor="#CCCCCC" colspan="2" height="15" align="right">
  <font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="1">Manual:  
<a href="vxfs_admin_titlepage_docCD_vxfs2_73700.vxhd" title="File System 4.1 Administrator's Guide title page ">File System 4.1 Administrator's Guide</a>
  &nbsp;&nbsp;
  </font>
  </td>
 </tr>


</table>
</div>

<div align="left">
 <table border="0" width="100%" bgcolor="#FFFFFF">
  <tr>
   <td width="100%" valign="top" bgcolor="#FFFFFF">

<!-- Start Main Topic Content -->
        <a name="startcontent"></a>
	
<h1><font face="Arial, Helvetica, Geneva, sansserif, sans serif, Verdana" size="+1" color="#000000"><a name="120295"></a> Monitoring Free Space</font>
</h1>
         
<p>
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="120296"></a>In general, VxFS works best if the percentage of free space in the file system does not get below 10 percent. This is because file systems with 10 percent or more free space have less fragmentation and better extent allocation. Regular use of the <font face="Courier New, Courier, sansserif, sans serif" size="2">df</font> command (see the <font face="Courier New, Courier, sansserif, sans serif" size="2">df_vxfs</font>(1M) manual page) to monitor free space is desirable. Full file systems may have an adverse effect on file system performance. Full file systems should therefore have some files removed, or should be expanded (see the <font face="Courier New, Courier, sansserif, sans serif" size="2">fsadm_vxfs</font>(1M) manual page for a description of online file system expansion).</font>
</p>




<h2><font face="Arial, Helvetica, Geneva, sansserif, sans serif, Verdana" size="3" color="#000000"><a name="120303"></a>Monitoring Fragmentation</font>
</h2>
 
<p>
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="120304"></a>Fragmentation reduces performance and availability. Regular use of <font face="Courier New, Courier, sansserif, sans serif" size="2">fsadm</font>'s fragmentation reporting and reorganization facilities is therefore advisable.</font>
</p>

<p>
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="120308"></a>The easiest way to ensure that fragmentation does not become a problem is to schedule regular defragmentation runs using the <font face="Courier New, Courier, sansserif, sans serif" size="2">cron</font> command.</font>
</p>

<p>
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="120311"></a>Defragmentation scheduling should range from weekly (for frequently used file systems) to monthly (for infrequently used file systems). Extent fragmentation should be monitored with <font face="Courier New, Courier, sansserif, sans serif" size="2">fsadm</font> or the <font face="Courier New, Courier, sansserif, sans serif" size="2">df&nbsp;-o</font> <font face="Courier New, Courier, sansserif, sans serif" size="2">s</font> commands. There are three factors which can be used to determine the degree of fragmentation: </font>
</p>

<p>
<ul type="disc"><li><font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="120313"></a>Percentage of free space in extents of less than 8 blocks in length </font>
</li>
<li><font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="120314"></a>Percentage of free space in extents of less than 64 blocks in length </font>
</li>
<li><font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="120315"></a>Percentage of free space in extents of length 64 blocks or greater</font>
</li>
</ul>
</p>
<p>
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="120316"></a>An unfragmented file system will have the following characteristics: </font>
</p>

<p>
<ul type="disc"><li><font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="120317"></a>Less than 1 percent of free space in extents of less than 8 blocks in length </font>
</li>
<li><font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="120318"></a>Less than 5 percent of free space in extents of less than 64 blocks in length </font>
</li>
<li><font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="120319"></a>More than 5 percent of the total file system size available as free extents in lengths of 64 or more blocks</font>
</li>
</ul>
</p>
<p>
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="120320"></a>A badly fragmented file system will have one or more of the following characteristics: </font>
</p>

<p>
<ul type="disc"><li><font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="120321"></a>Greater than 5 percent of free space in extents of less than 8 blocks in length </font>
</li>
<li><font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="120322"></a>More than 50 percent of free space in extents of less than 64 blocks in length </font>
</li>
<li><font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="120323"></a>Less than 5 percent of the total file system size available as free extents in lengths of 64 or more blocks </font>
</li>
</ul>
</p>
<p>
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="120326"></a>The optimal period for scheduling of extent reorganization runs can be determined by choosing a reasonable interval, scheduling <font face="Courier New, Courier, sansserif, sans serif" size="2">fsadm</font> runs at the initial interval, and running the extent fragmentation report feature of <font face="Courier New, Courier, sansserif, sans serif" size="2">fsadm</font> before and after the reorganization. </font>
</p>

<p>
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="120329"></a>The &quot;before&quot; result is the degree of fragmentation prior to the reorganization. If the degree of fragmentation is approaching the figures for bad fragmentation, reduce the interval between <font face="Courier New, Courier, sansserif, sans serif" size="2">fsadm</font> runs. If the degree of fragmentation is low, increase the interval between <font face="Courier New, Courier, sansserif, sans serif" size="2">fsadm</font> runs.</font>
</p>

<p>
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="120330"></a>The &quot;after&quot; result is an indication of how well the reorganizer has performed. The degree of fragmentation should be close to the characteristics of an unfragmented file system. If not, it may be a good idea to resize the file system; full file systems tend to fragment and are difficult to defragment. It is also possible that the reorganization is not being performed at a time during which the file system in question is relatively idle.</font>
</p>

<p>
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="120335"></a>Directory reorganization is not nearly as critical as extent reorganization, but regular directory reorganization will improve performance. It is advisable to schedule directory reorganization for file systems when the extent reorganization is scheduled. The following is a sample script that is run periodically at 3:00 A.M. from <font face="Courier New, Courier, sansserif, sans serif" size="2">cron</font> for a number of file systems:</font>
</p>

<br>
<font face="Courier New, Courier, sansserif, sans serif" size="2"><a name="251832"></a>&nbsp;outfile=/usr/spool/fsadm/out.'/bin/date&nbsp;+'%m%d''
</font>
<br>
<font face="Courier New, Courier, sansserif, sans serif" size="2"><a name="251833"></a>&nbsp;&nbsp;for&nbsp;i&nbsp;in&nbsp;/home&nbsp;/home2&nbsp;/project&nbsp;/db
</font>
<br>
<font face="Courier New, Courier, sansserif, sans serif" size="2"><a name="251834"></a>&nbsp;&nbsp;do
</font>
<br>
<font face="Courier New, Courier, sansserif, sans serif" size="2"><a name="251835"></a>&nbsp;&nbsp;&nbsp;/bin/echo&nbsp;&quot;Reorganizing&nbsp;$i&quot;
</font>
<br>
<font face="Courier New, Courier, sansserif, sans serif" size="2"><a name="251836"></a>&nbsp;&nbsp;&nbsp;/bin/timex&nbsp;fsadm&nbsp;-F&nbsp;vxfs&nbsp;-e&nbsp;-E&nbsp;-s&nbsp;$i
</font>
<br>
<font face="Courier New, Courier, sansserif, sans serif" size="2"><a name="251837"></a>&nbsp;&nbsp;&nbsp;/bin/timex&nbsp;fsadm&nbsp;-F&nbsp;vxfs&nbsp;-s&nbsp;-d&nbsp;-D&nbsp;$i
</font>
<br>
<font face="Courier New, Courier, sansserif, sans serif" size="2"><a name="251839"></a>&nbsp;&nbsp;done&nbsp;&gt;&nbsp;$outfile&nbsp;2&gt;&amp;1&nbsp;
</font>

<!-- End Main Topic Content -->

   </td>
  </tr>
 </table>
</div>

<div>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
 <tr>
  <td height="18" border="0" cellspacing="0" cellpadding="0" colspan="2" bgcolor="#FFFFFF">
  </td>
 </tr>
  <td align="left"><font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="-2">&nbsp;&#94;&nbsp;<a href="02_performance_vxfs33_120295.html" title="Monitoring Free Space">Return to Top</a></font>

  </td>
  <td align="right"><font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="-2">&lt;&nbsp;<a href="02_performance_vxfs32_120095.html" title="Previous - Kernel Tunables">Previous</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="02_performance_vxfs34_120371.html" title="Next - I/O Tuning">Next</a>
&nbsp;&gt;&nbsp;&nbsp;</font>
  </td>
 <tr>
   <td height="9" border="0" cellspacing="0" cellpadding="0" colspan="2" bgcolor="#FFFFFF">
   </td>
 </tr>

<!-- Footer Breadcrumbs -->
<tr>
<td bgcolor="#FFFFFF" colspan="2" height="15" align="right">
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="1">Product:  
<a href="vxfs_splashpage_docCD_vxfs1_103036.vxhd" title="File System Guides title page ">File System Guides</a>&nbsp;&nbsp;</font></td>
</tr>

<tr>
<td bgcolor="#FFFFFF" colspan="2" height="15" align="right">
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="1">Manual:  
<a href="vxfs_admin_titlepage_docCD_vxfs2_73700.vxhd" title="File System 4.1 Administrator's Guide title page ">File System 4.1 Administrator's Guide</a>&nbsp;&nbsp;</font></td>
</tr>


 <tr>
  <td colspan="2" align="left"><font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" color="#000000" align="right" size="-2">
<em>VERITAS Software Corporation
</em></font><br>

<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="-2">www.veritas.com</font><br>
  </td>
 </tr>
</table>
</div>

</BODY>
  <!--
    *************************************************************************************
    * Copyright (c) 2005 VERITAS Software Corporation. All rights reserved. *

    VERITAS, VERITAS SOFTWARE, the VERITAS Logo, and VERITAS Software Documentation 
    are trademarks or registered trademarks of VERITAS Software Corporation 
    or its affiliates in the U.S. and other countries. Other names may be 
    trademarks of their respective owners. 

    Apache Jakarta Lucene:
    Apache Software License
    Version 1.1

    Copyright (c) 2000 The Apache Software Foundation. All rights reserved.

    Redistribution and use in source and binary forms, with or without modification, 
    are permitted provided that the following conditions are met:

    1. Redistributions of source code must retain the above copyright notice, this 
    list of conditions and the following disclaimer.

    2. Redistributions in binary form must reproduce the above copyright notice, this 
    list of conditions and the following disclaimer in the documentation and/or other 
    materials provided with the distribution.

    3. The end-user documentation included with the redistribution, if any, must include 
    the following acknowledgment: "This product includes software developed by the Apache 
    Software Foundation (http://www.apache.org/)." Alternately, this acknowledgment may 
    appear in the software itself, if and wherever such third-party acknowledgments 
    normally appear.

    4. The names "Apache" and "Apache Software Foundation" must not be used to endorse or 
    promote products derived from this software without prior written permission. For 
    written permission, please contact apache@apache.org.

    5. Products derived from this software may not be called "Apache", nor may "Apache" 
    appear in their name, without prior written permission of the Apache Software Foundation.

    THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, 
    BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 
    PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION 
    OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 
    OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 
    OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 
    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 
    ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

    This software consists of voluntary contributions made by many individuals on behalf 
    of the Apache Software Foundation. For more information on the Apache Software Foundation, 
    please see <http://www.apache.org/>. Portions of this software are based upon public domain 
    software originally written at the National Center for Supercomputing Applications, University 
    of Illinois, Urbana-Champaign.
    
    This product includes WebWindow Software developed by Horst Heistermann.
    *************************************************************************************
  -->
</HTML>
