<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>LinuxByte &#187; 优化</title>
	<atom:link href="http://www.linuxbyte.org/tag/%e4%bc%98%e5%8c%96/feed" rel="self" type="application/rss+xml" />
	<link>http://www.linuxbyte.org</link>
	<description>一个Linux Blog</description>
	<lastBuildDate>Tue, 22 Jun 2010 15:10:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>ubuntu 9.04 安装配置优化全记录</title>
		<link>http://www.linuxbyte.org/ubuntu-904-an-zhuang-pei-zhi-you-hua-quan-ji-lu.html</link>
		<comments>http://www.linuxbyte.org/ubuntu-904-an-zhuang-pei-zhi-you-hua-quan-ji-lu.html#comments</comments>
		<pubDate>Fri, 08 May 2009 16:27:07 +0000</pubDate>
		<dc:creator>xiao H</dc:creator>
				<category><![CDATA[日常桌面]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[ubuntu  9.04]]></category>
		<category><![CDATA[优化]]></category>
		<category><![CDATA[安装]]></category>
		<category><![CDATA[配置]]></category>

		<guid isPermaLink="false">http://www.linuxbyte.org/?p=419</guid>
		<description><![CDATA[正如我常说的，生命在于折腾！今天又耐不住EXT4 的诱惑，在网吧的专机上装上了ubuntu 9.04，这里记录我的ubuntu 9.04 安装配置和优化。
网络安装ubuntu 9.04
鉴于我是在网吧装的系统，网络环境非常... ]]></description>
			<content:encoded><![CDATA[<p>正如我常说的，生命在于折腾！今天又耐不住EXT4 的诱惑，在网吧的专机上装上了ubuntu 9.04，这里记录我的ubuntu 9.04 安装配置和优化。</p>
<p><strong>网络安装ubuntu 9.04</strong><br />
鉴于我是在网吧装的系统，网络环境非常好，并且mirrors.163.com 已经有了 ubuntu 9.04 的源，所以网络安装对我来说是最合适的了。<br />
下载：http://mirrors.163.com/ubuntu/dists/jaunty/main/installer-i386/current/images/netboot/ubuntu-installer/i386/ 目录下的initrd.gz 和linux  文件，放到一个fat32 或ext3 分区下，并在grub 中添加如下启动语句：</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">title Net <span style="color: #c20cb9; font-weight: bold;">install</span>
root <span style="color: #7a0874; font-weight: bold;">&#40;</span>hd0,<span style="color: #000000;">6</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> 
kernel <span style="color: #000000; font-weight: bold;">/</span>linux
initrd <span style="color: #000000; font-weight: bold;">/</span>initrd.gz</pre></div></div>

<p>文件的具体位置请根据自己的实际情况自行修正。<br />
<span id="more-419"></span><br />
重启进入安装进程，安装过程和其他安装方式差不多。不过在选择安装源时要注意千万别用默认的中国官方源，而是光标一直推到顶端手动选择。然后输入<br />
mirrors.163.com,另外还有一个选安装哪些包的，这个是按版本分的如kubuntu，xubuntu，Edubuntu &#8230; 我选的是大家最常用的ubuntu desktop，当然你时间很多并且对自己的机子有很强的控制欲，你可以选择最后一项手动选择要安装的包。</p>
<p>总的来说安装还是很简单的，并且也非常迅速，我的整个安装过程不到30分钟就完成了。</p>
<p><strong>配置 ubuntu 9.04</strong><br />
不知道是网络安装还是 9.04 的缘故，安装完成后没有我以往的中文语言问题，语言包，字体，中文输入法都安装好了。另 ubuntu 9.04 的中文显示比上个版本好多了。<br />
网络设置<br />
奇怪的问题，安装完成后居然没有继承安装时的网络设置，还得让我手动设置，不幸的是我搞不定如何用图形工具设置网络，最后直接用了命令。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">su</span>
<span style="color: #c20cb9; font-weight: bold;">ifconfig</span> eth0 192.168.0.95<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span>
route add default gw 192.168.0.254
<span style="color: #7a0874; font-weight: bold;">echo</span> nameserver 192.168.0.254 <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>resolv.conf</pre></div></div>

<p>以上行为完全是因为爱现，大家还是用图形工具吧，具体操作参看此帖：http://forum.ubuntu.org.cn/viewtopic.php?f=116&#038;t=162159</p>
<p>配置安装源，因为是从163 网络安装的的所以不需要再添加163 的源只需要另行添加ubuntu-cn 源和Medibuntu源即可，同时注释掉deb-src 语句毕竟我们绝大部分时间不需要源码。<br />
添加第三方源:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #7a0874; font-weight: bold;">echo</span> deb http:<span style="color: #000000; font-weight: bold;">//</span>archive.ubuntu.org.cn<span style="color: #000000; font-weight: bold;">/</span>ubuntu-cn<span style="color: #000000; font-weight: bold;">/</span> jaunty main restricted universe multiverse <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apt<span style="color: #000000; font-weight: bold;">/</span>sources.list
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">wget</span>  http:<span style="color: #000000; font-weight: bold;">//</span>www.medibuntu.org<span style="color: #000000; font-weight: bold;">/</span>sources.list.d<span style="color: #000000; font-weight: bold;">/</span>jaunty.list  <span style="color: #660033;">-O</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apt<span style="color: #000000; font-weight: bold;">/</span>sources.list.d<span style="color: #000000; font-weight: bold;">/</span>medibuntu.list
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> update <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> medibuntu-keyring <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> update</pre></div></div>

<p>安装adobe-flashplugin for firefox</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>ubuntu:ubuntuftp<span style="color: #000000; font-weight: bold;">@</span>ftp.ubuntu.org.cn<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>dbzhang800<span style="color: #000000; font-weight: bold;">/</span>wiki<span style="color: #000000; font-weight: bold;">/</span>install_flash_player_10_linux.deb
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">dpkg</span> <span style="color: #660033;">-i</span> install_flash_player_10_linux.deb</pre></div></div>

<p>安装多媒体播放工具</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> libxine1-ffmpeg libxine1-all-plugins libxine1-plugins w32codecs libstdc++<span style="color: #000000;">5</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> gstreamer0.10-ffmpeg gstreamer0.10-pitfdll gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse gstreamer0.10-esd
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> libdvdnav4 libdvdread4 
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>doc<span style="color: #000000; font-weight: bold;">/</span>libdvdread4<span style="color: #000000; font-weight: bold;">/</span>install-css.sh
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> remove totem-mozilla <span style="color: #660033;">-y</span> 
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> smplayer smplayer-themes mozilla-mplayer libmatroska0
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> gstreamer0.10-fluendo-mpegdemux gstreamer0.10-gnonlin libasound2-plugins</pre></div></div>

<p>安装QQ for ubuntu 9.04</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>dl_dir.qq.com<span style="color: #000000; font-weight: bold;">/</span>linuxqq<span style="color: #000000; font-weight: bold;">/</span>linuxqq_v1.0.2-beta1_i386.deb
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">dpkg</span> <span style="color: #660033;">-i</span> linuxqq_v1.0.2-beta1_i386.deb</pre></div></div>

<p>安装“unrar、p7zip-rar、p7zip-full、cabextract</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> unrar p7zip-rar p7zip-full cabextract</pre></div></div>

<p>安装并配置 vim<br />
系统默认没装vim所以先得装上</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span>　<span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #c20cb9; font-weight: bold;">vim</span></pre></div></div>

<p>创建自己的vimrc（我的vimrc很简单只开启了最常用的一些功能做针对php 代码高亮）<br />
vi ~/.vimrc 内容为</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">set</span> nocompatible
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">columns</span>=<span style="color: #000000;">80</span>
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">tabstop</span>=<span style="color: #000000;">4</span>
<span style="color: #000000; font-weight: bold;">set</span> ruler
<span style="color: #000000; font-weight: bold;">set</span> noexpandtab
<span style="color: #000000; font-weight: bold;">set</span> number
<span style="color: #000000; font-weight: bold;">set</span> ignorecase
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">wrapmargin</span>=<span style="color: #000000;">15</span>
<span style="color: #000000; font-weight: bold;">set</span> cindent
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">shiftwidth</span>=<span style="color: #000000;">4</span>
syntax on
<span style="color: #7a0874; font-weight: bold;">source</span> <span style="color: #007800;">$VIMRUNTIME</span><span style="color: #000000; font-weight: bold;">/</span>syntax<span style="color: #000000; font-weight: bold;">/</span>php.vim</pre></div></div>

<p>设置命令alias简化常用命令sudo操作</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">vim</span> ~<span style="color: #000000; font-weight: bold;">/</span>.bashrc</pre></div></div>

<p>在该文件最后加入</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">alias</span> s-apt-get=’<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span>’
<span style="color: #7a0874; font-weight: bold;">alias</span> s-rm=’<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">rm</span>’
<span style="color: #7a0874; font-weight: bold;">alias</span> s-cp=’<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span>’
<span style="color: #7a0874; font-weight: bold;">alias</span> s-vi=’<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">vim</span>’</pre></div></div>

<p>具体那些命令要做alias可以自己根据习惯设置。</p>
<h3  class="related_post_title">与本文关系暧昧的文字</h3><ul class="related_post"><li><a href="http://www.linuxbyte.org/ubuntu-9-10-an-zhuang-pei-zhi-xiao-ji.html" title="Ubuntu 9.10 安装配置小记">Ubuntu 9.10 安装配置小记</a></li><li><a href="http://www.linuxbyte.org/ubuntu-810-anzhuang-peizhi.html" title="ubuntu 8.10 安装配置小记">ubuntu 8.10 安装配置小记</a></li><li><a href="http://www.linuxbyte.org/opensuse-111-anzhuang-peizhi.html" title="Opensuse 11.1 安装配置">Opensuse 11.1 安装配置</a></li><li><a href="http://www.linuxbyte.org/ubuntu-804-de-she-zhi-he-you-hua.html" title="ubuntu 8.04 的设置和优化">ubuntu 8.04 的设置和优化</a></li><li><a href="http://www.linuxbyte.org/ubuntu-10-10-alpha-1-fa-bu.html" title="Ubuntu 10.10 Alpha 1 发布">Ubuntu 10.10 Alpha 1 发布</a></li><li><a href="http://www.linuxbyte.org/ubuntu-10-04-rc-fa-bu.html" title="Ubuntu 10.04 RC 发布">Ubuntu 10.04 RC 发布</a></li><li><a href="http://www.linuxbyte.org/ubuntu-10-04-xin-bi-zhi.html" title="Ubuntu 10.04 新壁纸">Ubuntu 10.04 新壁纸</a></li><li><a href="http://www.linuxbyte.org/ubuntu-9-10-ting-zhi-xi-tong-fu-wu.html" title="ubuntu 9.10 停止系统服务">ubuntu 9.10 停止系统服务</a></li></ul><hr />
<p><small>© xiao H for <a href="http://www.linuxbyte.org">LinuxByte</a>, 2009<br />
Source: <a href="http://www.linuxbyte.org/ubuntu-904-an-zhuang-pei-zhi-you-hua-quan-ji-lu.html">ubuntu 9.04 安装配置优化全记录</a><br />
<a href="http://www.linuxbyte.org/ubuntu-904-an-zhuang-pei-zhi-you-hua-quan-ji-lu.html#comments">3 comments</a><br />
Post tags: <a href="http://www.linuxbyte.org/tag/ubuntu" rel="tag">Ubuntu</a>, <a href="http://www.linuxbyte.org/tag/ubuntu-904" rel="tag">ubuntu  9.04</a>, <a href="http://www.linuxbyte.org/tag/%e4%bc%98%e5%8c%96" rel="tag">优化</a>, <a href="http://www.linuxbyte.org/tag/%e5%ae%89%e8%a3%85" rel="tag">安装</a>, <a href="http://www.linuxbyte.org/tag/%e9%85%8d%e7%bd%ae" rel="tag">配置</a><br/>
</small></p>
	标签：<a href="http://www.linuxbyte.org/tag/ubuntu" title="Ubuntu" rel="tag">Ubuntu</a>, <a href="http://www.linuxbyte.org/tag/ubuntu-904" title="ubuntu  9.04" rel="tag">ubuntu  9.04</a>, <a href="http://www.linuxbyte.org/tag/%e4%bc%98%e5%8c%96" title="优化" rel="tag">优化</a>, <a href="http://www.linuxbyte.org/tag/%e5%ae%89%e8%a3%85" title="安装" rel="tag">安装</a>, <a href="http://www.linuxbyte.org/tag/%e9%85%8d%e7%bd%ae" title="配置" rel="tag">配置</a><br />

	<h4>相关日志</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.linuxbyte.org/ubuntu-9-10-an-zhuang-pei-zhi-xiao-ji.html" title="Ubuntu 9.10 安装配置小记 (2009-12-27)">Ubuntu 9.10 安装配置小记</a> (4)</li>
	<li><a href="http://www.linuxbyte.org/ubuntu-810-anzhuang-peizhi.html" title="ubuntu 8.10 安装配置小记 (2009-03-19)">ubuntu 8.10 安装配置小记</a> (1)</li>
	<li><a href="http://www.linuxbyte.org/ubuntu-804-de-she-zhi-he-you-hua.html" title="ubuntu 8.04 的设置和优化 (2008-05-05)">ubuntu 8.04 的设置和优化</a> (1)</li>
	<li><a href="http://www.linuxbyte.org/opensuse-111-anzhuang-peizhi.html" title="Opensuse 11.1 安装配置 (2009-02-06)">Opensuse 11.1 安装配置</a> (2)</li>
	<li><a href="http://www.linuxbyte.org/zhen-dui-webfu-wu-qi-zong-ti-you-hua.html" title="针对Web服务器总体优化 (2008-06-07)">针对Web服务器总体优化</a> (0)</li>
</ul>


<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxbyte.org/ubuntu-904-an-zhuang-pei-zhi-you-hua-quan-ji-lu.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>针对Web服务器总体优化</title>
		<link>http://www.linuxbyte.org/zhen-dui-webfu-wu-qi-zong-ti-you-hua.html</link>
		<comments>http://www.linuxbyte.org/zhen-dui-webfu-wu-qi-zong-ti-you-hua.html#comments</comments>
		<pubDate>Sat, 07 Jun 2008 13:08:12 +0000</pubDate>
		<dc:creator>xiao H</dc:creator>
				<category><![CDATA[服务器应用]]></category>
		<category><![CDATA[精品文档]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[优化]]></category>
		<category><![CDATA[服务器]]></category>

		<guid isPermaLink="false">http://www.linuxbyte.org/?p=162</guid>
		<description><![CDATA[作者：killua
方法有些比较激进，做个保存方便以后自己查阅。
一、文件系统
在fstab里加入noatime，如
#cat /etc/fstab
/dev/sda1          /home                  ext3    noatime,defaults        1 2
r... ]]></description>
			<content:encoded><![CDATA[<p>作者：<span style="font-family: Fixedsys;">killua<br />
<em>方法有些比较激进，做个保存方便以后自己查阅。</em></span><span><a href="http://bbs.chinaunix.net/profile-uid-51562.html" target="_blank"><span style="font-family: Fixedsys;"></span></a></span></p>
<p>一、文件系统<br />
在fstab里加入noatime，如<br />
#cat /etc/fstab<br />
/dev/sda1          /home                  ext3    noatime,defaults        1 2<br />
reboot或者重新mount生效</p>
<p><span id="more-162"></span><br />
二、Tcp优化<br />
在/etc/sysctl.conf里加入<br />
net.ipv4.netfilter.ip_conntrack_tcp_timeout_syn_recv = 3<br />
net.ipv4.tcp_syncookies = 1                                #启用syncookies<br />
net.ipv4.tcp_max_syn_backlog = 8192                #定义backlog队列容纳的最大半连接数<br />
net.ipv4.tcp_fin_timeout = 30<br />
net.ipv4.tcp_keepalive_time = 1800<br />
net.ipv4.tcp_window_scaling = 0<br />
net.ipv4.tcp_sack = 0<br />
net.ipv4.tcp_timestamps = 0<br />
<span style="color: blue;">老实说，对于sysctl.conf究竟能不能用起来还真不知道，因为我是没用起来，虽然内核里面是支持的 = =b</span><br />
三、虚拟内存优化<br />
/etc/sysctl.conf<br />
vm.lower_zone_protection = 100<br />
四、I/O调度器<br />
在grub.conf的相应启动选项里加入elevator=deadline，如：<br />
kernel /vmlinuz-2.6.6 ro root=/dev/sda6 elevator=deadline<br />
这里用了Deadline的I/O调度器,它比系统默认的AnticipatoryI/O调度器更为小巧,在数据吞吐量非常大的数据库系统中表现得更有优势。<br />
五、内核源代码参数修改<br />
修改/usr/src/linux/include/linux/posix_types.h<br />
#define __FD_SETSIZE 1024 � 65536<br />
设置fd_set支持的最大数量</p>
<p>修改/usr/src/linux/include/linux/fs.h<br />
#define INR_OPEN 1024 � 65536<br />
#define NR_FILE 8192 � 65536<br />
#define NR_RESERVED_FILES 10 � 128<br />
设置最大打开文件数量（TCP连接数量）</p>
<p>修改/usr/src/linux/include/net/tcp.h<br />
#define TCP_TIMEWAIT_LEN (60*HZ) � 1*HZ<br />
#define TCP_SYNACK_RETRIES  5 � 3<br />
设置在backlog队列里的半连接的重试次数，每次都会花相应的时间，本质上<br />
也是减少重试时间</p>
<p>make menuconfig中，去掉没用的选项，打开以下选项的开关：<br />
High Memory Support (支持4GB以上内存)<br />
Symmetric multi-processing support (支持多CPU)<br />
TCP syncookie support (可以防DOS)<br />
设置文件打开数等的其他方法(好处就是可以不重新编译内核)<br />
在 /etc/init.d/sshd里加入(统一加在. /etc/rc.d/init.d/functions行后面)</p>
<div class="msgbody">
<div id="code0" class="msgborder" style="padding-left: 30px;">ulimit -n 65535 &gt;;/dev/null 2&gt;;&amp;1<br />
ulimit -u 16384 &gt;;/dev/null 2&gt;;&amp;1</div>
</div>
<p>重起sshd：nohup /etc/init.d/sshd restart &amp;<br />
BTW：其实limits.conf不好，因为他需要root su &#8211; user遗传给普通用户<br />
如果直接远程登陆是没效果的<br />
六、apache<br />
1、安装:采用worker线程工作模式</p>
<div class="msgbody">
<div class="msgheader">
</div>
<div id="code1" class="msgborder" style="padding-left: 30px;">./configure &#8211;prefix=/prefix<br />
&#8211;enable-mods-shared=all<br />
&#8211;enable-deflate<br />
&#8211;with-mpm=worker</div>
</div>
<p><span style="color: blue;">chmod +s /prefix/bin/httpd </span>#允许普通用户也可以启动apache<br />
2、配置：httpd.conf</p>
<div class="msgbody">
<div id="code2" class="msgborder">Timeout 60<br />
KeepAlive On<br />
MaxKeepAliveRequests 150<br />
KeepAliveTimeout   5</p>
<p>StartServers         3<br />
MaxClients         3200   #支持3200个客户端哦<br />
ServerLimit        32<br />
MinSpareThreads     50<br />
MaxSpareThreads     250<br />
ThreadLimit   200<br />
ThreadsPerChild     100<br />
MaxRequestsPerChild 0</p>
<p>#上面的几个参数对机器要求比较高，如果是比较差的机器，每台机1000个连接最多了，你可能要重新设置参数，我的机器是DELL 2850</p>
<p>UseCanonicalName Off<br />
HostnameLookups Off<br />
ServerSignature Off</p></div>
</div>
<h3  class="related_post_title">与本文关系暧昧的文字</h3><ul class="related_post"><li><a href="http://www.linuxbyte.org/ubuntu-904-an-zhuang-pei-zhi-you-hua-quan-ji-lu.html" title="ubuntu 9.04 安装配置优化全记录">ubuntu 9.04 安装配置优化全记录</a></li><li><a href="http://www.linuxbyte.org/ubuntu-8_04-software-optimization.html" title="Ubuntu 8.04 下软件设置和优化">Ubuntu 8.04 下软件设置和优化</a></li><li><a href="http://www.linuxbyte.org/ubuntu-804-de-she-zhi-he-you-hua.html" title="ubuntu 8.04 的设置和优化">ubuntu 8.04 的设置和优化</a></li><li><a href="http://www.linuxbyte.org/openoffice-optimization-tips.html" title="使 OpenOffice.org 运行更快的技巧">使 OpenOffice.org 运行更快的技巧</a></li><li><a href="http://www.linuxbyte.org/optimization-mysql-database-under-high-load-server.html" title="linux高负载下彻底优化mysql数据库">linux高负载下彻底优化mysql数据库</a></li><li><a href="http://www.linuxbyte.org/nginx-install.html" title="Nginx 安装">Nginx 安装</a></li></ul><hr />
<p><small>© xiao H for <a href="http://www.linuxbyte.org">LinuxByte</a>, 2008<br />
Source: <a href="http://www.linuxbyte.org/zhen-dui-webfu-wu-qi-zong-ti-you-hua.html">针对Web服务器总体优化</a><br />
<a href="http://www.linuxbyte.org/zhen-dui-webfu-wu-qi-zong-ti-you-hua.html#comments">No comment</a><br />
Post tags: <a href="http://www.linuxbyte.org/tag/web" rel="tag">web</a>, <a href="http://www.linuxbyte.org/tag/%e4%bc%98%e5%8c%96" rel="tag">优化</a>, <a href="http://www.linuxbyte.org/tag/%e6%9c%8d%e5%8a%a1%e5%99%a8" rel="tag">服务器</a><br/>
</small></p>
	标签：<a href="http://www.linuxbyte.org/tag/web" title="web" rel="tag">web</a>, <a href="http://www.linuxbyte.org/tag/%e4%bc%98%e5%8c%96" title="优化" rel="tag">优化</a>, <a href="http://www.linuxbyte.org/tag/%e6%9c%8d%e5%8a%a1%e5%99%a8" title="服务器" rel="tag">服务器</a><br />

	<h4>相关日志</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.linuxbyte.org/openoffice-optimization-tips.html" title="使 OpenOffice.org 运行更快的技巧 (2008-03-02)">使 OpenOffice.org 运行更快的技巧</a> (0)</li>
	<li><a href="http://www.linuxbyte.org/ubuntu-904-an-zhuang-pei-zhi-you-hua-quan-ji-lu.html" title="ubuntu 9.04 安装配置优化全记录 (2009-05-09)">ubuntu 9.04 安装配置优化全记录</a> (3)</li>
	<li><a href="http://www.linuxbyte.org/ubuntu-804-de-she-zhi-he-you-hua.html" title="ubuntu 8.04 的设置和优化 (2008-05-05)">ubuntu 8.04 的设置和优化</a> (1)</li>
	<li><a href="http://www.linuxbyte.org/ubuntu-8_04-software-optimization.html" title="Ubuntu 8.04 下软件设置和优化 (2008-05-07)">Ubuntu 8.04 下软件设置和优化</a> (0)</li>
	<li><a href="http://www.linuxbyte.org/nginx-install.html" title="Nginx 安装 (2008-02-12)">Nginx 安装</a> (0)</li>
</ul>


<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxbyte.org/zhen-dui-webfu-wu-qi-zong-ti-you-hua.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu 8.04 下软件设置和优化</title>
		<link>http://www.linuxbyte.org/ubuntu-8_04-software-optimization.html</link>
		<comments>http://www.linuxbyte.org/ubuntu-8_04-software-optimization.html#comments</comments>
		<pubDate>Wed, 07 May 2008 12:32:31 +0000</pubDate>
		<dc:creator>xiao H</dc:creator>
				<category><![CDATA[日常桌面]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[gftp]]></category>
		<category><![CDATA[OpenOffice]]></category>
		<category><![CDATA[ubunut]]></category>
		<category><![CDATA[vim]]></category>
		<category><![CDATA[优化]]></category>

		<guid isPermaLink="false">http://www.linuxbyte.org/?p=136</guid>
		<description><![CDATA[继续Ubuntu 8.04 之旅 软件设置和优化
优化Firefox 3
虽然Firefox 3 已经很好了，但还是有些可以优化的地方。
network.dns.disableIPv6 -&#62; true
禁用ipv6 的dns 解析。

browser.sessionhistory.max_total_viewers -&#62; 5
... ]]></description>
			<content:encoded><![CDATA[<p>继续Ubuntu 8.04 之旅 软件设置和优化<br />
<strong>优化Firefox 3</strong><br />
虽然Firefox 3 已经很好了，但还是有些可以优化的地方。</p>
<p>network.dns.disableIPv6 -&gt; true<br />
禁用ipv6 的dns 解析。</p>
<p><span id="more-136"></span></p>
<p>browser.sessionhistory.max_total_viewers -&gt; 5<br />
页面快进/快退功能中保存的页面总数，默认是-1(无限)。<br />
network.http.pipelining -&gt; true<br />
network.http.proxy.pipelining -&gt; true<br />
network.http.pipelining.maxrequests -&gt; 8<br />
允许浏览器同时发出多个请求给服务器，而不必等待服务器的返回信息。如果服务器方也支持这一技术(比如Squid？)，则同时会有多个请求来传送网页内容，从而大大加快网页下载速度。</p>
<p>browser.tabs.loadDivertedInBackground -&gt;true。<br />
新打开的标签页在后台，你依然可以浏览当前页面这个看个人习惯了。</p>
<p><span style="font-size: small;"><span style="font-family: 宋体;">network.http.max-connections    32<br />
network.http.max-connections-per-server 10<br />
network.http.max-persistent-connections-per-proxy  10<br />
network.http.max-persistent-connections-per-server 8<br />
这一组都用来控制到服务器的最大链接数，这组参数个人觉得还是别改太大，太大给服务器的压力会很大，搞不好会惹毛对方的防火墙结果把你办了。</span></span></p>
<p>安装简体中文包</p>
<p>http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.0b5/linux-i686/xpi/zh-CN.xpi</p>
<p>添加baidu 搜索引擎</p>
<p>http://addons.mozine.cn/firefox/search-engines/</p>
<p><strong>Firefox 插件</strong><br />
Adblock Plus Firefox 必装插件，强大的拦截功能，可以拦截包括广告在内很多你不想看到的东西。<br />
Download Statusbar 接管Firefox 的下载功能，并把相关信息显示在状态栏。<br />
Firebug web development tools 之最，firefox 3 装最新的<a title="http://getfirebug.com/releases/firebug/1.2/firebug-1.2.0a25" href="http://getfirebug.com/releases/firebug/1.2/firebug-1.2.0a25X.xpi" target="_blank">firebug 1.2 Alphas</a> 1.0和1.1 对FF3 支持不好。<br />
<strong>Flash 乱码</strong><br />
<span style="font-size: small;"><span style="font-family: 宋体;">sudo mv /etc/fonts/conf.d/49-sansserif.conf /etc/fonts/conf.d/49-sansserif.conf.bak</span></span></p>
<p><strong>gFTP中文列表乱码</strong><br />
sudo vi /usr/bin/gftp<br />
在#!/bin/sh之后加上一行：<code>export LANG=zh_CN<br />
</code>sudo locale-gen zh_CN</p>
<p><strong>OpenOffice 优化</strong><br />
打开 OpenOffice 文字处理 ，菜单-&gt;工具-&gt;选项-&gt;内存：<br />
改撤销命令-&gt;步数为20<br />
改图形缓冲区-&gt;用于openoffice＝128m，每个对象的内存＝20m<br />
启用系统栏任务栏快速启动</p>
<p><strong>vim 设置<br />
</strong>我的系统默认没装vim所以先得装上<br />
sudo　apt-get install vim<br />
创建自己的vimrc（我的vimrc很简单只开启了最常用的一些功能做针对php 代码高亮）<br />
vi ~/.vimrc 内容为</p>
<p style="padding-left: 30px;"><span style="color: #808080;">set nocompatible<br />
set columns=80<br />
set tabstop=4<br />
set ruler<br />
set noexpandtab<br />
set number<br />
set ignorecase<br />
set wrapmargin=15<br />
set cindent<br />
set shiftwidth=4<br />
syntax on<br />
source $VIMRUNTIME/syntax/php.vim</span></p>
<p><strong>设置命令alias简化常用命令sudo操作</strong><br />
vi ~/.bashrc<br />
在该文件最后加入</p>
<p style="padding-left: 30px;"><span style="color: #888888;">alias s-apt-get=&#8217;sudo apt-get&#8217;<br />
alias s-rm=&#8217;sudo rm&#8217;<br />
alias s-cp=&#8217;sudo cp&#8217;<br />
alias s-vi=&#8217;sudo vim&#8217;</span></p>
<p>具体那些命令要做alias可以自己根据习惯设置。</p>
<h3  class="related_post_title">与本文关系暧昧的文字</h3><ul class="related_post"><li><a href="http://www.linuxbyte.org/vimperator-rang-ni-de-firefoxbian-cheng-vim.html" title="Vimperator-让你的Firefox变成Vim	">Vimperator-让你的Firefox变成Vim	</a></li><li><a href="http://www.linuxbyte.org/openoffice-optimization-tips.html" title="使 OpenOffice.org 运行更快的技巧">使 OpenOffice.org 运行更快的技巧</a></li><li><a href="http://www.linuxbyte.org/jie-jue-ubuntu-10-04lucid-firefox-man-de-wen-ti.html" title="解决 ubuntu 10.04(Lucid) Firefox 慢的问题">解决 ubuntu 10.04(Lucid) Firefox 慢的问题</a></li><li><a href="http://www.linuxbyte.org/firefox-de-shu-biao-shou-shi-cha-jian-firegestures.html" title="Firefox 的鼠标手势插件FireGestures">Firefox 的鼠标手势插件FireGestures</a></li><li><a href="http://www.linuxbyte.org/ubuntu-904-an-zhuang-pei-zhi-you-hua-quan-ji-lu.html" title="ubuntu 9.04 安装配置优化全记录">ubuntu 9.04 安装配置优化全记录</a></li><li><a href="http://www.linuxbyte.org/firefox-girl-wallpaper.html" title="Firefox Girl wallpaper">Firefox Girl wallpaper</a></li><li><a href="http://www.linuxbyte.org/vim-wallpaper.html" title="vim 学习壁纸">vim 学习壁纸</a></li><li><a href="http://www.linuxbyte.org/zhen-dui-webfu-wu-qi-zong-ti-you-hua.html" title="针对Web服务器总体优化">针对Web服务器总体优化</a></li></ul><hr />
<p><small>© xiao H for <a href="http://www.linuxbyte.org">LinuxByte</a>, 2008<br />
Source: <a href="http://www.linuxbyte.org/ubuntu-8_04-software-optimization.html">Ubuntu 8.04 下软件设置和优化</a><br />
<a href="http://www.linuxbyte.org/ubuntu-8_04-software-optimization.html#comments">No comment</a><br />
Post tags: <a href="http://www.linuxbyte.org/tag/firefox" rel="tag">firefox</a>, <a href="http://www.linuxbyte.org/tag/gftp" rel="tag">gftp</a>, <a href="http://www.linuxbyte.org/tag/openoffice" rel="tag">OpenOffice</a>, <a href="http://www.linuxbyte.org/tag/ubunut" rel="tag">ubunut</a>, <a href="http://www.linuxbyte.org/tag/vim" rel="tag">vim</a>, <a href="http://www.linuxbyte.org/tag/%e4%bc%98%e5%8c%96" rel="tag">优化</a><br/>
</small></p>
	标签：<a href="http://www.linuxbyte.org/tag/firefox" title="firefox" rel="tag">firefox</a>, <a href="http://www.linuxbyte.org/tag/gftp" title="gftp" rel="tag">gftp</a>, <a href="http://www.linuxbyte.org/tag/openoffice" title="OpenOffice" rel="tag">OpenOffice</a>, <a href="http://www.linuxbyte.org/tag/ubunut" title="ubunut" rel="tag">ubunut</a>, <a href="http://www.linuxbyte.org/tag/vim" title="vim" rel="tag">vim</a>, <a href="http://www.linuxbyte.org/tag/%e4%bc%98%e5%8c%96" title="优化" rel="tag">优化</a><br />

	<h4>相关日志</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.linuxbyte.org/openoffice-optimization-tips.html" title="使 OpenOffice.org 运行更快的技巧 (2008-03-02)">使 OpenOffice.org 运行更快的技巧</a> (0)</li>
	<li><a href="http://www.linuxbyte.org/vimperator-rang-ni-de-firefoxbian-cheng-vim.html" title="Vimperator-让你的Firefox变成Vim (2009-06-03)">Vimperator-让你的Firefox变成Vim</a> (1)</li>
	<li><a href="http://www.linuxbyte.org/zhen-dui-webfu-wu-qi-zong-ti-you-hua.html" title="针对Web服务器总体优化 (2008-06-07)">针对Web服务器总体优化</a> (0)</li>
	<li><a href="http://www.linuxbyte.org/jie-jue-ubuntu-10-04lucid-firefox-man-de-wen-ti.html" title="解决 ubuntu 10.04(Lucid) Firefox 慢的问题 (2010-05-02)">解决 ubuntu 10.04(Lucid) Firefox 慢的问题</a> (3)</li>
	<li><a href="http://www.linuxbyte.org/blogging-tools-cribefire.html" title="用ScribeFire 写blog (2008-02-21)">用ScribeFire 写blog</a> (1)</li>
</ul>


<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxbyte.org/ubuntu-8_04-software-optimization.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ubuntu 8.04 的设置和优化</title>
		<link>http://www.linuxbyte.org/ubuntu-804-de-she-zhi-he-you-hua.html</link>
		<comments>http://www.linuxbyte.org/ubuntu-804-de-she-zhi-he-you-hua.html#comments</comments>
		<pubDate>Sun, 04 May 2008 16:26:04 +0000</pubDate>
		<dc:creator>xiao H</dc:creator>
				<category><![CDATA[日常桌面]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[优化]]></category>

		<guid isPermaLink="false">http://www.linuxbyte.org/ubuntu-8_04-tips-and-optimization</guid>
		<description><![CDATA[安装ubuntu 8.04 已经好几天了，陆陆续续又做了些设置和优化，现在整理记录一下。
1. 换内核
系统默认的 kernel 2.6.24-16-generic，这个内核是通用内核没针对特定用户做过优化，而我的台式机还有... ]]></description>
			<content:encoded><![CDATA[<p>安装ubuntu 8.04 已经好几天了，陆陆续续又做了些设置和优化，现在整理记录一下。</p>
<p><strong>1. 换内核</strong><br />
系统默认的 kernel 2.6.24-16-generic，这个内核是通用内核没针对特定用户做过优化，而我的台式机还有一个更好的内核可以选，2.6.24-16-rt（realtime）<span class="postbody">这个内核的特点是任务抢占式，能大大加快 程序之间的启动时间跟切换时间。安装方法：<br />
sudo apt-get install linux-rt  </span></p>
<p><span id="more-125"></span></p>
<p><strong>2. 关闭IPv6</strong><br />
方法：<br />
编辑 /etc/modprobe.d/aliases<br />
修改<br />
alias net-pf-10 ipv6<br />
为<br />
alias net-pf-10 off</p>
<p>然后注释掉 /etc/hosts文件中所有与IPV6有关的内容<br />
# The following lines are desirable for IPv6 capable hosts<br />
#::1 ip6-localhost ip6-loopback<br />
#fe00::0 ip6-localnet<br />
#ff00::0 ip6-mcastprefix<br />
#ff02::1 ip6-allnodes<br />
#ff02::2 ip6-allrouters<br />
#ff02::3 ip6-allhosts</p>
<p>这将会禁止所有使用IPV6的网络接口。</p>
<p>再新建一个/etc/modprobe.d/bad_list文件，内容为：<br />
alias net-pf-10 off<br />
<strong>3. 优化apt 源</strong><br />
$cd /etc/apt<br />
$sudo su<br />
#mv sources.list sources.list-bak<br />
#sed -e &#8216;/^#/d&#8217; -e &#8217;s/deb-src/#deb-src/&#8217; sources.list-bak &gt; sources.list<br />
上面命令的结果是备份sources.list 为 sources.list-bak，同时去掉了sources.list 中的注释语句，再注释掉 deb-src目录。<br />
太多的注释语句看得我眼花缭乱，并且我也不需要软件的源码。</p>
<p><strong>4. 优化会话启动项</strong><br />
菜单系统－－首选项－－会话，去掉你不需要的服务。</p>
<p><a href="http://www.linuxbyte.org/uploads/2008/05/screenshot-2.png" title="ubuntu 会话设置" rel="lightbox[125]"><img src="http://www.linuxbyte.org/uploads/2008/05/screenshot-2.thumbnail.png" alt="ubuntu 会话设置" /></a></p>
<p><strong> 5.程序启动优化</strong><br />
使启动程序并行，加速启动过程。<br />
编辑 /etc/init.d/rc<br />
修改<br />
CONCURRENCY=none<br />
为:<br />
CONCURRENCY=shell<br />
小心别写错，错了就无法启动系统了。</p>
<p><strong>6.增加DNS cache<br />
</strong>dns cache<strong> </strong>dnsmasq 也是个不错的选择，但pdnsd 更小巧些，单机用这个就够了，而且也不是所有人都需要自己做cache的，我这里杭州网通的dns 服务器实在太慢了，才自己做cache 加快dns 解析速度的。<br />
sudo apt-get instll pdnsd 安装pdnsd<br />
编辑 /etc/pdnsd.conf 在 global 段下方加入</p>
<pre>server {ip="x.x.x.x"; /* 此处填你的第一个dns 服务器的 IP */

timeout=30;

interval=900;

uptest=none;

ping_timeout=500;

purge_cache=off;

caching=on;

}server {

ip="x.x.x.x"; /* 此处填你的第二个dns 服务器的 IP*/

timeout=30;

interval=900;

uptest=none;

ping_timeout=500;

purge_cache=off;

caching=on;

}</pre>
<p>编辑/etc/resolv.conf文件<br />
改第一行内容为 “nameserver 127.0.0.1”</p>
<p><strong>7.安装RAR压缩/解压缩程序</strong><br />
sudo apt-get install rar unrar<br />
做个软链接<br />
sudo ln -fs /usr/bin/rar /usr/bin/unrar<br />
这样，以后只要在命令行输入unrar，就可以解压或者压缩文件了，安装完成后，归档管理器也同时集成了rar组件。</p>
<p><strong>8.清理系统垃圾</strong><br />
sudo apt-get autoclean清理旧版本的软件缓存</p>
<p>sudo apt-get clean清理所有软件缓存</p>
<p>sudo apt-get autoremove删除系统不再使用的孤立软件</p>
<h3  class="related_post_title">与本文关系暧昧的文字</h3><ul class="related_post"><li><a href="http://www.linuxbyte.org/ubuntu-904-an-zhuang-pei-zhi-you-hua-quan-ji-lu.html" title="ubuntu 9.04 安装配置优化全记录">ubuntu 9.04 安装配置优化全记录</a></li><li><a href="http://www.linuxbyte.org/ubuntu-10-10-alpha-1-fa-bu.html" title="Ubuntu 10.10 Alpha 1 发布">Ubuntu 10.10 Alpha 1 发布</a></li><li><a href="http://www.linuxbyte.org/ubuntu-10-04-rc-fa-bu.html" title="Ubuntu 10.04 RC 发布">Ubuntu 10.04 RC 发布</a></li><li><a href="http://www.linuxbyte.org/ubuntu-10-04-xin-bi-zhi.html" title="Ubuntu 10.04 新壁纸">Ubuntu 10.04 新壁纸</a></li><li><a href="http://www.linuxbyte.org/ubuntu-9-10-ting-zhi-xi-tong-fu-wu.html" title="ubuntu 9.10 停止系统服务">ubuntu 9.10 停止系统服务</a></li><li><a href="http://www.linuxbyte.org/ubuntu-10-04-beta-1-fabu.html" title="Ubuntu 10.04 Beta 1 发布">Ubuntu 10.04 Beta 1 发布</a></li><li><a href="http://www.linuxbyte.org/ubuntu-9-10-an-zhuang-pei-zhi-xiao-ji.html" title="Ubuntu 9.10 安装配置小记">Ubuntu 9.10 安装配置小记</a></li><li><a href="http://www.linuxbyte.org/ubuntu-810-anzhuang-peizhi.html" title="ubuntu 8.10 安装配置小记">ubuntu 8.10 安装配置小记</a></li></ul><hr />
<p><small>© xiao H for <a href="http://www.linuxbyte.org">LinuxByte</a>, 2008<br />
Source: <a href="http://www.linuxbyte.org/ubuntu-804-de-she-zhi-he-you-hua.html">ubuntu 8.04 的设置和优化</a><br />
<a href="http://www.linuxbyte.org/ubuntu-804-de-she-zhi-he-you-hua.html#comments">One comment</a><br />
Post tags: <a href="http://www.linuxbyte.org/tag/ubuntu" rel="tag">Ubuntu</a>, <a href="http://www.linuxbyte.org/tag/%e4%bc%98%e5%8c%96" rel="tag">优化</a><br/>
</small></p>
	标签：<a href="http://www.linuxbyte.org/tag/ubuntu" title="Ubuntu" rel="tag">Ubuntu</a>, <a href="http://www.linuxbyte.org/tag/%e4%bc%98%e5%8c%96" title="优化" rel="tag">优化</a><br />

	<h4>相关日志</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.linuxbyte.org/ubuntu-904-an-zhuang-pei-zhi-you-hua-quan-ji-lu.html" title="ubuntu 9.04 安装配置优化全记录 (2009-05-09)">ubuntu 9.04 安装配置优化全记录</a> (3)</li>
	<li><a href="http://www.linuxbyte.org/zhen-dui-webfu-wu-qi-zong-ti-you-hua.html" title="针对Web服务器总体优化 (2008-06-07)">针对Web服务器总体优化</a> (0)</li>
	<li><a href="http://www.linuxbyte.org/install-ubuntu-8_0_4-from-harddisk.html" title="硬盘安装ubuntu 8.04 (2008-04-26)">硬盘安装ubuntu 8.04</a> (3)</li>
	<li><a href="http://www.linuxbyte.org/rescue-my-fedora9-with-ubuntu-livecd.html" title="用ubuntu liveCD 修复fedora9 的grub (2008-06-09)">用ubuntu liveCD 修复fedora9 的grub</a> (3)</li>
	<li><a href="http://www.linuxbyte.org/sexy-ubunut-girls-wallpapers.html" title="性感ubuntu 壁纸 (2008-04-05)">性感ubuntu 壁纸</a> (2)</li>
</ul>


<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxbyte.org/ubuntu-804-de-she-zhi-he-you-hua.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>使 OpenOffice.org 运行更快的技巧</title>
		<link>http://www.linuxbyte.org/openoffice-optimization-tips.html</link>
		<comments>http://www.linuxbyte.org/openoffice-optimization-tips.html#comments</comments>
		<pubDate>Sun, 02 Mar 2008 02:58:42 +0000</pubDate>
		<dc:creator>xiao H</dc:creator>
				<category><![CDATA[日常桌面]]></category>
		<category><![CDATA[OpenOffice]]></category>
		<category><![CDATA[优化]]></category>

		<guid isPermaLink="false">http://www.linuxbyte.org/openoffice-optimization-tips</guid>
		<description><![CDATA[OpenOffice.org 是目前在linux 下使用最多的办公工具，我也一直在用它。OpenOffice.org 除了继承了StarOffice强大功能之外还保留的JAVA 产品的一贯传统，慢！尤其是在启动的时候，不过总算还可以通过... ]]></description>
			<content:encoded><![CDATA[<p>OpenOffice.org 是目前在linux 下使用最多的办公工具，我也一直在用它。OpenOffice.org 除了继承了StarOffice强大功能之外还保留的JAVA 产品的一贯传统，慢！尤其是在启动的时候，不过总算还可以通过设置加速其启动。</p>
<p>启动 OpenOffice.org Writer，打开“工具-&gt;选项”菜单命令，选择左边的“内存”，进行如下设置：<br />
<span id="more-55"></span></p>
<ul>
<li>在“撤销”选项，步骤数目建议设置为 20 ，这个数值不大于 100。</li>
<li>在“图形缓存”选项，OpenOffice.org 使用设置为 128MB，每个对象的内存设置为 24MB。</li>
<li>在“插入对象缓存”选项，设置对象数为 20。</li>
<li>选中“启用快速启动”选项。</li>
</ul>
<p>然后，再选择左边的“Java”，去掉“使用 Java 运行环境”选项。最后点击“确定”保存设置。</p>
<h3  class="related_post_title">与本文关系暧昧的文字</h3><ul class="related_post"><li><a href="http://www.linuxbyte.org/ubuntu-8_04-software-optimization.html" title="Ubuntu 8.04 下软件设置和优化">Ubuntu 8.04 下软件设置和优化</a></li><li><a href="http://www.linuxbyte.org/ubuntu-904-an-zhuang-pei-zhi-you-hua-quan-ji-lu.html" title="ubuntu 9.04 安装配置优化全记录">ubuntu 9.04 安装配置优化全记录</a></li><li><a href="http://www.linuxbyte.org/zhen-dui-webfu-wu-qi-zong-ti-you-hua.html" title="针对Web服务器总体优化">针对Web服务器总体优化</a></li><li><a href="http://www.linuxbyte.org/ubuntu-804-de-she-zhi-he-you-hua.html" title="ubuntu 8.04 的设置和优化">ubuntu 8.04 的设置和优化</a></li><li><a href="http://www.linuxbyte.org/openoffice-org-240-rc3.html" title="OpenOffice.org 2.4.0 RC3">OpenOffice.org 2.4.0 RC3</a></li><li><a href="http://www.linuxbyte.org/the-openofficeorg-annual-conference-2008.html" title="OpenOffice.org年会举办地尘埃落地">OpenOffice.org年会举办地尘埃落地</a></li><li><a href="http://www.linuxbyte.org/optimization-mysql-database-under-high-load-server.html" title="linux高负载下彻底优化mysql数据库">linux高负载下彻底优化mysql数据库</a></li></ul><hr />
<p><small>© xiao H for <a href="http://www.linuxbyte.org">LinuxByte</a>, 2008<br />
Source: <a href="http://www.linuxbyte.org/openoffice-optimization-tips.html">使 OpenOffice.org 运行更快的技巧</a><br />
<a href="http://www.linuxbyte.org/openoffice-optimization-tips.html#comments">No comment</a><br />
Post tags: <a href="http://www.linuxbyte.org/tag/openoffice" rel="tag">OpenOffice</a>, <a href="http://www.linuxbyte.org/tag/%e4%bc%98%e5%8c%96" rel="tag">优化</a><br/>
</small></p>
	标签：<a href="http://www.linuxbyte.org/tag/openoffice" title="OpenOffice" rel="tag">OpenOffice</a>, <a href="http://www.linuxbyte.org/tag/%e4%bc%98%e5%8c%96" title="优化" rel="tag">优化</a><br />

	<h4>相关日志</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.linuxbyte.org/ubuntu-8_04-software-optimization.html" title="Ubuntu 8.04 下软件设置和优化 (2008-05-07)">Ubuntu 8.04 下软件设置和优化</a> (0)</li>
	<li><a href="http://www.linuxbyte.org/zhen-dui-webfu-wu-qi-zong-ti-you-hua.html" title="针对Web服务器总体优化 (2008-06-07)">针对Web服务器总体优化</a> (0)</li>
	<li><a href="http://www.linuxbyte.org/ubuntu-904-an-zhuang-pei-zhi-you-hua-quan-ji-lu.html" title="ubuntu 9.04 安装配置优化全记录 (2009-05-09)">ubuntu 9.04 安装配置优化全记录</a> (3)</li>
	<li><a href="http://www.linuxbyte.org/ubuntu-804-de-she-zhi-he-you-hua.html" title="ubuntu 8.04 的设置和优化 (2008-05-05)">ubuntu 8.04 的设置和优化</a> (1)</li>
	<li><a href="http://www.linuxbyte.org/the-openofficeorg-annual-conference-2008.html" title="OpenOffice.org年会举办地尘埃落地 (2008-03-04)">OpenOffice.org年会举办地尘埃落地</a> (0)</li>
</ul>


<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxbyte.org/openoffice-optimization-tips.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>linux高负载下彻底优化mysql数据库</title>
		<link>http://www.linuxbyte.org/optimization-mysql-database-under-high-load-server.html</link>
		<comments>http://www.linuxbyte.org/optimization-mysql-database-under-high-load-server.html#comments</comments>
		<pubDate>Tue, 26 Feb 2008 13:16:06 +0000</pubDate>
		<dc:creator>xiao H</dc:creator>
				<category><![CDATA[服务器应用]]></category>
		<category><![CDATA[精品文档]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[优化]]></category>
		<category><![CDATA[数据库]]></category>

		<guid isPermaLink="false">http://www.linuxbyte.org/optimization-mysql-database-under-high-load-server</guid>
		<description><![CDATA[作者：未知 来源：linuxsky.org
同时在线访问量继续增大 对于1G内存的服务器明显感觉到吃力严重时甚至每天都会死机 或者时不时的服务器卡一下 这个问题曾经困扰了我半个多月MySQL使用是很具... ]]></description>
			<content:encoded><![CDATA[<p id="message4838100" class="t_msgfont">作者：未知 来源：linuxsky.org</p>
<p class="t_msgfont">同时在线访问量继续增大 对于1G内存的服务器明显感觉到吃力严重时甚至每天都会死机 或者时不时的服务器卡一下 这个问题曾经困扰了我半个多月MySQL使用是很具伸缩性的算法，因此你通常能用很少的内存运行或给MySQL更多的被存以得到更好的性能。<br />
<span id="more-44"></span><br />
安装好mysql后，配制文件应该在/usr/local/mysql/share/mysql目录中，配制文件有几个，有my-huge.cnf my-medium.cnf my-large.cnf my-small.cnf,不同的流量的网站和不同配制的服务器环境，当然需要有不同的配制文件了。</p>
<p>一般的情况下，my-medium.cnf这个配制文件就能满足我们的大多需要；一般我们会把配置文件拷贝到/etc/my.cnf 只需要修改这个配置文件就可以了，使用mysqladmin variables extended-status –u root –p 可以看到目前的参数，有３个配置参数是最重要的，即key_buffer_size,query_cache_size,table_cache。</p>
<p>key_buffer_size只对MyISAM表起作用，</p>
<p>key_buffer_size指定索引缓冲区的大小，它决定索引处理的速度，尤其是索引读的速度。一般我们设为16M,实际上稍微大一点的站点　这个数字是远远不够的，通过检查状态值Key_read_requests和Key_reads,可以知道key_buffer_size设置是否合理。比例 key_reads / key_read_requests应该尽可能的低，至少是1:100，1:1000更好（上述状态值可以使用SHOW STATUS LIKE ‘key_read%’获得）。 或者如果你装了phpmyadmin 可以通过服务器运行状态看到,笔者推荐用phpmyadmin管理mysql，以下的状态值都是本人通过phpmyadmin获得的实例分析:</p>
<p>这个服务器已经运行了20天<br />
key_buffer_size – 128M<br />
key_read_requests – 650759289<br />
key_reads &#8211; 79112<br />
比例接近1:8000 健康状况非常好</p>
<p>另外一个估计key_buffer_size的办法　把你网站数据库的每个表的索引所占空间大小加起来看看以此服务器为例:比较大的几个表索引加起来大概125M 这个数字会随着表变大而变大。</p>
<p>从4.0.1开始，MySQL提供了查询缓冲机制。使用查询缓冲，MySQL将SELECT语句和查询结果存放在缓冲区中，今后对于同样的SELECT语句（区分大小写），将直接从缓冲区中读取结果。根据MySQL用户手册，使用查询缓冲最多可以达到238%的效率。</p>
<p>通过调节以下几个参数可以知道query_cache_size设置得是否合理<br />
Qcache inserts<br />
Qcache hits<br />
Qcache lowmem prunes<br />
Qcache free blocks<br />
Qcache total blocks</p>
<p>Qcache_lowmem_prunes的值非常大，则表明经常出现缓冲不够的情况,同时Qcache_hits的值非常大，则表明查询缓冲使用非常频繁，此时需要增加缓冲大小Qcache_hits的值不大，则表明你的查询重复率很低，这种情况下使用查询缓冲反而会影响效率，那么可以考虑不用查询缓冲。此外，在SELECT语句中加入SQL_NO_CACHE可以明确表示不使用查询缓冲。</p>
<p>Qcache_free_blocks，如果该值非常大，则表明缓冲区中碎片很多query_cache_type指定是否使用查询缓冲</p>
<p>我设置:<br />
query_cache_size = 32M<br />
query_cache_type= 1</p>
<p>得到如下状态值:<br />
Qcache queries in cache 12737 表明目前缓存的条数<br />
Qcache inserts 20649006<br />
Qcache hits 79060095 　看来重复查询率还挺高的<br />
Qcache lowmem prunes 617913　有这么多次出现缓存过低的情况<br />
Qcache not cached 189896 　　<br />
Qcache free memory 18573912　　目前剩余缓存空间<br />
Qcache free blocks 5328 这个数字似乎有点大　碎片不少<br />
Qcache total blocks 30953<br />
如果内存允许32M应该要往上加点</p>
<p>table_cache指定表高速缓存的大小。每当MySQL访问一个表时，如果在表缓冲区中还有空间，该表就被打开并放入其中，这样可以更快地访问表内容。通过检查峰值时间的状态值Open_tables和Opened_tables，可以决定是否需要增加table_cache的值。如果你发现 open_tables等于table_cache，并且opened_tables在不断增长，那么你就需要增加table_cache的值了（上述状态值可以使用SHOW STATUS LIKE ‘Open%tables’获得）。注意，不能盲目地把table_cache设置成很大的值。如果设置得太高，可能会造成文件描述符不足，从而造成性能不稳定或者连接失败。</p>
<p>对于有1G内存的机器，推荐值是128－256。</p>
<p>笔者设置<br />
table_cache = 256</p>
<p>得到以下状态:<br />
Open tables 256<br />
Opened tables 9046<br />
虽然open_tables已经等于table_cache，但是相对于服务器运行时间来说,已经运行了20天，opened_tables的值也非常低。因此，增加table_cache的值应该用处不大。如果运行了6个小时就出现上述值 那就要考虑增大table_cache。</p>
<p>如果你不需要记录2进制log 就把这个功能关掉，注意关掉以后就不能恢复出问题前的数据了，需要您手动备份，二进制日志包含所有更新数据的语句，其目的是在恢复数据库时用它来把数据尽可能恢复到最后的状态。另外，如果做同步复制( Replication )的话，也需要使用二进制日志传送修改情况。</p>
<p>log_bin指定日志文件，如果不提供文件名，MySQL将自己产生缺省文件名。MySQL会在文件名后面自动添加数字引，每次启动服务时，都会重新生成一个新的二进制文件。此外，使用log-bin-index可以指定索引文件；使用binlog-do-db可以指定记录的数据库；使用binlog- ignore-db可以指定不记录的数据库。注意的是：binlog-do-db和binlog-ignore-db一次只指定一个数据库，指定多个数据库需要多个语句。而且，MySQL会将所有的数据库名称改成小写，在指定数据库时必须全部使用小写名字，否则不会起作用。</p>
<p>关掉这个功能只需要在他前面加上#号<br />
#log-bin</p>
<p>开启慢查询日志( slow query log )</p>
<p>慢查询日志对于跟踪有问题的查询非常有用。它记录所有查过long_query_time的查询，如果需要，还可以记录不使用索引的记录。下面是一个慢查询日志的例子：</p>
<p>开启慢查询日志，需要设置参数log_slow_queries、long_query_times、log-queries-not-using-indexes。</p>
<p>log_slow_queries指定日志文件，如果不提供文件名，MySQL将自己产生缺省文件名。long_query_times指定慢查询的阈值，缺省是10秒。log-queries-not-using-indexes是4.1.0以后引入的参数，它指示记录不使用索引的查询。笔者设置 long_query_time=10</p>
<p>笔者设置:</p>
<p>sort_buffer_size = 1M<br />
max_connections=120<br />
wait_timeout =120<br />
back_log=100<br />
read_buffer_size = 1M<br />
thread_cache=32<br />
interactive_timeout=120<br />
thread_concurrency = 4</p>
<p>参数说明:</p>
<p>back_log<br />
要求MySQL能有的连接数量。当主要MySQL线程在一个很短时间内得到非常多的连接请求，这就起作用，然后主线程花些时间(尽管很短)检查连接并且启动一个新线程。back_log值指出在MySQL暂时停止回答新请求之前的短时间内多少个请求可以被存在堆栈中。只有如果期望在一个短时间内有很多连接，你需要增加它，换句话说，这值对到来的TCP/IP连接的侦听队列的大小。你的操作系统在这个队列大小上有它自己的限制。 Unix listen(2)系统调用的手册页应该有更多的细节。检查你的OS文档找出这个变量的最大值。试图设定back_log高于你的操作系统的限制将是无效的。</p>
<p>max_connections<br />
并发连接数目最大，120 超过这个值就会自动恢复，出了问题能自动解决</p>
<p>thread_cache<br />
没找到具体说明，不过设置为32后 20天才创建了400多个线程 而以前一天就创建了上千个线程 所以还是有用的</p>
<p>thread_concurrency<br />
#设置为你的cpu数目x2,例如，只有一个cpu,那么thread_concurrency=2<br />
#有2个cpu,那么thread_concurrency=4</p>
<p>skip-innodb<br />
#去掉innodb支持</p>
<h3  class="related_post_title">与本文关系暧昧的文字</h3><ul class="related_post"><li><a href="http://www.linuxbyte.org/mysql-slave-pei-zhi-bei-fen.html" title="mysql slave 配置备份">mysql slave 配置备份</a></li><li><a href="http://www.linuxbyte.org/my-cnf-master.html" title="mysql master 配置备份">mysql master 配置备份</a></li><li><a href="http://www.linuxbyte.org/yi-ge-mysql-server-shang-de-xiao-ji-qiao.html" title="一个 mysql server 上的小技巧">一个 mysql server 上的小技巧</a></li><li><a href="http://www.linuxbyte.org/centos-xia-an-zhuang-pei-zhi-powerdns.html" title="Centos 下安装配置 PowerDNS ">Centos 下安装配置 PowerDNS </a></li><li><a href="http://www.linuxbyte.org/jia-gu-wen-xiang-mysqlyong-hu-kai-fa-zhe-he-ke-hu-de-shi-xiang-cheng-nuo.html" title="甲骨文向MySQL用户、开发者和客户的十项承诺">甲骨文向MySQL用户、开发者和客户的十项承诺</a></li><li><a href="http://www.linuxbyte.org/ubuntu-904-an-zhuang-pei-zhi-you-hua-quan-ji-lu.html" title="ubuntu 9.04 安装配置优化全记录">ubuntu 9.04 安装配置优化全记录</a></li><li><a href="http://www.linuxbyte.org/zhen-dui-webfu-wu-qi-zong-ti-you-hua.html" title="针对Web服务器总体优化">针对Web服务器总体优化</a></li><li><a href="http://www.linuxbyte.org/ubuntu-8_04-software-optimization.html" title="Ubuntu 8.04 下软件设置和优化">Ubuntu 8.04 下软件设置和优化</a></li></ul><hr />
<p><small>© xiao H for <a href="http://www.linuxbyte.org">LinuxByte</a>, 2008<br />
Source: <a href="http://www.linuxbyte.org/optimization-mysql-database-under-high-load-server.html">linux高负载下彻底优化mysql数据库</a><br />
<a href="http://www.linuxbyte.org/optimization-mysql-database-under-high-load-server.html#comments">No comment</a><br />
Post tags: <a href="http://www.linuxbyte.org/tag/mysql" rel="tag">mysql</a>, <a href="http://www.linuxbyte.org/tag/%e4%bc%98%e5%8c%96" rel="tag">优化</a>, <a href="http://www.linuxbyte.org/tag/%e6%95%b0%e6%8d%ae%e5%ba%93" rel="tag">数据库</a><br/>
</small></p>
	标签：<a href="http://www.linuxbyte.org/tag/mysql" title="mysql" rel="tag">mysql</a>, <a href="http://www.linuxbyte.org/tag/%e4%bc%98%e5%8c%96" title="优化" rel="tag">优化</a>, <a href="http://www.linuxbyte.org/tag/%e6%95%b0%e6%8d%ae%e5%ba%93" title="数据库" rel="tag">数据库</a><br />

	<h4>相关日志</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.linuxbyte.org/zhen-dui-webfu-wu-qi-zong-ti-you-hua.html" title="针对Web服务器总体优化 (2008-06-07)">针对Web服务器总体优化</a> (0)</li>
	<li><a href="http://www.linuxbyte.org/jia-gu-wen-xiang-mysqlyong-hu-kai-fa-zhe-he-ke-hu-de-shi-xiang-cheng-nuo.html" title="甲骨文向MySQL用户、开发者和客户的十项承诺 (2009-12-15)">甲骨文向MySQL用户、开发者和客户的十项承诺</a> (0)</li>
	<li><a href="http://www.linuxbyte.org/openoffice-optimization-tips.html" title="使 OpenOffice.org 运行更快的技巧 (2008-03-02)">使 OpenOffice.org 运行更快的技巧</a> (0)</li>
	<li><a href="http://www.linuxbyte.org/yi-ge-mysql-server-shang-de-xiao-ji-qiao.html" title="一个 mysql server 上的小技巧 (2010-05-23)">一个 mysql server 上的小技巧</a> (0)</li>
	<li><a href="http://www.linuxbyte.org/what-to-tune-in-mysql-server-after-installation.html" title="What to tune in MySQL Server after installation (2008-03-25)">What to tune in MySQL Server after installation</a> (0)</li>
</ul>


<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxbyte.org/optimization-mysql-database-under-high-load-server.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
