📄 1165.html
字号:
<TD vAlign=top width="80%">
<DIV align=center>
<FORM action="search.html" tppabs="http://www.linuxhero.com/docs/search.html" method=get>
</FORM>
<TABLE cellSpacing=0 cellPadding=0 width="95%"
border=0><TBODY>
<TR>
<TD background="images/bgi.gif" tppabs="http://www.linuxhero.com/docs/images/bgi.gif"
height=30></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=3 width="95%"
align=center border=0>
<TBODY>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=3 width="100%"
border=0>
<TBODY>
<TR>
<TD vAlign=top>
<p><FONT class=normalfont><B><font color=blue>linux系统提速手记</font></B></FONT><BR><FONT class=smallfont color=#ff9900>2004-04-23 15:18 pm</FONT><BR><FONT class=normalfont>作者:feming<br>来自:Linux知识宝库<br>联系方式:无名<br><br>我的计算机配备如下∶<br>
<br>
处理器∶Intel 赛扬 500 MHz<br>
记忆体∶256 Mb PC100 RAM<br>
硬碟∶80Gb 7200 rpm ATA100<br>
显示卡∶tnt2 AGP<br>
声卡∶sb live!<br>
网络卡∶8139<br>
显示器∶mac 796fd2<br>
操作系统∶安装 Win2k server 与 RH7.3 + suse 8.1<br>
<br>
一、开启硬盘 DMA 支持。<br>
<br>
系统安装完毕後,硬盘的 DMA 是没有打开的,我的方法是在<br>
/etc/rc.d/rc.local 最後面加上一行 /sbin/hdparm -d1 -c3 -m16 /dev/hda 这样每次开机後,硬盘的 DMA 就会开启,不必每次手动设定。<br>
<br>
如果您的硬盘机支持 ATA33 可以加上 -X66 这个参数,ATA66则是 -X68,像我的硬盘是 ATA66 那麽完整参数就是 /sbin/hdparm -d1 -X68 -c3 -m16 /dev/hda 经过我的测试 ,在 DMA 未开启以前,实际读取效率是每秒约 4.10 Mb 左右,开启 DMA 後,每秒实际读取效率跃升为 20 Mb 大约提升 5 倍之多。<br>
<br>
§未开启 DMA 时的测试<br>
<br>
[root@firefly /root]# hdparm -d0 /dev/hda<br>
<br>
/dev/hda:<br>
<br>
setting using_dma to 0 (off)<br>
using_dma = 0 (off)<br>
<br>
[root@firefly /root]# hdparm -Tt /dev/hda<br>
<br>
/dev/hda:<br>
<br>
Timing buffer-cache reads: 128 MB in 2.75 seconds = 46.55 MB/sec<br>
Timing buffered disk reads: 64 MB in 15.58 seconds = 4.11 MB/sec<br>
<br>
§开启 DMA 後的测试结果<br>
<br>
[root@firefly /root]# hdparm -d1 -X68 -c3 -m16 /dev/hda<br>
<br>
/dev/hda:<br>
<br>
setting 32-bit I/O support flag to 3<br>
setting multcount to 16<br>
setting using_dma to 1 (on)<br>
setting xfermode to 69 (UltraDMA mode5)<br>
multcount = 16 (on)<br>
I/O support = 3 (32-bit w/sync)<br>
using_dma = 1 (on)<br>
<br>
[root@firefly /root]# hdparm -Tt /dev/hda/dev/hda:<br>
<br>
Timing buffer-cache reads: 128 MB in 2.75 seconds = 46.55 MB/sec<br>
Timing buffered disk reads: 64 MB in 3.20 seconds = 20.00 MB/sec<br>
<br>
由以上的数据,可以看得出来,硬盘 DMA 是否开启,对读取效率影响很大。<br>
<br>
二、关闭多馀的系统服务。<br>
<br>
这是老生常谈的题目了,一般我们当作桌上型工作站的时候,只需要激活几个基本的?Service 即可,其他的不但没用,一方面会占用系统资源,另一方面则会有安全上的顾虑,我平常只用来连网、打打文件、听听音乐、看看电影,多半时间只是一个 Client 端,实在没必要激活 Server 端的服务,所以,我在 Setup System Services时,只留下以下几个 Service,其馀的都关闭。<br>
<br>
1. crond<br>
2. network<br>
3. syslogd<br>
<br>
真的,相信我,只要这四个就足够了!<br>
<br>
三、下载 Kernel 重新编程。<br>
<br>
因为系统所默认安装的 Kernel 是为了适用大部分的计算机而做的,并未对你的计算机作最优化,所以显得臃肿肥大,因为 Kernel 直接掌控著计算机的一切,所以对系统效率影响当然很大。<br>
<br>
我的作法是∶下载最新的 Kernel 重新编程,将我计算机上的硬件直接编程进 Kernel 里面,不要作成 Module ,对於不需要的就不编程,这样,打造出完全面向自己环境的 Kernel ,才能完全发挥计算机的威力。<br>
<br>
至於 Kernel 怎样编程?这就不是我的主题了,大家可以到CLDP 自行参考 KERNEL HOW-TO 中译版。<br>
<br>
四、减少虚拟终端机的数量。<br>
<br>
系统默认是6个,也就是 CTRL+ALT F1~F6 那六个,我关掉其中四个,只留下 CTRL+ALT F1~F2,大约省下 4 Mbytes 的记忆体,但是这样一来,X-Window 会从原来的 CTRL+ALT F7 变成 CTRL+ALT F3 。<br>
<br>
修改 /etc/inittab 中,将 mingetty 3 ~6 全部加上 # 字号,然後下指令 #init q<br>
<br>
五、调整 X-Windows 环境<br>
<br>
我习惯操作 KDE ,对 GNOME 不熟,所以,以下是都是面向 KDE而设,GNOME 的使用者,我想,应该也差不多啦!<br>
<br>
1、颜色数设为 16 Bit 就有很好的效果了,24 Bit 除了浪费资源,看不出有何好处。<br>
2、不要使用屏幕保护程序。<br>
3、取消动画窗口功能。<br>
4、尽量使用同一种字型。<br>
5、浏览器用 Mozilla 不要用 Netscape。<br>
6、不要激活音效服务器 artd<br>
<br>
Speed Up X by Managing Font Setting 在你抱怨 X 跑得不够快之前,<br>
先检查字型设定, 很可能就是影响效能的一大元凶。<br>
先看一下 /etc/X11/XF86Config-4 档案里的 FontPath 设定值, 如果是<br>
如下∶<br>
Section "Files"<br>
<br>
RgbPath "/usr/X11R6/lib/X11/rgb"<br>
<br>
# Multiple FontPath entries are allowed (they are concatenated together)<br>
# By default, Mandrake 6.0 and later now use a font server independent of<br>
# the X server to render fonts.<br>
<br>
FontPath "unix/:-1"<br>
<br>
EndSection<br>
<br>
可参考 /etc/X11/fs/config 档案里的字型设定值, 挑选几个喜欢的字型目录(全部比较不会错)<br>
来修改, 例如我直接设定下列几个字型目录∶<br>
Section "Files"<br>
<br>
RgbPath "/usr/X11R6/lib/X11/rgb"<br>
<br>
# Multiple FontPath entries are allowed (they are concatenated together)<br>
# By default, Mandrake 6.0 and later now use a font server independent of<br>
# the X server to render fonts.<br>
<br>
FontPath "/usr/X11R6/lib/X11/fonts/misc:unscaled"<br>
FontPath "/usr/X11R6/lib/X11/fonts/75dpi:unscaled"<br>
FontPath "/usr/X11R6/lib/X11/fonts/Type1"<br>
FontPath "/usr/X11R6/lib/X11/fonts/mdk:unscaled"<br>
FontPath "/usr/share/fonts/ttf/big5"<br>
<br>
EndSection<br>
<br>
修改之後, 重新激活 startx 感受看看棉。<br>
<br>
原本的 FontPath "unix/:-1" 将字型由 X Font Server 来提供,<br>
一般使用者未蒙其利、先受其害, 可以考虑等熟悉 X Font Server 功能後再使用。<br>
如此就可以关掉xfs了<br>
ps:试用时不要用默认开机直接进x-window,若不行会卡在x-window<br>
ps:引用自http://twopensource.org/~marr/xfont_tip.html<br>
六、调整应用程序优先权。<br>
<br>
一般时候,我们使用任何程序时,其 NICE 值都是 0,意思是CPU 的使用权值。如果我们常用程序有较高的优先权的话,自然效率就会比较好,优先权的值从 -20 到 19 ,数字越小优先权就越高,但要注意的是一般使用者只能调低( 0~19),只有 root 有权调高优先权( -20 ~ 19 )。我们可以用 ps -fel 来观察 NI 那栏就知道。<br>
<br>
说了半天,到底如何调整呢?有一个指令 /bin/nice 就是用来作这件事的,用法如下∶nice?-n?程序名称?参数....<br>
n 的值从 -20 到 19,这是手动操作,在 KDE 中,可以用选单编辑器来设定,方法是在你要调整优先权的程序的 [ 命令 ] 那一栏的前面,加上 /bin/nice --n 就可以了。<br>
<br>
比方说我常用 Mozilla 来浏览网页,我改成 /bin/nice --10 /usr/local/mozilla/mozilla 这样我的 Mozilla 执行时,就比其他程序有更高的优先权,在实际测试的时候,Mozilla 激活速度以及回应都快了不少,其他一些常用的程序,也可以比照办理。<br>
<br>
後记<br>
<br>
Linux 真的是一套很棒的操作系统,经过这样调整後,光是开机到登入窗口画面出现,从原来的 48 秒,变成 30 秒,用 top 指令(每秒)观察CPU idle 时间也从 82% 提升到 93%,而窗口程序的反应感觉上与 Win me 差不多了。<br>
</FONT><br>
</TD>
</TR>
<TR>
<TD colSpan=2><FONT
class=middlefont></FONT><BR>
<FONT
class=normalfont>全文结束</FONT> </TD>
</TR>
<TR>
<TD background="images/dot.gif" tppabs="http://www.linuxhero.com/docs/images/dot.gif" colSpan=2
height=10></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV></TD>
<TD vAlign=top width="20%"
background="images/line.gif" tppabs="http://www.linuxhero.com/docs/images/line.gif" rowSpan=2>
<DIV align=center>
<table class=tableoutline cellspacing=1 cellpadding=4
width="100%" align=center border=0>
<tr class=firstalt>
<td noWrap background="images/bgline.gif" tppabs="http://www.linuxhero.com/docs/images/bgline.gif" colspan=2 height=21>
<font class=normalfont><b>所有分类</b></font></td>
</tr>
<tr class=secondalt> <td noWrap width=27%> <font class=normalfont>1:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type1.html" tppabs="http://www.linuxhero.com/docs/type1.html">非技术类</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>2:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type2.html" tppabs="http://www.linuxhero.com/docs/type2.html">基础知识</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>3:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type3.html" tppabs="http://www.linuxhero.com/docs/type3.html">指令大全</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>4:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type4.html" tppabs="http://www.linuxhero.com/docs/type4.html">shell</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>5:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type5.html" tppabs="http://www.linuxhero.com/docs/type5.html">安装启动</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>6:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type6.html" tppabs="http://www.linuxhero.com/docs/type6.html">xwindow</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>7:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type7.html" tppabs="http://www.linuxhero.com/docs/type7.html">kde</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>8:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type8.html" tppabs="http://www.linuxhero.com/docs/type8.html">gnome</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>9:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type9.html" tppabs="http://www.linuxhero.com/docs/type9.html">输入法类</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>10:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type10.html" tppabs="http://www.linuxhero.com/docs/type10.html">美化汉化</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>11:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type11.html" tppabs="http://www.linuxhero.com/docs/type11.html">网络配置</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>12:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type12.html" tppabs="http://www.linuxhero.com/docs/type12.html">存储备份</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>13:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type13.html" tppabs="http://www.linuxhero.com/docs/type13.html">杂项工具</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>14:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type14.html" tppabs="http://www.linuxhero.com/docs/type14.html">编程技术</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>15:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type15.html" tppabs="http://www.linuxhero.com/docs/type15.html">网络安全</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>16:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type16.html" tppabs="http://www.linuxhero.com/docs/type16.html">内核技术</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>17:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type17.html" tppabs="http://www.linuxhero.com/docs/type17.html">速度优化</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>18:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type18.html" tppabs="http://www.linuxhero.com/docs/type18.html">apache</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>19:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type19.html" tppabs="http://www.linuxhero.com/docs/type19.html">email</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>20:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type20.html" tppabs="http://www.linuxhero.com/docs/type20.html">ftp服务</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>21:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type21.html" tppabs="http://www.linuxhero.com/docs/type21.html">cvs服务</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>22:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type22.html" tppabs="http://www.linuxhero.com/docs/type22.html">代理服务</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>23:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type23.html" tppabs="http://www.linuxhero.com/docs/type23.html">samba</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>24:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type24.html" tppabs="http://www.linuxhero.com/docs/type24.html">域名服务</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>25:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type25.html" tppabs="http://www.linuxhero.com/docs/type25.html">网络过滤</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>26:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type26.html" tppabs="http://www.linuxhero.com/docs/type26.html">其他服务</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>27:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type27.html" tppabs="http://www.linuxhero.com/docs/type27.html">nfs</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>28:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type28.html" tppabs="http://www.linuxhero.com/docs/type28.html">oracle</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>29:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type29.html" tppabs="http://www.linuxhero.com/docs/type29.html">dhcp</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>30:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type30.html" tppabs="http://www.linuxhero.com/docs/type30.html">mysql</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>31:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type31.html" tppabs="http://www.linuxhero.com/docs/type31.html">php</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>32:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type32.html" tppabs="http://www.linuxhero.com/docs/type32.html">ldap</a></font></td> </tr> </table></td></tr> </table>
</DIV></TD></TR>
<TR vAlign=top>
<TD width="80%">
<DIV align=center><BR>
</DIV>
</TD></TR></TBODY></TABLE></TD></TR>
</TABLE></TD></TR>
</TABLE>
<TABLE cellSpacing=0 cellPadding=4 width="100%" bgColor=#eeeeee
border=0><TBODY>
<TR>
<TD width="50%">
<P><FONT class=middlefont>版权所有 © 2004 <A
href="mailto:bjchenxu@sina.com">linux知识宝库</A><BR>
违者必究. </FONT></P>
</TD>
<TD width="50%">
<DIV align=right><FONT class=middlefont>Powered by: <A
href="mailto:bjchenxu@sina.com">Linux知识宝库</A> Version 0.9.0 </FONT></DIV>
</TD></TR></TBODY></TABLE>
<CENTER></CENTER></TD></TR>
</TABLE></CENTER></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -