⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 configtuning-initial.html

📁 FreeBSD操作系统的详细使用手册
💻 HTML
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta name="generator" content="HTML Tidy, see www.w3.org" /><title>Initial Configuration</title><meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.7" /><link rel="HOME" title="FreeBSD Handbook" href="index.html" /><link rel="UP" title="Configuration and Tuning" href="config-tuning.html" /><link rel="PREVIOUS" title="Configuration and Tuning" href="config-tuning.html" /><link rel="NEXT" title="Core Configuration"href="configtuning-core-configuration.html" /><link rel="STYLESHEET" type="text/css" href="docbook.css" /></head><body class="SECT1" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#840084"alink="#0000FF"><div class="NAVHEADER"><table summary="Header navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><th colspan="3" align="center">FreeBSD Handbook</th></tr><tr><td width="10%" align="left" valign="bottom"><a href="config-tuning.html"accesskey="P">Prev</a></td><td width="80%" align="center" valign="bottom">Chapter 11 Configuration and Tuning</td><td width="10%" align="right" valign="bottom"><ahref="configtuning-core-configuration.html" accesskey="N">Next</a></td></tr></table><hr align="LEFT" width="100%" /></div><div class="SECT1"><h1 class="SECT1"><a id="CONFIGTUNING-INITIAL" name="CONFIGTUNING-INITIAL">11.2 InitialConfiguration</a></h1><div class="SECT2"><h2 class="SECT2"><a id="AEN15640" name="AEN15640">11.2.1 Partition Layout</a></h2><div class="SECT3"><h3 class="SECT3"><a id="AEN15653" name="AEN15653">11.2.1.1 Base Partitions</a></h3><p>When laying out file systems with <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=disklabel&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">disklabel</span>(8)</span></a> or <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=sysinstall&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">sysinstall</span>(8)</span></a>,remember that hard drives transfer data faster from the outer tracks to the inner. Thussmaller and heavier-accessed file systems should be closer to the outside of the drive,while larger partitions like <tt class="FILENAME">/usr</tt> should be placed toward theinner. It is a good idea to create partitions in a similar order to: root, swap, <ttclass="FILENAME">/var</tt>, <tt class="FILENAME">/usr</tt>.</p><p>The size of <tt class="FILENAME">/var</tt> reflects the intended machine usage. <ttclass="FILENAME">/var</tt> is used to hold mailboxes, log files, and printer spools.Mailboxes and log files can grow to unexpected sizes depending on how many users existand how long log files are kept. Most users would never require a gigabyte, but rememberthat <tt class="FILENAME">/var/tmp</tt> must be large enough to contain packages.</p><p>The <tt class="FILENAME">/usr</tt> partition holds much of the files required tosupport the system, the <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=ports&sektion=7"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">ports</span>(7)</span></a> collection(recommended) and the source code (optional). Both of which are optional at install time.At least 2 gigabytes would be recommended for this partition.</p><p>When selecting partition sizes, keep the space requirements in mind. Running out ofspace in one partition while barely using another can be a hassle.</p><div class="NOTE"><blockquote class="NOTE"><p><b>Note:</b> Some users have found that <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=sysinstall&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">sysinstall</span>(8)</span></a>'s <varclass="LITERAL">Auto-defaults</var> partition sizer will sometimes select smaller thanadequate <tt class="FILENAME">/var</tt> and <tt class="FILENAME">/</tt> partitions.Partition wisely and generously.</p></blockquote></div></div><div class="SECT3"><h3 class="SECT3"><a id="SWAP-DESIGN" name="SWAP-DESIGN">11.2.1.2 Swap Partition</a></h3><p>As a rule of thumb, the swap partition should be about double the size of systemmemory (RAM). For example, if the machine has 128&nbsp;megabytes of memory, the swap fileshould be 256&nbsp;megabytes. Systems with less memory may perform better with more swap.Less than 256&nbsp;megabytes of swap is not recommended and memory expansion should beconsidered. The kernel's VM paging algorithms are tuned to perform best when the swappartition is at least two times the size of main memory. Configuring too little swap canlead to inefficiencies in the VM page scanning code and might create issues later if morememory is added.</p><p>On larger systems with multiple SCSI disks (or multiple IDE disks operating ondifferent controllers), it is recommend that a swap is configured on each drive (up tofour drives). The swap partitions should be approximately the same size. The kernel canhandle arbitrary sizes but internal data structures scale to 4 times the largest swappartition. Keeping the swap partitions near the same size will allow the kernel tooptimally stripe swap space across disks. Large swap sizes are fine, even if swap is notused much. It might be easier to recover from a runaway program before being forced toreboot.</p></div><div class="SECT3"><h3 class="SECT3"><a id="AEN15691" name="AEN15691">11.2.1.3 Why Partition?</a></h3><p>Several users think a single large partition will be fine, but there are severalreasons why this is a bad idea. First, each partition has different operationalcharacteristics and separating them allows the file system to tune accordingly. Forexample, the root and <tt class="FILENAME">/usr</tt> partitions are read-mostly, withoutmuch writing. While a lot of reading and writing could occur in <ttclass="FILENAME">/var</tt> and <tt class="FILENAME">/var/tmp</tt>.</p><p>By properly partitioning a system, fragmentation introduced in the smaller write heavypartitions will not bleed over into the mostly-read partitions. Keeping the write-loadedpartitions closer to the disk's edge, will increase I/O performance in the partitionswhere it occurs the most. Now while I/O performance in the larger partitions may beneeded, shifting them more toward the edge of the disk will not lead to a significantperformance improvement over moving <tt class="FILENAME">/var</tt> to the edge. Finally,there are safety concerns. A smaller, neater root partition which is mostly read-only hasa greater chance of surviving a bad crash.</p></div></div></div><div class="NAVFOOTER"><hr align="LEFT" width="100%" /><table summary="Footer navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><td width="33%" align="left" valign="top"><a href="config-tuning.html"accesskey="P">Prev</a></td><td width="34%" align="center" valign="top"><a href="index.html"accesskey="H">Home</a></td><td width="33%" align="right" valign="top"><a href="configtuning-core-configuration.html"accesskey="N">Next</a></td></tr><tr><td width="33%" align="left" valign="top">Configuration and Tuning</td><td width="34%" align="center" valign="top"><a href="config-tuning.html"accesskey="U">Up</a></td><td width="33%" align="right" valign="top">Core Configuration</td></tr></table></div><p align="center"><small>This, and other documents, can be downloaded from <ahref="ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/">ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/</a>.</small></p><p align="center"><small>For questions about FreeBSD, read the <ahref="http://www.FreeBSD.org/docs.html">documentation</a> before contacting &#60;<ahref="mailto:questions@FreeBSD.org">questions@FreeBSD.org</a>&#62;.<br />For questions about this documentation, e-mail &#60;<ahref="mailto:doc@FreeBSD.org">doc@FreeBSD.org</a>&#62;.</small></p></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -