<?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>Observer Life &#187; Unix/Linux</title>
	<atom:link href="http://observerlife.com/category/unixlinux/feed/" rel="self" type="application/rss+xml" />
	<link>http://observerlife.com</link>
	<description>To be a better man (Observer)</description>
	<lastBuildDate>Thu, 09 Sep 2010 14:10:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Mac OS X下常用软件</title>
		<link>http://observerlife.com/softwares-of-mac-os-x/</link>
		<comments>http://observerlife.com/softwares-of-mac-os-x/#comments</comments>
		<pubDate>Sun, 05 Sep 2010 03:25:41 +0000</pubDate>
		<dc:creator>ycg</dc:creator>
				<category><![CDATA[Focus]]></category>
		<category><![CDATA[Unix/Linux]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[vpn]]></category>

		<guid isPermaLink="false">http://observerlife.com/?p=694</guid>
		<description><![CDATA[最近一直在用着Mac本本，从用了3天开始，我就已经深深地喜欢上Mac了。各种操作，就是那么自然，恩，就是自然，不用脑子去想就OK的。废话不多说，这里主要是整理一下我这段时间以来在Mac下常用的软件，备份一下，给自己未来的新本本做准备。 EverNote，这是我第一推荐的软件。同步笔记，不光支持文本内容，也支持图片、音频资料，而且一定存储量之前免费。以前在Windows下常用的是Office系列中的OneNote，很方便。不过惟一的缺点是不支持网络同步。 Chrome，虽然Safari非常好用，不过因为长久的习惯及数据迁移的考虑，我还是选择了Chrome, Firefox只做网站测试之用，Safari则比较少用到了。 iWork，Apple出的与Office相对应的文字、表格、PPT处理软件。相同的软件有MS出的Office for Mac,不过iWork用起来还是习惯一些。OpenOffice这些则没在考虑之列，完全是因为不习惯。 OmniGraffle，画流程图、架构图，甚至是思维脑图，这个软件都会给你提供足够的支持。类似于Office系列的Visio，甚至更强大。 Tunnelblick，Mac下翻墙必备。不须多说。 SecureCRT for Mac, SecureCRT是Windows下最为强大的SSH软件，8月4日刚刚推出了Mac下的Beta版。配合着，我也会使用系统自带的Terminal。 Brew, Mac下的包管理软件，类似于FreeBSD下的ports, Gentoo下的emerge。会给我们省去不少在网络上寻找软件的时间。 MySQLWorkbench,工作关系，经常需要对数据库进行查看处理。这是MySQL自己出的MySQL表设计、管理的软件。这个软件推荐度不高，因为我还是更习惯命令行下的操作。MySQLWorkbench在查询数据的时候，会有一些小方便。 Adium，Mac下可用的支持多种协议的IM软件，MSN, QQ, Gtalk，全都能够支持到。目前我只是用来登陆MSN, 唯一的缺点是原生的在对MSN群的支持不够好，不能显示群用户的昵称。 目前需要记录的，就是这些。这里边多是工作关系比较紧密的，生活娱乐方面的工具，自带软件已经满足了大部分需求，如果有更新，以后看情况再进行更新。 Related Posts:words to share &#8212; series 2减少协议可提升Vista网络性能10个Firefox最佳插件words to share &#8211; series 3words to share &#8211; series 1]]></description>
			<content:encoded><![CDATA[<p>最近一直在用着Mac本本，从用了3天开始，我就已经深深地喜欢上Mac了。各种操作，就是那么自然，恩，就是自然，不用脑子去想就OK的。废话不多说，这里主要是整理一下我这段时间以来在Mac下常用的软件，备份一下，给自己未来的新本本做准备。</p>
<ol>
<li><a href="http://www.evernote.com/" target="_blank">EverNote</a>，这是我第一推荐的软件。同步笔记，不光支持文本内容，也支持图片、音频资料，而且一定存储量之前免费。以前在Windows下常用的是Office系列中的OneNote，很方便。不过惟一的缺点是不支持网络同步。</li>
<li><a href="http://www.google.com/chrome/intl/en/landing_chrome_mac.html?hl=en" target="_blank">Chrome</a>，虽然Safari非常好用，不过因为长久的习惯及数据迁移的考虑，我还是选择了Chrome, Firefox只做网站测试之用，Safari则比较少用到了。</li>
<li><a href="http://www.apple.com/iwork/" target="_blank">iWork</a>，Apple出的与Office相对应的文字、表格、PPT处理软件。相同的软件有MS出的Office for Mac,不过iWork用起来还是习惯一些。OpenOffice这些则没在考虑之列，完全是因为不习惯。</li>
<li><a href="http://www.omnigroup.com/products/omnigraffle/" target="_blank">OmniGraffle</a>，画流程图、架构图，甚至是思维脑图，这个软件都会给你提供足够的支持。类似于Office系列的Visio，甚至更强大。</li>
<li><a href="http://code.google.com/p/tunnelblick/" target="_blank">Tunnelblick</a>，Mac下翻墙必备。不须多说。</li>
<li><a href="http://www.vandyke.com/products/beta/securecrt/mac_osx.html" target="_blank">SecureCRT for Mac</a>, SecureCRT是Windows下最为强大的SSH软件，8月4日刚刚推出了Mac下的Beta版。配合着，我也会使用系统自带的Terminal。</li>
<li><a href="http://github.com/mxcl/homebrew" target="_blank">Brew</a>, Mac下的包管理软件，类似于FreeBSD下的ports, Gentoo下的emerge。会给我们省去不少在网络上寻找软件的时间。</li>
<li><a href="http://wb.mysql.com/" target="_blank">MySQLWorkbench</a>,工作关系，经常需要对数据库进行查看处理。这是MySQL自己出的MySQL表设计、管理的软件。这个软件推荐度不高，因为我还是更习惯命令行下的操作。MySQLWorkbench在查询数据的时候，会有一些小方便。</li>
<li><a href="http://adium.im/" target="_blank">Adium</a>，Mac下可用的支持多种协议的IM软件，MSN, QQ, Gtalk，全都能够支持到。目前我只是用来登陆MSN, 唯一的缺点是原生的在对MSN群的支持不够好，不能显示群用户的昵称。</li>
</ol>
<p>目前需要记录的，就是这些。这里边多是工作关系比较紧密的，生活娱乐方面的工具，自带软件已经满足了大部分需求，如果有更新，以后看情况再进行更新。</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://observerlife.com/words-to-share-series-2/" rel="bookmark" class="crp_title">words to share &#8212; series 2</a></li><li><a href="http://observerlife.com/%e5%87%8f%e5%b0%91%e5%8d%8f%e8%ae%ae%e5%8f%af%e6%8f%90%e5%8d%87vista%e7%bd%91%e7%bb%9c%e6%80%a7%e8%83%bd/" rel="bookmark" class="crp_title">减少协议可提升Vista网络性能</a></li><li><a href="http://observerlife.com/10-firefox-best-addons/" rel="bookmark" class="crp_title">10个Firefox最佳插件</a></li><li><a href="http://observerlife.com/words-to-share-series-3/" rel="bookmark" class="crp_title">words to share &#8211; series 3</a></li><li><a href="http://observerlife.com/words-to-share-series-1/" rel="bookmark" class="crp_title">words to share &#8211; series 1</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://observerlife.com/softwares-of-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Memcached最大缓存时间</title>
		<link>http://observerlife.com/the-max-expires-time-of-memcached/</link>
		<comments>http://observerlife.com/the-max-expires-time-of-memcached/#comments</comments>
		<pubDate>Fri, 27 Aug 2010 04:57:27 +0000</pubDate>
		<dc:creator>ycg</dc:creator>
				<category><![CDATA[Unix/Linux]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[memcached]]></category>

		<guid isPermaLink="false">http://observerlife.com/?p=692</guid>
		<description><![CDATA[首先要说，这是个BT的问题，以前还真少想过。先说我遇到的问题吧。 我看到的一行代码里，Memcached的缓存时间被设置为86400*24*4, 等于是96天。而当调用set去存储的时候，memcached会返回true。而当你用get的时候，就是相反的结果了: FALSE。 要说BT呢，因为用到Memcached的人，通常不会去给缓存96天，这种情况下，更好的选择是DB、filecache或者其他。尽管BT，我还是去测试了一下最长时间，得到的结果是: 30 days。去memcached源码里查了一下，这下就明白多了： #define REALTIME_MAXDELTA 60*60*24*30 /* * given time value that&#8217;s either unix time or delta from current unix time, return * unix time. Use the fact that delta can&#8217;t exceed one month (and real time value can&#8217;t * be that low). */ static rel_time_t realtime(const time_t exptime) { /* [...]]]></description>
			<content:encoded><![CDATA[<p>首先要说，这是个BT的问题，以前还真少想过。先说我遇到的问题吧。</p>
<p>我看到的一行代码里，Memcached的缓存时间被设置为86400*24*4, 等于是96天。而当调用set去存储的时候，memcached会返回true。而当你用get的时候，就是相反的结果了: <strong>FALSE</strong>。</p>
<p>要说BT呢，因为用到Memcached的人，通常不会去给缓存96天，这种情况下，更好的选择是DB、filecache或者其他。尽管BT，我还是去测试了一下最长时间，得到的结果是: 30 days。去memcached源码里查了一下，这下就明白多了：</p>
<blockquote>
<div id="_mcePaste">#define REALTIME_MAXDELTA 60*60*24*30</div>
<div id="_mcePaste"></div>
<div id="_mcePaste">/*</div>
<div id="_mcePaste">* given time value that&#8217;s either unix time or delta from current unix time, return</div>
<div id="_mcePaste">* unix time. Use the fact that delta can&#8217;t exceed one month (and real time value can&#8217;t</div>
<div id="_mcePaste">* be that low).</div>
<div id="_mcePaste">*/</div>
<div id="_mcePaste">static rel_time_t realtime(const time_t exptime) {</div>
<div id="_mcePaste">/* no. of seconds in 30 days &#8211; largest possible delta exptime */</div>
<div id="_mcePaste"></div>
<div id="_mcePaste">if (exptime == 0) return 0; /* 0 means never expire */</div>
<div id="_mcePaste"></div>
<div id="_mcePaste">if (exptime &gt; REALTIME_MAXDELTA) {</div>
<div id="_mcePaste">/* if item expiration is at/before the server started, give it an</div>
<div id="_mcePaste">expiration time of 1 second after the server started.</div>
<div id="_mcePaste">(because 0 means don&#8217;t expire).  without this, we&#8217;d</div>
<div id="_mcePaste">underflow and wrap around to some large value way in the</div>
<div id="_mcePaste">future, effectively making items expiring in the past</div>
<div id="_mcePaste">really expiring never */</div>
<div id="_mcePaste">if (exptime &lt;= process_started)</div>
<div id="_mcePaste">return (rel_time_t)1;</div>
<div id="_mcePaste">return (rel_time_t)(exptime &#8211; process_started);</div>
<div id="_mcePaste">} else {</div>
<div id="_mcePaste">return (rel_time_t)(exptime + current_time);</div>
<div id="_mcePaste">}</div>
<div id="_mcePaste">}</div>
<div></div>
</blockquote>
<div>Memcached最大缓存时间为30d, 而且从实际应用上，这么变态的时间也已经足够了。</div>
<div></div>
<div>看源代码是终极办法啊。</div>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://observerlife.com/happy-man-ha/" rel="bookmark" class="crp_title">面朝大海，春暖花开</a></li><li><a href="http://observerlife.com/%e4%b8%80%e9%94%ae%e5%be%ae%e5%8d%9a%e5%a4%87%e4%bb%bd%e5%88%b0wordpress-wp-tsina%e5%be%ae%e5%8d%9a%e6%8f%92%e4%bb%b60-2-0%e5%8f%91%e5%b8%83/" rel="bookmark" class="crp_title">一键微博备份到WordPress &#8211; WP-Tsina微博插件0.2.0发布</a></li><li><a href="http://observerlife.com/time-and-space-optimization/" rel="bookmark" class="crp_title">Time and space optimization</a></li><li><a href="http://observerlife.com/%e5%85%b3%e4%ba%8eapache%e7%9a%84timeout/" rel="bookmark" class="crp_title">关于Apache的TimeOut</a></li><li><a href="http://observerlife.com/remember-the-name/" rel="bookmark" class="crp_title">Remember The Name</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://observerlife.com/the-max-expires-time-of-memcached/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>VIM自动化更新脚本推荐:vimana</title>
		<link>http://observerlife.com/vimana/</link>
		<comments>http://observerlife.com/vimana/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 13:40:29 +0000</pubDate>
		<dc:creator>ycg</dc:creator>
				<category><![CDATA[Unix/Linux]]></category>
		<category><![CDATA[vim]]></category>
		<category><![CDATA[vimana]]></category>

		<guid isPermaLink="false">http://observerlife.com/?p=687</guid>
		<description><![CDATA[很多人会觉得VIM是个非常好的Editor，也有很多人因为黑色的界面而对VIM充满了向往。但很多的人，或者说，大部分上述的人都因为VIM上手过程中频繁的配置，不停的去下载并安装plugin, 来回的修改vimrc文件等等等等，在过了几分热情之后，就渐渐对VIM说baybay了。 今天给大家推荐一个由一位来自台湾的兄弟林佑安(翻墙)开发维护的Vimana，这是一个安装以后，可以自动搜索、下载、安装并配置VIM插件好东东。省得大家到处去找寻了。这是一个Perl编写的东东，所以安装的时候，需要先确定机器里安装了Perl，然后在CPAN下安装(如果你不知道Perl和CPAN，google之)。具体安装与介绍，请参看下面的keynote. 这里面不光是介绍了这个Vimana，事实上主体不是这个，而是介绍了相当的VIM使用技巧，有兴趣的可以认真关注一下，E文的，不过不难的。 PS: VIM 7.3发布了，有兴趣的可以下载来试用一下: ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2。下午的时候我已经在单位的开发机上和Mac上都装上了，我还在体验中。下午郁闷的是，编译的时候居然忘记加multibyte支持，还在twitter上发牢骚说不对中文支持不行了呢。看来这段关注点的变化导致自己有些神经已经退化了。 Perl.Hacks.On.Vim View more presentations from Cornelius Lin. Related Posts:[share]State of the Mobile BrowsersDid You Know?Bcastr 3.1 flash 通用图片轮换播放器一段可以避过一般拦截程序的弹出窗口代码《士兵突击》里钢七连连歌]]></description>
			<content:encoded><![CDATA[<div>
很多人会觉得VIM是个非常好的Editor，也有很多人因为黑色的界面而对VIM充满了向往。但很多的人，或者说，大部分上述的人都因为VIM上手过程中频繁的配置，不停的去下载并安装plugin, 来回的修改vimrc文件等等等等，在过了几分热情之后，就渐渐对VIM说baybay了。</div>
<div>
<div id="attachment_689" class="wp-caption aligncenter" style="width: 610px"><a href="http://observerlife.com/wp-content/uploads/2010/08/learning_curves.jpg"><img class="size-full wp-image-689" title="各大编辑器或IDE学习成本曲线" src="http://observerlife.com/wp-content/uploads/2010/08/learning_curves.jpg" alt="各大编辑器或IDE学习成本曲线" width="600" height="400" /></a><p class="wp-caption-text">各大编辑器或IDE学习成本曲线</p></div>
</div>
<div>今天给大家推荐一个由一位来自台湾的兄弟<a href="http://c9s.blogspot.com/" target="_blank">林佑安</a>(翻墙)开发维护的<a href="http://search.cpan.org/dist/Vimana/" target="_blank">Vimana</a>，这是一个安装以后，可以自动搜索、下载、安装并配置VIM插件好东东。省得大家到处去找寻了。这是一个Perl编写的东东，所以安装的时候，需要先确定机器里安装了Perl，然后在CPAN下安装(如果你不知道Perl和CPAN，google之)。具体安装与介绍，请参看下面的keynote. 这里面不光是介绍了这个Vimana，事实上主体不是这个，而是介绍了相当的VIM使用技巧，有兴趣的可以认真关注一下，E文的，不过不难的。</div>
<div>PS: VIM 7.3发布了，有兴趣的可以下载来试用一下: <a href="ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2" target="_blank">ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2</a>。下午的时候我已经在单位的开发机上和Mac上都装上了，我还在体验中。下午郁闷的是，编译的时候居然忘记加multibyte支持，还在twitter上发牢骚说不对中文支持不行了呢。看来这段关注点的变化导致自己有些神经已经退化了。</div>
<div id="__ss_1981451" style="width: 425px;"><strong><a title="Perl.Hacks.On.Vim" href="http://www.slideshare.net/c9s/perlhacksonvim">Perl.Hacks.On.Vim</a></strong><object id="__sse1981451" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=perl-hacks-on-vim-090910214743-phpapp02&amp;stripped_title=perlhacksonvim" /><param name="name" value="__sse1981451" /><param name="allowfullscreen" value="true" /><embed id="__sse1981451" type="application/x-shockwave-flash" width="425" height="355" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=perl-hacks-on-vim-090910214743-phpapp02&amp;stripped_title=perlhacksonvim" name="__sse1981451" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<div style="padding: 5px 0 12px;">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/c9s">Cornelius Lin</a>.</div>
</div>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://observerlife.com/sharestate-of-the-mobile-browsers/" rel="bookmark" class="crp_title">[share]State of the Mobile Browsers</a></li><li><a href="http://observerlife.com/did-you-know/" rel="bookmark" class="crp_title">Did You Know?</a></li><li><a href="http://observerlife.com/bcastr-3-1-flash-%e9%80%9a%e7%94%a8%e5%9b%be%e7%89%87%e8%bd%ae%e6%8d%a2%e6%92%ad%e6%94%be%e5%99%a8/" rel="bookmark" class="crp_title">Bcastr 3.1 flash 通用图片轮换播放器</a></li><li><a href="http://observerlife.com/%e4%b8%80%e6%ae%b5%e5%8f%af%e4%bb%a5%e9%81%bf%e8%bf%87%e4%b8%80%e8%88%ac%e6%8b%a6%e6%88%aa%e7%a8%8b%e5%ba%8f%e7%9a%84%e5%bc%b9%e5%87%ba%e7%aa%97%e5%8f%a3%e4%bb%a3%e7%a0%81/" rel="bookmark" class="crp_title">一段可以避过一般拦截程序的弹出窗口代码</a></li><li><a href="http://observerlife.com/%e3%80%8a%e5%a3%ab%e5%85%b5%e7%aa%81%e5%87%bb%e3%80%8b%e9%87%8c%e9%92%a2%e4%b8%83%e8%bf%9e%e8%bf%9e%e6%ad%8c/" rel="bookmark" class="crp_title">《士兵突击》里钢七连连歌</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://observerlife.com/vimana/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dell 2950服务器加6块硬盘故障</title>
		<link>http://observerlife.com/dell-2950%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%8a%a06%e5%9d%97%e7%a1%ac%e7%9b%98%e6%95%85%e9%9a%9c/</link>
		<comments>http://observerlife.com/dell-2950%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%8a%a06%e5%9d%97%e7%a1%ac%e7%9b%98%e6%95%85%e9%9a%9c/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 19:30:59 +0000</pubDate>
		<dc:creator>ycg</dc:creator>
				<category><![CDATA[Unix/Linux]]></category>
		<category><![CDATA[2950]]></category>
		<category><![CDATA[dell]]></category>
		<category><![CDATA[故障]]></category>
		<category><![CDATA[硬盘]]></category>

		<guid isPermaLink="false">http://www.kedy.cn/blog/?p=400</guid>
		<description><![CDATA[临近五一节日，估计所有的运维都一样，会紧张服务器的假期表现，并在节前的这些天里为此做许多的准备，以求尽可能能够实实在在的享用这个假期。其实每个假期都是这样的。我也不例外，虽然不是专职运维。不过有时候就这样，最担心什么事就会出什么事。这不，刚去机房加了机器，然后故障就来了。 Dell PowerEdge2950 II机器，当加到6块硬盘的时候，服务器就会出现报警，dmesg一下，发现硬盘报警，系统报Input/Output Error，重启后message文件里有如下内容： [attach=21] 网上查了查，这种故障通常出现在USB设备上，我这台2950是内置了PERC 5i的Raid卡，出这种故障着实不明白。后来有朋友提醒到他们曾经遇到过类似的问题，同样是2950，当时是加了6块盘，只认出3块来，相比之下我这种情况还属于好的呢。Dell官方也没有给出类似问题的解决方法，先去机房把新加的硬盘拆下来换到柜子上试试，重启，OK了。 来不及细想了，先放心一下，启动机器，启动服务，回来慢慢再查这个问题吧。 如果你也曾遇到过类似的问题，或者有好的解决方案，请共享一下。 Related Posts:国安vs申花 2:3&#8211;郁闷上两张拆键盘的图记住这个日子-1937-12-13sablog-x1.6到WordPress2.3.2数据转换程序sablog-x到wordpress数据转换程序&#8211;更正版]]></description>
			<content:encoded><![CDATA[<p>临近五一节日，估计所有的运维都一样，会紧张服务器的假期表现，并在节前的这些天里为此做许多的准备，以求尽可能能够实实在在的享用这个假期。其实每个假期都是这样的。我也不例外，虽然不是专职运维。不过有时候就这样，最担心什么事就会出什么事。这不，刚去机房加了机器，然后故障就来了。</p>
<p>Dell PowerEdge2950 II机器，当加到6块硬盘的时候，服务器就会出现报警，dmesg一下，发现硬盘报警，系统报Input/Output Error，重启后message文件里有如下内容：<br />
[attach=21]</p>
<p>网上查了查，这种故障通常出现在USB设备上，我这台2950是内置了PERC 5i的Raid卡，出这种故障着实不明白。后来有朋友提醒到他们曾经遇到过类似的问题，同样是2950，当时是加了6块盘，只认出3块来，相比之下我这种情况还属于好的呢。Dell官方也没有给出类似问题的解决方法，先去机房把新加的硬盘拆下来换到柜子上试试，重启，OK了。<br />
来不及细想了，先放心一下，启动机器，启动服务，回来慢慢再查这个问题吧。</p>
<p>如果你也曾遇到过类似的问题，或者有好的解决方案，请共享一下。</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://observerlife.com/%e5%9b%bd%e5%ae%89vs%e7%94%b3%e8%8a%b1-23-%e9%83%81%e9%97%b7/" rel="bookmark" class="crp_title">国安vs申花 2:3&#8211;郁闷</a></li><li><a href="http://observerlife.com/%e4%b8%8a%e4%b8%a4%e5%bc%a0%e6%8b%86%e9%94%ae%e7%9b%98%e7%9a%84%e5%9b%be/" rel="bookmark" class="crp_title">上两张拆键盘的图</a></li><li><a href="http://observerlife.com/%e8%ae%b0%e4%bd%8f%e8%bf%99%e4%b8%aa%e6%97%a5%e5%ad%90-1937-12-13/" rel="bookmark" class="crp_title">记住这个日子-1937-12-13</a></li><li><a href="http://observerlife.com/sablog-x1-6%e5%88%b0wordpress2-3-2%e6%95%b0%e6%8d%ae%e8%bd%ac%e6%8d%a2%e7%a8%8b%e5%ba%8f/" rel="bookmark" class="crp_title">sablog-x1.6到WordPress2.3.2数据转换程序</a></li><li><a href="http://observerlife.com/sablog-x%e5%88%b0wordpress%e6%95%b0%e6%8d%ae%e8%bd%ac%e6%8d%a2%e7%a8%8b%e5%ba%8f-%e6%9b%b4%e6%ad%a3%e7%89%88/" rel="bookmark" class="crp_title">sablog-x到wordpress数据转换程序&#8211;更正版</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://observerlife.com/dell-2950%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%8a%a06%e5%9d%97%e7%a1%ac%e7%9b%98%e6%95%85%e9%9a%9c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>client closed prematurely connection, so upstream connection is closed too</title>
		<link>http://observerlife.com/client-closed-prematurely-connection-so-upstream-connection-is-closed-too/</link>
		<comments>http://observerlife.com/client-closed-prematurely-connection-so-upstream-connection-is-closed-too/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 01:50:29 +0000</pubDate>
		<dc:creator>ycg</dc:creator>
				<category><![CDATA[Unix/Linux]]></category>
		<category><![CDATA[499]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://www.kedy.cn/blog/?p=398</guid>
		<description><![CDATA[&#160;&#160;&#160;&#160;&#160;&#160; 郁闷的Nginx，现在文档还是比较少，官方的wiki里虽然有不少资料，不过还是不够全。 &#160;&#160;&#160;&#160;&#160;&#160; 好了，回归正题，今天在做一个小项目的时候，再次遇到Nginx经常会出现499状态的问题，表现是页面第一次能打开，第二次就打不开了。Nginx的日志里报如下错误： &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; client closed prematurely connection, so upstream connection is closed too &#160;&#160;&#160;&#160;&#160;&#160;&#160; 而且这个问题，在Firefox下不存在，只有在IE的时候才会出现。 &#160;&#160;&#160;&#160;&#160;&#160;&#160; HTTP状态码是499，查了查Nginx的源代码，如下： &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; #define NGX_HTTP_CLIENT_CLOSED_REQUEST 499 &#160;&#160;&#160;&#160;&#160;&#160;&#160; 网上搜索到的情况不少，不过没有一个说到正确的解释的。于是还是自己来试吧。修改了好多地方，不见效果，后来对比另外一台机器的配置，增加了个 charset的设置，然后奇迹般的OK了。老实说，到现在也没搞明白到底是为什么。我猜的是：因为小项目，页面编码设置可能不是太规范，所以可能会有这 个问题，导致IE6在识别不正确的情况下，会用非正确编码(当时我是UTF-8)之外的编码来处理，因为长度不同，所以可能就提前关闭了连接。好像在 Apache下还没有遇到过这种情况。也不知道应该说IE6的不是呢？还是说Nginx的不是呢？ Related Posts:心本无声音尽有2009年的元宵节&#8230;中《士兵突击》的“毒”的主要症状 看你有几条？？我的2006国安vs申花 2:3&#8211;郁闷]]></description>
			<content:encoded><![CDATA[<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 郁闷的Nginx，现在文档还是比较少，<a href="http://wiki.nginx.org" target="_blank">官方的wiki</a>里虽然有不少资料，不过还是不够全。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 好了，回归正题，今天在做一个小项目的时候，再次遇到Nginx经常会出现499状态的问题，表现是页面第一次能打开，第二次就打不开了。Nginx的日志里报如下错误：<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; client closed prematurely connection, so upstream connection is closed too<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 而且这个问题，在Firefox下不存在，只有在IE的时候才会出现。 <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HTTP状态码是499，查了查Nginx的源代码，如下：<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #define NGX_HTTP_CLIENT_CLOSED_REQUEST     <strong>499</strong><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 网上搜索到的情况不少，不过没有一个说到正确的解释的。于是还是自己来试吧。修改了好多地方，不见效果，后来对比另外一台机器的配置，增加了个 charset的设置，然后奇迹般的OK了。老实说，到现在也没搞明白到底是为什么。我猜的是：因为小项目，页面编码设置可能不是太规范，所以可能会有这 个问题，导致IE6在识别不正确的情况下，会用非正确编码(当时我是UTF-8)之外的编码来处理，因为长度不同，所以可能就提前关闭了连接。好像在 Apache下还没有遇到过这种情况。也不知道应该说IE6的不是呢？还是说Nginx的不是呢？</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://observerlife.com/%e5%bf%83%e6%9c%ac%e6%97%a0%e5%a3%b0%e9%9f%b3%e5%b0%bd%e6%9c%89/" rel="bookmark" class="crp_title">心本无声音尽有</a></li><li><a href="http://observerlife.com/2009%e5%b9%b4%e7%9a%84%e5%85%83%e5%ae%b5%e8%8a%82/" rel="bookmark" class="crp_title">2009年的元宵节&#8230;</a></li><li><a href="http://observerlife.com/%e4%b8%ad%e3%80%8a%e5%a3%ab%e5%85%b5%e7%aa%81%e5%87%bb%e3%80%8b%e7%9a%84%e2%80%9c%e6%af%92%e2%80%9d%e7%9a%84%e4%b8%bb%e8%a6%81%e7%97%87%e7%8a%b6-%e7%9c%8b%e4%bd%a0%e6%9c%89%e5%87%a0%e6%9d%a1%ef%bc%9f/" rel="bookmark" class="crp_title">中《士兵突击》的“毒”的主要症状 看你有几条？？</a></li><li><a href="http://observerlife.com/%e6%88%91%e7%9a%842006/" rel="bookmark" class="crp_title">我的2006</a></li><li><a href="http://observerlife.com/%e5%9b%bd%e5%ae%89vs%e7%94%b3%e8%8a%b1-23-%e9%83%81%e9%97%b7/" rel="bookmark" class="crp_title">国安vs申花 2:3&#8211;郁闷</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://observerlife.com/client-closed-prematurely-connection-so-upstream-connection-is-closed-too/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOWTO Gmail and sSMTP</title>
		<link>http://observerlife.com/howto-gmail-and-ssmtp/</link>
		<comments>http://observerlife.com/howto-gmail-and-ssmtp/#comments</comments>
		<pubDate>Tue, 29 Jul 2008 19:24:36 +0000</pubDate>
		<dc:creator>ycg</dc:creator>
				<category><![CDATA[Unix/Linux]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[ssmtp]]></category>

		<guid isPermaLink="false">http://www.kedy.cn/blog/?p=380</guid>
		<description><![CDATA[Installation To get this running, I followed the documents @ the bottom of this post. Here&#8217;s the condensed version: ## note that the following just enables mailwrapper in ssmtp ## this is &#34;to allow multiple MTAs to be installed&#34;. So if one is already using ssmtp one shant need that use flag.# echo &#34;mail-mta/ssmtp mailwrapper&#34; [...]]]></description>
			<content:encoded><![CDATA[<h2><span class="mw-headline">Installation </span></h2>
<p>To get this running, I followed the documents @ the bottom of this post. Here&#8217;s the condensed version:</p>
<pre>## note that the following just enables mailwrapper in ssmtp ## this is &quot;to allow multiple MTAs to be installed&quot;.  So if one is already using ssmtp one shant need that use flag.# echo &quot;mail-mta/ssmtp mailwrapper&quot; &gt;&gt; /etc/portage/package.use# emerge ssmtp</pre>
<p>In /etc/ssmtp/ssmtp.conf, set the following:</p>
<pre>root=youraccount@gmail.commailhub=smtp.gmail.com:587rewriteDomain=hostname=smtp.gmail.com:587UseSTARTTLS=YESAuthUser=youraccountAuthPass=yourpaswordFromLineOverride=YES # optional</pre>
<p>In /etc/ssmtp/revaliases:</p>
<pre>root:youraccount@gmail.com:smtp.gmail.com:587mainuser:youraccount@gmail.com:smtp.gmail.com:587</pre>
<p><a name="Usage"></a></p>
<h2><span class="mw-headline">Usage </span></h2>
<p>Install mailx (the package that contains /bin/mail):</p>
<pre># emerge mailx</pre>
<p>Test with:</p>
<pre>$ mail user@domain.tldTo: user@domain.tldFrom: ssmtp@localhostSubject: sSMTP test

Message body.&lt;Ctrl+D&gt;</pre>
<p>Check the remote account (user@domain.tld) to make sure the mail arrived.</p>
<p><a name="Troubleshooting"></a></p>
<h2><span class="mw-headline"> Troubleshooting </span></h2>
<p>If mail delivery fails ssmtp stores message in ~/dead.letter. You can resend it later using command</p>
<pre>$ cat ~/dead.letter | sendmail user@domain.tld</pre>
<p>If sendmail is not found, you may need to set a link from sendmail to ssmtp</p>
<pre>ln -s /usr/sbin/ssmtp /usr/sbin/sendmail</pre>
<p>Take a look to /var/log/messages to get more info (syslog must be installed).</p>
<p>If mail return a &quot;command not found&quot; error, you meed to install mail client like nail (emerge nail). If mail runs but then errors with &quot;/usr/sbin/sendmail command not found&quot; remerge mailwrapper (emerge mailwrapper). Other solution for non existing sendmail command is to recompile ssmtp without mailwrapper flag.</p>
<p><a name="Resources"></a></p>
<h2><span class="editsection">[<a title="Edit section: Resources" href="http://gentoo-wiki.com/index.php?title=SSMTP&amp;action=edit&amp;section=4">edit</a>]</span> <span class="mw-headline"> Resources </span></h2>
<ul>
<li><a rel="nofollow" title="http://www.destr0yr.com/article.php/Gmail_and_sSMTP" class="external free" href="http://www.destr0yr.com/article.php/Gmail_and_sSMTP">http://www.destr0yr.com/article.php/Gmail_and_sSMTP</a></li>
<li><a rel="nofollow" title="http://forums.gentoo.org/viewtopic-p-3011748.html" class="external free" href="http://forums.gentoo.org/viewtopic-p-3011748.html">http://forums.gentoo.org/viewtopic-p-3011748.html</a></li>
<li><a rel="nofollow" title="http://forums.gentoo.org/viewtopic-t-412468.html" class="external free" href="http://forums.gentoo.org/viewtopic-t-412468.html">http://forums.gentoo.org/viewtopic-t-412468.html</a></li>
</ul>
<p><a name="Authors"></a></p>
<h2><span class="editsection">[<a title="Edit section: Authors" href="http://gentoo-wiki.com/index.php?title=SSMTP&amp;action=edit&amp;section=5">edit</a>]</span> <span class="mw-headline"> Authors </span></h2>
<ul>
<li><a title="User:Antonio" href="http://gentoo-wiki.com/User:Antonio">User:Antonio</a></li>
<li><a rel="nofollow" title="http://www.destr0yr.com/users.php?mode=profile&amp;uid=2" class="external text" href="http://www.destr0yr.com/users.php?mode=profile&amp;uid=2">destr0yr</a></li>
</ul>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://observerlife.com/sablog-x%e5%b1%8f%e8%94%bd%e6%9c%ba%e5%99%a8%e4%ba%ba%e5%9e%83%e5%9c%be%e8%af%84%e8%ae%ba%e7%9a%84%e6%96%b9%e6%b3%95/" rel="bookmark" class="crp_title">SaBlog-X屏蔽机器人垃圾评论的方法</a></li><li><a href="http://observerlife.com/%e6%89%bf%e8%af%ba/" rel="bookmark" class="crp_title">承诺</a></li><li><a href="http://observerlife.com/mysql5-4%e7%9a%84%e6%94%b9%e8%bf%9b/" rel="bookmark" class="crp_title">MySQL5.4的改进</a></li><li><a href="http://observerlife.com/preg_replace_callback%e6%80%8e%e6%a0%b7%e4%bd%bf%e7%94%a8%e7%b1%bb%e4%b8%ad%e7%9a%84%e5%9b%9e%e8%b0%83%e5%87%bd%e6%95%b0/" rel="bookmark" class="crp_title">preg_replace_callback()怎样使用类中的回调函数</a></li><li><a href="http://observerlife.com/php%e9%87%8c%e7%9a%84%e6%96%87%e4%bb%b6%e7%8a%b6%e6%80%81%e7%bc%93%e5%ad%98/" rel="bookmark" class="crp_title">PHP里的文件状态缓存</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://observerlife.com/howto-gmail-and-ssmtp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sar在维护UNIX中的使用讲解</title>
		<link>http://observerlife.com/sar%e5%9c%a8%e7%bb%b4%e6%8a%a4unix%e4%b8%ad%e7%9a%84%e4%bd%bf%e7%94%a8%e8%ae%b2%e8%a7%a3/</link>
		<comments>http://observerlife.com/sar%e5%9c%a8%e7%bb%b4%e6%8a%a4unix%e4%b8%ad%e7%9a%84%e4%bd%bf%e7%94%a8%e8%ae%b2%e8%a7%a3/#comments</comments>
		<pubDate>Mon, 14 Jul 2008 00:35:12 +0000</pubDate>
		<dc:creator>ycg</dc:creator>
				<category><![CDATA[Unix/Linux]]></category>
		<category><![CDATA[sar]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.kedy.cn/blog/?p=378</guid>
		<description><![CDATA[在UNIX中用sar命令进行系统维护 &#160; &#160;在使用UNIX操作系统的过程中，我们常常会用到各种各样的问题，比如系统运行速度 突然变慢，系统容易死机或者主机所带的终端常出现死机，这时我们常常猜测，是硬 盘空间太小，还是内存不足？I/O出现瓶颈，或者是系统的核心参数出了问题？这时， 我们应该考虑使用系统给我们提供的sar命令来对系统作一个了解，该命令是系统维护 的重要工具，主要帮助我们掌握系统资源的使用情况，特别是内存和CPU 的使用情况， 是UNIX系统使用者应该掌握的工具之一。 sar 命令行的常用格式： sar [options] [-A] [-o file] t [n] 在命令行中，n 和t 两个参数组合起来定义采样间隔和次数，t为采样间隔，是必须有 的参数，n为采样次数，是可选的，默认值是1，-o file表示将命令结果以二进制格式 存放在文件中，file 在此处不是关键字，是文件名。options 为命令行选项，sar命令 的选项很多，下面只列出常用选项： 　　　　　　-A：所有报告的总和。 -u：CPU利用率 -v：进程、I节点、文件和锁表状态。 -d：硬盘使用报告。 -r：没有使用的内存页面和硬盘块。 -g：串口I/O的情况。 -b：缓冲区使用情况。 -a：文件读写情况。 -c：系统调用情况。 -R：进程的活动情况。 -y：终端设备活动情况。 -w：系统交换活动。 下面将举例说明。 例一：使用命令行 sar -u t n 例如，每60秒采样一次，连续采样5次，观察CPU 的使用情况，并将采样结果以二进制 形式存入当前目录下的文件zhou中，需键入如下命令： # sar -u -o zhou 60 5 [...]]]></description>
			<content:encoded><![CDATA[<p>在UNIX中用sar命令进行系统维护</p>
<p>&nbsp; &nbsp;在使用UNIX操作系统的过程中，我们常常会用到各种各样的问题，比如系统运行速度 <br />
突然变慢，系统容易死机或者主机所带的终端常出现死机，这时我们常常猜测，是硬 <br />
盘空间太小，还是内存不足？I/O出现瓶颈，或者是系统的核心参数出了问题？这时， <br />
我们应该考虑使用系统给我们提供的sar命令来对系统作一个了解，该命令是系统维护 <br />
的重要工具，主要帮助我们掌握系统资源的使用情况，特别是内存和CPU 的使用情况， <br />
是UNIX系统使用者应该掌握的工具之一。 <br />
sar 命令行的常用格式：</p>
<p>sar [options] [-A] [-o file] t [n]</p>
<p>在命令行中，n 和t 两个参数组合起来定义采样间隔和次数，t为采样间隔，是必须有 <br />
的参数，n为采样次数，是可选的，默认值是1，-o file表示将命令结果以二进制格式 <br />
存放在文件中，file 在此处不是关键字，是文件名。options 为命令行选项，sar命令 <br />
的选项很多，下面只列出常用选项：</p>
<p>　　　　　　-A：所有报告的总和。 <br />
-u：CPU利用率 <br />
-v：进程、I节点、文件和锁表状态。 <br />
-d：硬盘使用报告。 <br />
-r：没有使用的内存页面和硬盘块。 <br />
-g：串口I/O的情况。 <br />
-b：缓冲区使用情况。 <br />
-a：文件读写情况。 <br />
-c：系统调用情况。 <br />
-R：进程的活动情况。 <br />
-y：终端设备活动情况。 <br />
-w：系统交换活动。</p>
<p>下面将举例说明。</p>
<p>例一：使用命令行 sar -u t n</p>
<p>例如，每60秒采样一次，连续采样5次，观察CPU 的使用情况，并将采样结果以二进制 <br />
形式存入当前目录下的文件zhou中，需键入如下命令：</p>
<p># sar -u -o zhou 60 5</p>
<p>屏幕显示：</p>
<p>　　SCO_SV　　　scosysv　3.2v5.0.5　i80386　　　10/01/2001 <br />
14:43:50　　　%usr　　　%sys　　%wio　　　　%idle(-u) <br />
14:44:50　　　0　　　　　1　　　　4　　　　　　94 <br />
14:45:50　　　0　　　　　2　　　　4　　　　　　93 <br />
14:46:50　　　0　　　　　2　　　　2　　　　　　96 <br />
14:47:50　　　0　　　　　2　　　　5　　　　　　93 <br />
14:48:50　　　0　　　　　2　　　　2　　　　　　96 <br />
Average　　　 0　　　　　2　　　　4　　　　　　94</p>
<p>在显示内容包括：</p>
<p>　　%usr：CPU处在用户模式下的时间百分比。 <br />
%sys：CPU处在系统模式下的时间百分比。 <br />
%wio：CPU等待输入输出完成时间的百分比。 <br />
%idle：CPU空闲时间百分比。</p>
<p>在所有的显示中，我们应主要注意%wio和%idle，%wio的值过高，表示硬盘存在I/O瓶颈， <br />
%idle值高，表示CPU较空闲，如果%idle值高但系统响应慢时，有可能是CPU等待分配内存， <br />
此时应加大内存容量。%idle值如果持续低于10，那么系统的CPU处理能力相对较低，表 <br />
明系统中最需要解决的资源是CPU。</p>
<p>如果要查看二进制文件zhou中的内容，则需键入如下sar命令：</p>
<p>　　　　# sar -u -f zhou</p>
<p>可见，sar命令即可以实时采样，又可以对以往的采样结果进行查询。</p>
<p>例二：使用命行sar -v t n</p>
<p>例如，每30秒采样一次，连续采样5次，观察核心表的状态，需键入如下命令：</p>
<p># sar -v 30 5</p>
<p>屏幕显示： <br />
SCO_SV scosysv 3.2v5.0.5 i80386 10/01/2001 <br />
10:33:23 proc-sz ov inod-sz ov file-sz ov lock-sz　　 (-v) <br />
10:33:53　305/　321 　0　1337/2764　 0　1561/1706　0　40/　128 <br />
10:34:23　308/　321 　0　1340/2764　 0　1587/1706　0　37/　128 &nbsp;<br />
10:34:53　305/　321 　0　1332/2764　 0　1565/1706　0　36/　128 <br />
10:35:23　308/　321 　0　1338/2764　 0　1592/1706　0　37/　128 <br />
10:35:53　308/　321　 0　1335/2764　 0　1591/1706　0　37/　128 &nbsp;</p>
<p>显示内容包括：</p>
<p>proc-sz：目前核心中正在使用或分配的进程表的表项数，由核心参数MAX-PROC控制。</p>
<p>　　inod-sz：目前核心中正在使用或分配的i节点表的表项数，由核心参数 <br />
MAX-INODE控制。</p>
<p>　　file-sz： 目前核心中正在使用或分配的文件表的表项数，由核心参数MAX-FILE控 <br />
制。</p>
<p>　　ov：溢出出现的次数。</p>
<p>　　Lock-sz：目前核心中正在使用或分配的记录加锁的表项数，由核心参数MAX-FLCKRE <br />
控制。</p>
<p>显示格式为</p>
<p>实际使用表项/可以使用的表项数</p>
<p>显示内容表示，核心使用完全正常，三个表没有出现溢出现象，核心参数不需调整，如 <br />
果出现溢出时，要调整相应的核心参数，将对应的表项数加大。</p>
<p>例三：使用命行sar -d t n</p>
<p>例如，每30秒采样一次，连续采样5次，报告设备使用情况，需键入如下命令：</p>
<p># sar -d 30 5</p>
<p>屏幕显示：</p>
<p>　　　　　　SCO_SV scosysv 3.2v5.0.5 i80386 10/01/2001 <br />
11:06:43 device　%busy　　　avque　　　r+w/s　　blks/s　　avwait avserv (-d) <br />
11:07:13 wd-0　　　1.47　　　2.75　　　4.67　　　14.73　　 5.50 3.14 <br />
11:07:43 wd-0　　　0.43　　　18.77　　 3.07　　　8.66　　　25.11 1.41 <br />
11:08:13 wd-0　　　0.77　　　2.78　　　2.77　　　7.26　　　4.94 2.77 <br />
11:08:43 wd-0　　　1.10　　　11.18　　 4.10　　　11.26　　 27.32 2.68 <br />
11:09:13 wd-0　　　1.97　　　21.78　　 5.86　　　34.06　　　69.66 3.35 <br />
Average wd-0　　　1.15　　　12.11　　 4.09　　　15.19　　　31.12 2.80 &nbsp;</p>
<p>显示内容包括：</p>
<p>device： sar命令正在监视的块设备的名字。 <br />
%busy： 设备忙时，传送请求所占时间的百分比。 <br />
avque： 队列站满时，未完成请求数量的平均值。 <br />
r+w/s： 每秒传送到设备或从设备传出的数据量。 <br />
blks/s： 每秒传送的块数，每块512字节。 <br />
avwait： 队列占满时传送请求等待队列空闲的平均时间。 <br />
avserv： 完成传送请求所需平均时间（毫秒）。</p>
<p>在显示的内容中，wd-0是硬盘的名字，%busy的值比较小，说明用于处理传送请求的有 <br />
效时间太少，文件系统效率不高，一般来讲，%busy值高些，avque值低些，文件系统 <br />
的效率比较高，如果%busy和avque值相对比较高，说明硬盘传输速度太慢，需调整。</p>
<p>例四：使用命行sar -b t n</p>
<p>例如，每30秒采样一次，连续采样5次，报告缓冲区的使用情况，需键入如下命令：</p>
<p># sar -b 30 5</p>
<p>屏幕显示：</p>
<p>　　SCO_SV scosysv 3.2v5.0.5 i80386 10/01/2001 <br />
14:54:59 bread/s lread/s %rcache bwrit/s lwrit/s %wcache pread/s pwrit/s (-b) <br />
14:55:29　0　　147　　100　 5　　21　　78　　 0　　　0 <br />
14:55:59　0　　186　　100　 5　　25　　79　　 0　　　0 <br />
14:56:29　4　　232 　　98　 8　　58　　86　　 0　　　0 <br />
14:56:59　0　　125　　100　 5　　23　　76　　 0　　　0 <br />
14:57:29　0　　 89　　100　 4　　12　　66　　 0　　　0 <br />
Average　 1　　156 　　99　 5　　28　　80　　 0　　　0</p>
<p>显示内容包括：</p>
<p>bread/s： 每秒从硬盘读入系统缓冲区buffer的物理块数。 <br />
lread/s： 平均每秒从系统buffer读出的逻辑块数。 <br />
%rcache： 在buffer cache中进行逻辑读的百分比。 <br />
bwrit/s： 平均每秒从系统buffer向磁盘所写的物理块数。 <br />
lwrit/s： 平均每秒写到系统buffer逻辑块数。 <br />
%wcache： 在buffer cache中进行逻辑读的百分比。 <br />
pread/s： 平均每秒请求物理读的次数。 <br />
pwrit/s： 平均每秒请求物理写的次数。</p>
<p>在显示的内容中，最重要的是%cache和%wcache两列，它们的值体现着buffer的使用效 <br />
率，%rcache的值小于90或者%wcache的值低于65，应适当增加系统buffer的数量，buffer <br />
数量由核心参数NBUF控制，使%rcache达到90左右，%wcache达到80左右。但buffer参数 <br />
值的多少影响I/O效率，增加buffer，应在较大内存的情况下，否则系统效率反而得不到 <br />
提高。</p>
<p>例五：使用命行sar -g t n</p>
<p>例如，每30秒采样一次，连续采样5次，报告串口I/O的操作情况，需键入如下命令：</p>
<p># sar -g 30 5</p>
<p>屏幕显示：</p>
<p>SCO_SV scosysv 3.2v5.0.5 i80386　　11/22/2001 <br />
17:07:03 　ovsiohw/s　 ovsiodma/s　　ovclist/s (-g) <br />
17:07:33　　　0.00　　　0.00　　　0.00 <br />
17:08:03　　　0.00　　　0.00　　　0.00 <br />
17:08:33　　　0.00　　　0.00　　　0.00 <br />
17:09:03　　　0.00　　　0.00　　　0.00 <br />
17:09:33　　　0.00　　　0.00　　　0.00 <br />
Average 　　　0.00　　　0.00　　　0.00</p>
<p>显示内容包括：</p>
<p>ovsiohw/s：每秒在串口I/O硬件出现的溢出。</p>
<p>ovsiodma/s：每秒在串口I/O的直接输入输出通道高速缓存出现的溢出。</p>
<p>ovclist/s ：每秒字符队列出现的溢出。</p>
<p>在显示的内容中，每一列的值都是零，表明在采样时间内，系统中没有发生串口I/O溢 <br />
出现象。</p>
<p>sar命令的用法很多，有时判断一个问题，需要几个sar命令结合起来使用，比如，怀疑 <br />
CPU存在瓶颈，可用sar -u 和sar -q来看，怀疑I/O存在瓶颈，可用sar -b、sar -u和 <br />
sar-d来看，以上举出的五例仅仅是其中的一部分，有兴趣的朋友不妨一试。&nbsp;</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://observerlife.com/freebsd-skills-everyday-12/" rel="bookmark" class="crp_title">FreeBSD skills everyday &#8212; 12</a></li><li><a href="http://observerlife.com/freebsd-skills-everyday-2/" rel="bookmark" class="crp_title">FreeBSD skills everyday &#8212; 2</a></li><li><a href="http://observerlife.com/freebsd-skills-everyday-15/" rel="bookmark" class="crp_title">FreeBSD skills everyday &#8212; 15</a></li><li><a href="http://observerlife.com/%e5%bf%83%e6%9c%ac%e6%97%a0%e5%a3%b0%e9%9f%b3%e5%b0%bd%e6%9c%89/" rel="bookmark" class="crp_title">心本无声音尽有</a></li><li><a href="http://observerlife.com/freebsd-skills-everyday-4/" rel="bookmark" class="crp_title">FreeBSD skills everyday &#8212; 4</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://observerlife.com/sar%e5%9c%a8%e7%bb%b4%e6%8a%a4unix%e4%b8%ad%e7%9a%84%e4%bd%bf%e7%94%a8%e8%ae%b2%e8%a7%a3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Time and space optimization</title>
		<link>http://observerlife.com/time-and-space-optimization/</link>
		<comments>http://observerlife.com/time-and-space-optimization/#comments</comments>
		<pubDate>Thu, 10 Jul 2008 02:53:10 +0000</pubDate>
		<dc:creator>ycg</dc:creator>
				<category><![CDATA[Unix/Linux]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[space]]></category>

		<guid isPermaLink="false">http://www.kedy.cn/blog/?p=376</guid>
		<description><![CDATA[From: http://uw713doc.sco.com/en/FS_admin/_Time_and_Space_Optimization.html If you are using a ufs filesystem, the system attempts to optimize the time it takes to perform operations on the filesystem. In certain circumstances, the system attempts to optimize the space on the storage media being used by the filesystem. Space optimization occurs when file fragmentation exceeds: (free &#8211; 2) % of [...]]]></description>
			<content:encoded><![CDATA[<p><strong>From:</strong> http://uw713doc.sco.com/en/FS_admin/_Time_and_Space_Optimization.html</p>
<p>If you are using a <em>ufs</em> filesystem, the system attempts to optimize the time it takes to perform operations on the filesystem. In certain circumstances, the system attempts to optimize the space on the storage media being used by the filesystem.</p>
<p>Space optimization occurs when file fragmentation exceeds: <strong>(free &#8211; 2) %</strong> of free disk space. When file fragmentation exceeds this value, this message is displayed:</p>
<pre>Optimization changed from TIME to &lt;Space&gt;</pre>
<p>and the system will begin to optimize the space used by the filesystem.</p>
<p>The value of <strong>free</strong> is, by default, 10%, but it can be set to any value using the <a href="http://uw713doc.sco.com/en/man/html.1M/mkfs.1M.html"><strong>mkfs</strong>(1M)</a> command. The main use of <strong>free</strong> is to specify the minimum percentage of free disk space allowed. It is also used to limit the fragmentation of the filesystem.</p>
<p>When a file grows past an 8K boundary under time optimization, the system allocates a fragment (which is 1K in size) to contain the data. When the boundary of the fragment is exceeded, the system allocates a new 8K block, and the fragment is copied to it. This means that there could be nearly 7K of wasted space at the end of some files.</p>
<p>With space optimization, however, whenever a file grows past a 1K boundary, all the fragments since the last 8K boundary are copied into a new, larger fragment.</p>
<p>If your system has swapped to space optimization, and you want to revert to time optimization, you must increase the value of <strong>free</strong>. Use <a href="http://uw713doc.sco.com/en/man/html.1M/tunefs.1M.html"><strong>tunefs</strong>(1M)</a> to do this. You can increase <strong>free</strong> to any value you want; however, keep in mind the two functions of the <strong>free</strong> parameter if you want to set realistic values. <strong>free</strong> is used to do the following:</p>
<ul>
<p>&nbsp;</p>
<li>Set the minimum percentage of free disk space allowed. Therefore, if you set the value of <strong>free</strong> too high, ordinary (nonprivileged) users will not be able to write files (as described in <a href="http://uw713doc.sco.com/en/FS_admin/MFST_mkfsCreateFlSys.html">&#8220;Creating a filesystem with mkfs&#8221;</a>).
<p>&nbsp;</p>
</li>
<li>Set the maximum percentage of free disk space that can be fragments. Therefore, if you set the value of <strong>free</strong> too low, the optimization will change from time to space and file writes will be slower.</li>
</ul>
<p>Set the value of <strong>free</strong> carefully, taking into account the typical file size and the number of directories on your system.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://observerlife.com/hello-2010/" rel="bookmark" class="crp_title">Hello, 2010</a></li><li><a href="http://observerlife.com/php%e9%87%8c%e7%9a%84%e6%96%87%e4%bb%b6%e7%8a%b6%e6%80%81%e7%bc%93%e5%ad%98/" rel="bookmark" class="crp_title">PHP里的文件状态缓存</a></li><li><a href="http://observerlife.com/web%e5%88%9b%e4%b8%9a%e7%9a%8410%e6%9d%a1%e6%88%92%e5%be%8b-fromkeso/" rel="bookmark" class="crp_title">Web创业的10条戒律( From:keso)</a></li><li><a href="http://observerlife.com/vim-quick-reference-card/" rel="bookmark" class="crp_title">VIM QUICK REFERENCE CARD</a></li><li><a href="http://observerlife.com/%e8%bd%ac%e5%b8%96%e9%a9%ac%e4%ba%91%e5%9c%a8%e8%b5%a2%e5%9c%a8%e4%b8%ad%e5%9b%bd%e7%9a%84%e4%b8%80%e4%ba%9b%e7%b2%be%e5%bd%a9%e8%af%84%e8%ae%ba/" rel="bookmark" class="crp_title">[转帖]马云在赢在中国的一些精彩评论</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://observerlife.com/time-and-space-optimization/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Squid请求处理的典型流程</title>
		<link>http://observerlife.com/squid%e8%af%b7%e6%b1%82%e5%a4%84%e7%90%86%e7%9a%84%e5%85%b8%e5%9e%8b%e6%b5%81%e7%a8%8b/</link>
		<comments>http://observerlife.com/squid%e8%af%b7%e6%b1%82%e5%a4%84%e7%90%86%e7%9a%84%e5%85%b8%e5%9e%8b%e6%b5%81%e7%a8%8b/#comments</comments>
		<pubDate>Sun, 29 Jun 2008 04:01:59 +0000</pubDate>
		<dc:creator>ycg</dc:creator>
				<category><![CDATA[Unix/Linux]]></category>

		<guid isPermaLink="false">http://www.kedy.cn/blog/?p=373</guid>
		<description><![CDATA[转载自： 彭勇华的Squid中文Blog 客户端的连接,可被client-side模块接收和解析，也可以由clientBeginRequest()函数主动创建一个到客户端的连接。 &#160; 检查访问控制规则。客户端请求会建立一个ACL数据结构，并且注册一个回调函数，用于在访问控制完成时，通知相关结果。 &#160; 在访问控制通过后，请求可能被重定向。 &#160; 客户端请求转交到GetMoreData()函数，该函数在缓存里查找请求目标，和相应的Vary:版本号。假如缓存命中，client-side模块注册其自身信息到StoreEntry里。否则，请求被转发，并可能带一个If-Modified-Since头部。 &#160; 请求转发过程以rotoDispatch()函数开始。该函数启动peer选择算法，可能包含发送和接受ICP消息的调用。peer选择算法也会检查相关配置选项例如never_direct和always_direct。 &#160; 假如有ICP响应抵达，选择过程就终止在protoStart()函数。该函数调用相应的协议级函数，用以转发请求。我们假设这里是一个HTTP请求。 &#160; HTTP模块首先打开到原始WEB服务器或cache peer的连接（cache peer仅在配置了cache集群时才存在）。假如没有持久socket可用，就发起一个到Network Communication模块的连接请求，并包含一个回调函数。comm.c程序负责建立连接，并处理连接异常。 &#160; 当TCP连接建立后，HTTP建立写缓存，并将请求写入socket。然后它建立相应的socket读缓存，用以接受和处理HTTP响应。 &#160; 响应一旦接受，HTTP响应头部（header）被解析，并被放在一个响应数据结构里。在响应数据（data）被读取时，它被追加到StoreEntry里。每次数据追加到StoreEntry时，会通过一个回调函数，通知client-side模块有新的数据。读取速率取决于延迟池（delay pools，如果配置了的话）。 &#160; 当client-side模块接收到通知后，它从StoreEntry里拷贝出数据，并写往客户端socket。 &#160; 当数据追加到StoreEntry里，并被客户端读取后，数据可能被写往磁盘。 &#160; 当HTTP模块完成了从上流服务器读取数据后，它把StoreEntry标记为&#8220;完成&#8221;。到服务器的socket可能被关闭，或被放入持久连接池，以备将来使用。 &#160; 当client-side模块写完所有目标数据后，它从StoreEntry里注释掉其自身。同时它要么等待客户端的下一个请求，要么关闭客户端连接。 Related Posts:爱过，拼过，玩过，哭过(四) 大学毕业时的回顾爱过，拼过，玩过，哭过(一) 大学毕业时的回顾金山终上市-恭贺爱过，拼过，玩过，哭过(三) 大学毕业时的回顾爱过，拼过，玩过，哭过(二) 大学毕业时的回顾]]></description>
			<content:encoded><![CDATA[<p><span id="ctl00_MainContentPlaceholder_ctl01_ctl00_lblEntry"></p>
<div class="bvMsg" id="msgcns!B49104BB65206A10!168">
<div>
<p style="margin: 0cm 0cm 0pt; text-indent: 21pt;"><font size="3"><font color="#000000"><span style="font-family: 宋体;">转载自： </span></font></font><a href="http://squidcn.spaces.live.com/Blog/cns!B49104BB65206A10!168.entry"><span class="attribute-value">彭勇华的Squid中文Blog</span></a></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 21pt;"><font size="3"><font color="#000000"><span style="font-family: 宋体;">客户端的连接</span><span lang="EN-US"><font face="Times New Roman">,</font></span><span style="font-family: 宋体;">可被</span><span lang="EN-US"><font face="Times New Roman">client-side</font></span><span style="font-family: 宋体;">模块接收和解析，也可以由</span><span lang="EN-US"><font face="Times New Roman">clientBeginRequest()</font></span><span style="font-family: 宋体;">函数主动创建一个到客户端的连接。</span></font></font></p>
<p style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><font face="Times New Roman" size="3" color="#000000">&nbsp;</font></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 21pt;"><font size="3"><font color="#000000"><span style="font-family: 宋体;">检查访问控制规则。客户端请求会建立一个</span><span lang="EN-US"><font face="Times New Roman">ACL</font></span><span style="font-family: 宋体;">数据结构，并且注册一个回调函数，用于在访问控制完成时，通知相关结果。</span></font></font></p>
<p style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><font face="Times New Roman" size="3" color="#000000">&nbsp;</font></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 21pt;"><span style="font-family: 宋体;"><font size="3" color="#000000">在访问控制通过后，请求可能被重定向。</font></span></p>
<p style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><font face="Times New Roman" size="3" color="#000000">&nbsp;</font></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 21pt;"><font size="3"><font color="#000000"><span style="font-family: 宋体;">客户端请求转交到</span><span lang="EN-US"><font face="Times New Roman">GetMoreData()</font></span><span style="font-family: 宋体;">函数，该函数在缓存里查找请求目标，和相应的</span><span lang="EN-US"><font face="Times New Roman">Vary:</font></span><span style="font-family: 宋体;">版本号。假如缓存命中，</span><span lang="EN-US"><font face="Times New Roman">client-side</font></span><span style="font-family: 宋体;">模块注册其自身信息到</span><span lang="EN-US"><font face="Times New Roman">StoreEntry</font></span><span style="font-family: 宋体;">里。否则，请求被转发，并可能带一个</span><span lang="EN-US"><font face="Times New Roman">If-Modified-Since</font></span><span style="font-family: 宋体;">头部。</span></font></font></p>
<p style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><font face="Times New Roman" size="3" color="#000000">&nbsp;</font></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 21pt;"><font size="3"><font color="#000000"><span style="font-family: 宋体;">请求转发过程以</span><span lang="EN-US"><font face="Times New Roman">rotoDispatch()</font></span><span style="font-family: 宋体;">函数开始。该函数启动</span><span lang="EN-US"><font face="Times New Roman">peer</font></span><span style="font-family: 宋体;">选择算法，可能包含发送和接受</span><span lang="EN-US"><font face="Times New Roman">ICP</font></span><span style="font-family: 宋体;">消息的调用。</span><span lang="EN-US"><font face="Times New Roman">peer</font></span><span style="font-family: 宋体;">选择算法也会检查相关配置选项例如</span><span lang="EN-US"><font face="Times New Roman">never_direct</font></span><span style="font-family: 宋体;">和</span><span lang="EN-US"><font face="Times New Roman">always_direct</font></span><span style="font-family: 宋体;">。</span></font></font></p>
<p style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><font face="Times New Roman" size="3" color="#000000">&nbsp;</font></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 21pt;"><font size="3"><font color="#000000"><span style="font-family: 宋体;">假如有</span><span lang="EN-US"><font face="Times New Roman">ICP</font></span><span style="font-family: 宋体;">响应抵达，选择过程就终止在</span><span lang="EN-US"><font face="Times New Roman">protoStart()</font></span><span style="font-family: 宋体;">函数。该函数调用相应的协议级函数，用以转发请求。我们假设这里是一个</span><span lang="EN-US"><font face="Times New Roman">HTTP</font></span><span style="font-family: 宋体;">请求。</span></font></font></p>
<p style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><font face="Times New Roman" size="3" color="#000000">&nbsp;</font></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 21pt;"><font size="3"><font color="#000000"><span lang="EN-US"><font face="Times New Roman">HTTP</font></span><span style="font-family: 宋体;">模块首先打开到原始</span><span lang="EN-US"><font face="Times New Roman">WEB</font></span><span style="font-family: 宋体;">服务器或</span><span lang="EN-US"><font face="Times New Roman">cache peer</font></span><span style="font-family: 宋体;">的连接（</span><span lang="EN-US"><font face="Times New Roman">cache peer</font></span><span style="font-family: 宋体;">仅在配置了</span><span lang="EN-US"><font face="Times New Roman">cache</font></span><span style="font-family: 宋体;">集群时才存在）。假如没有持久</span><span lang="EN-US"><font face="Times New Roman">socket</font></span><span style="font-family: 宋体;">可用，就发起一个到</span><span lang="EN-US"><font face="Times New Roman">Network Communication</font></span><span style="font-family: 宋体;">模块的连接请求，并包含一个回调函数。</span><span lang="EN-US"><font face="Times New Roman">comm.c</font></span><span style="font-family: 宋体;">程序负责建立连接，并处理连接异常。</span></font></font></p>
<p style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><font face="Times New Roman" size="3" color="#000000">&nbsp;</font></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 21pt;"><font size="3"><font color="#000000"><span style="font-family: 宋体;">当</span><span lang="EN-US"><font face="Times New Roman">TCP</font></span><span style="font-family: 宋体;">连接建立后，</span><span lang="EN-US"><font face="Times New Roman">HTTP</font></span><span style="font-family: 宋体;">建立写缓存，并将请求写入</span><span lang="EN-US"><font face="Times New Roman">socket</font></span><span style="font-family: 宋体;">。然后它建立相应的</span><span lang="EN-US"><font face="Times New Roman">socket</font></span><span style="font-family: 宋体;">读缓存，用以接受和处理</span><span lang="EN-US"><font face="Times New Roman">HTTP</font></span><span style="font-family: 宋体;">响应。</span></font></font></p>
<p style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><font face="Times New Roman" size="3" color="#000000">&nbsp;</font></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 21pt;"><font size="3"><font color="#000000"><span style="font-family: 宋体;">响应一旦接受，</span><span lang="EN-US"><font face="Times New Roman">HTTP</font></span><span style="font-family: 宋体;">响应头部（</span><span lang="EN-US"><font face="Times New Roman">header</font></span><span style="font-family: 宋体;">）被解析，并被放在一个响应数据结构里。在响应数据（</span><span lang="EN-US"><font face="Times New Roman">data</font></span><span style="font-family: 宋体;">）被读取时，它被追加到</span><span lang="EN-US"><font face="Times New Roman">StoreEntry</font></span><span style="font-family: 宋体;">里。每次数据追加到</span><span lang="EN-US"><font face="Times New Roman">StoreEntry</font></span><span style="font-family: 宋体;">时，会通过一个回调函数，通知</span><span lang="EN-US"><font face="Times New Roman">client-side</font></span><span style="font-family: 宋体;">模块有新的数据。读取速率取决于延迟池（</span><span lang="EN-US"><font face="Times New Roman">delay pools</font></span><span style="font-family: 宋体;">，如果配置了的话）。</span></font></font></p>
<p style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><font face="Times New Roman" size="3" color="#000000">&nbsp;</font></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 21pt;"><font size="3"><font color="#000000"><span style="font-family: 宋体;">当</span><span lang="EN-US"><font face="Times New Roman">client-side</font></span><span style="font-family: 宋体;">模块接收到通知后，它从</span><span lang="EN-US"><font face="Times New Roman">StoreEntry</font></span><span style="font-family: 宋体;">里拷贝出数据，并写往客户端</span><span lang="EN-US"><font face="Times New Roman">socket</font></span><span style="font-family: 宋体;">。</span></font></font></p>
<p style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><font face="Times New Roman" size="3" color="#000000">&nbsp;</font></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 21pt;"><font size="3"><font color="#000000"><span style="font-family: 宋体;">当数据追加到</span><span lang="EN-US"><font face="Times New Roman">StoreEntry</font></span><span style="font-family: 宋体;">里，并被客户端读取后，数据可能被写往磁盘。</span></font></font></p>
<p style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><font face="Times New Roman" size="3" color="#000000">&nbsp;</font></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 21pt;"><font size="3"><font color="#000000"><span style="font-family: 宋体;">当</span><span lang="EN-US"><font face="Times New Roman">HTTP</font></span><span style="font-family: 宋体;">模块完成了从上流服务器读取数据后，它把</span><span lang="EN-US"><font face="Times New Roman">StoreEntry</font></span><span style="font-family: 宋体;">标记为&ldquo;完成&rdquo;。到服务器的</span><span lang="EN-US"><font face="Times New Roman">socket</font></span><span style="font-family: 宋体;">可能被关闭，或被放入持久连接池，以备将来使用。</span></font></font></p>
<p style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><font face="Times New Roman" size="3" color="#000000">&nbsp;</font></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 21pt;"><font size="3"><font color="#000000"><span style="font-family: 宋体;">当</span><span lang="EN-US"><font face="Times New Roman">client-side</font></span><span style="font-family: 宋体;">模块写完所有目标数据后，它从</span><span lang="EN-US"><font face="Times New Roman">StoreEntry</font></span><span style="font-family: 宋体;">里注释掉其自身。同时它要么等待客户端的下一个请求，要么关闭客户端连接。</span></font></font></p>
</div>
</div>
<p></span></p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://observerlife.com/%e7%88%b1%e8%bf%87%ef%bc%8c%e6%8b%bc%e8%bf%87%ef%bc%8c%e7%8e%a9%e8%bf%87%ef%bc%8c%e5%93%ad%e8%bf%87%e5%9b%9b-%e5%a4%a7%e5%ad%a6%e6%af%95%e4%b8%9a%e6%97%b6%e7%9a%84%e5%9b%9e%e9%a1%be/" rel="bookmark" class="crp_title">爱过，拼过，玩过，哭过(四) 大学毕业时的回顾</a></li><li><a href="http://observerlife.com/%e7%88%b1%e8%bf%87%ef%bc%8c%e6%8b%bc%e8%bf%87%ef%bc%8c%e7%8e%a9%e8%bf%87%ef%bc%8c%e5%93%ad%e8%bf%87%e4%b8%80-%e5%a4%a7%e5%ad%a6%e6%af%95%e4%b8%9a%e6%97%b6%e7%9a%84%e5%9b%9e%e9%a1%be/" rel="bookmark" class="crp_title">爱过，拼过，玩过，哭过(一) 大学毕业时的回顾</a></li><li><a href="http://observerlife.com/%e9%87%91%e5%b1%b1%e7%bb%88%e4%b8%8a%e5%b8%82-%e6%81%ad%e8%b4%ba/" rel="bookmark" class="crp_title">金山终上市-恭贺</a></li><li><a href="http://observerlife.com/%e7%88%b1%e8%bf%87%ef%bc%8c%e6%8b%bc%e8%bf%87%ef%bc%8c%e7%8e%a9%e8%bf%87%ef%bc%8c%e5%93%ad%e8%bf%87%e4%b8%89-%e5%a4%a7%e5%ad%a6%e6%af%95%e4%b8%9a%e6%97%b6%e7%9a%84%e5%9b%9e%e9%a1%be/" rel="bookmark" class="crp_title">爱过，拼过，玩过，哭过(三) 大学毕业时的回顾</a></li><li><a href="http://observerlife.com/%e7%88%b1%e8%bf%87%ef%bc%8c%e6%8b%bc%e8%bf%87%ef%bc%8c%e7%8e%a9%e8%bf%87%ef%bc%8c%e5%93%ad%e8%bf%87%e4%ba%8c-%e5%a4%a7%e5%ad%a6%e6%af%95%e4%b8%9a%e6%97%b6%e7%9a%84%e5%9b%9e%e9%a1%be/" rel="bookmark" class="crp_title">爱过，拼过，玩过，哭过(二) 大学毕业时的回顾</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://observerlife.com/squid%e8%af%b7%e6%b1%82%e5%a4%84%e7%90%86%e7%9a%84%e5%85%b8%e5%9e%8b%e6%b5%81%e7%a8%8b/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>freebsd7安装手册-更新ports 和src</title>
		<link>http://observerlife.com/freebsd7%e5%ae%89%e8%a3%85%e6%89%8b%e5%86%8c-%e6%9b%b4%e6%96%b0ports-%e5%92%8csrc/</link>
		<comments>http://observerlife.com/freebsd7%e5%ae%89%e8%a3%85%e6%89%8b%e5%86%8c-%e6%9b%b4%e6%96%b0ports-%e5%92%8csrc/#comments</comments>
		<pubDate>Fri, 20 Jun 2008 20:25:58 +0000</pubDate>
		<dc:creator>ycg</dc:creator>
				<category><![CDATA[Unix/Linux]]></category>

		<guid isPermaLink="false">http://www.kedy.cn/blog/?p=371</guid>
		<description><![CDATA[Copy From : http://hi.baidu.com/haigang/blog/item/aa8b9123ba760341ac34de69.html 选择最小安装完成后 如果没有安装内核源代码 可以直接从光盘复制内核源代码到系统安装。 install-sh all 更新ports树 /usr/local/bin/cvsup -g -L 2 /etc/ports-supfile 需要安装cvsup 和更新ports-supfile pkg_add -r cvsup-without-gui cp /usr/share/examples/cvsup/ports-supfile /etc/ fastest_cvsup -c CN 测试速度 &#160; &#160; Step 4 FreeBSD升级系统源代码. &#160; &#160; &#160; &#160; &#160; &#160; &#160; FreeBSD下升级系统src: &#160; 创建/root/scripts/src-update.sh文件 进入/root/scripts目录，创建src-update.sh文件 &#160; Shell: &#160; &#160; cd /root/scripts/ &#160; &#160; vi /root/scripts/src-update.sh &#160; 内容如下： [...]]]></description>
			<content:encoded><![CDATA[<div class="cnt" id="blog_text">
<p>Copy From : http://hi.baidu.com/haigang/blog/item/aa8b9123ba760341ac34de69.html</p>
<p>选择最小安装完成后</p>
<p>如果没有安装内核源代码</p>
<p>可以直接从光盘复制内核源代码到系统安装。</p>
<p>install-sh all</p>
<p>更新ports树</p>
<p><strong><font face="Tahoma" size="2">/usr/local/bin/cvsup -g -L 2 /etc/ports-supfile</font></strong></p>
<p><strong><font face="Tahoma" size="2">需要安装cvsup 和更新ports-supfile</font></strong></p>
<p><strong><font face="Tahoma" size="2">pkg_add -r cvsup-without-gui</font></strong></p>
<p><strong><font face="Tahoma" size="2">cp /usr/share/examples/cvsup/ports-supfile /etc/</font></strong></p>
<p><strong><font face="Tahoma" size="2">fastest_cvsup -c CN  测试速度</font></strong></p>
<p>&nbsp;</p>
<p><strong><font face="Tahoma" size="2"></p>
<p align="center">
<table width="95%" cellspacing="0" align="center" style="background: rgb(153, 204, 0) none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" class="t_table">
<tbody>
<tr>
<td width="90%">
<p align="left">&nbsp;</p>
<p align="left"><font face="Tahoma "><font style="font-size: 18pt;">Step 4 FreeBSD</font></font><font face="宋体 "><font style="font-size: 18pt;">升级系统源代码</font></font><font face="Tahoma "><font style="font-size: 18pt;">.</font></font></p>
<p>&nbsp;</p>
</td>
<td width="10%">
<p align="right">&nbsp;</p>
<p align="right">&nbsp;</p>
<p>&nbsp;</p>
</td>
</tr>
</tbody>
</table>
<p align="left">&nbsp;</p>
<p align="left"><strong><br />
</strong></p>
<p>&nbsp;</p>
<p align="left">&nbsp;</p>
<p align="left"><strong><font face="Tahoma "><font style="font-size: 12pt;">FreeBSD</font></font></strong><strong><font face="宋体 "><font style="font-size: 12pt;">下升级系统</font></font></strong><strong><font face="Tahoma "><font style="font-size: 12pt;">src:</font></font></strong><font face="Tahoma "><font style="font-size: 12pt;"></p>
<p></font></font></p>
<p>&nbsp;</p>
<p><font size="3"><strong><font face="宋体 ">创建</font></strong><strong><font face="Tahoma ">/root/scripts/src-update.sh</font></strong><strong><font face="宋体 ">文件</font></strong></font><br />
<font size="3"><font face="宋体 ">进入</font><font face="Tahoma ">/root/scripts</font><font face="宋体 ">目录，创建</font><font face="Tahoma ">src-update.sh</font><font face="宋体 ">文件</font></font></p>
<p align="left">&nbsp;</p>
<p align="left"><font face="Tahoma "><font style="font-size: 12pt;">Shell:</font></font></p>
<p>&nbsp;</p>
<table width="95%" cellspacing="0" align="center" style="background: rgb(89, 89, 89) none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" class="t_table">
<tbody>
<tr>
<td width="99%">
<p align="left">&nbsp;</p>
<p align="left"><strong><font color="#ffff00"><font face="Tahoma "><font size="2">cd /root/scripts/</font></font></font></strong></p>
<p>&nbsp;</p>
<p align="left">&nbsp;</p>
<p align="left"><font size="2"><strong><font color="#ffff00"><font face="Tahoma ">vi /root/scripts/src-update.sh</font></font></strong></font></p>
<p>&nbsp;</p>
</td>
</tr>
</tbody>
</table>
<p><font size="3"><font face="宋体 ">内容如下：</font></font></p>
<p align="left">&nbsp;</p>
<p align="left"><font face="Tahoma "><font style="font-size: 12pt;">Editor:</font></font></p>
<p>&nbsp;</p>
<table width="95%" cellspacing="0" align="center" style="background: rgb(89, 89, 89) none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" class="t_table">
<tbody>
<tr>
<td width="99%">
<p align="left">&nbsp;</p>
<p align="left"><strong><font face="Tahoma "><font style="font-size: 10pt;">#!/bin/sh</font></font></strong></p>
<p>&nbsp;</p>
<p align="left">&nbsp;</p>
<p align="left"><strong><font face="Tahoma "><font style="font-size: 10pt;"># updating source</font></font></strong></p>
<p>&nbsp;</p>
<p align="left">&nbsp;</p>
<p align="left"><strong><font face="Tahoma "><font style="font-size: 10pt;">echo &quot;Beginning Source Update&quot;</font></font></strong></p>
<p>&nbsp;</p>
<p align="left">&nbsp;</p>
<p align="left"><strong><font face="Tahoma "><font style="font-size: 10pt;">/usr/local/bin/cvsup -g -L 2 /etc/stable-supfile</font></font></strong></p>
<p>&nbsp;</p>
<p align="left">&nbsp;</p>
<p align="left"><strong><font face="Tahoma "><font style="font-size: 10pt;">echo &quot;Source Update Complete&quot;</font></font></strong></p>
<p>&nbsp;</p>
</td>
</tr>
</tbody>
</table>
<p><font size="3"><font face="宋体 ">对</font><font face="Tahoma ">/root/scripts/src-update.sh</font><font face="宋体 ">文件添加执行权限</font></font></p>
<p align="left">&nbsp;</p>
<p align="left"><font face="Tahoma "><font style="font-size: 12pt;">Shell:</font></font></p>
<p>&nbsp;</p>
<table width="95%" cellspacing="0" align="center" style="background: rgb(89, 89, 89) none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" class="t_table">
<tbody>
<tr>
<td width="99%">
<p align="left">&nbsp;</p>
<p align="left"><strong><font color="#ffff00"><font face="Tahoma "><font size="2">cd /root/scripts/</font></font></font></strong></p>
<p>&nbsp;</p>
<p align="left">&nbsp;</p>
<p align="left"><font size="2"><strong><font color="#ffff00"><font face="Tahoma ">chmod +x /root/scripts/src-update.sh</font></font></strong></font></p>
<p>&nbsp;</p>
</td>
</tr>
</tbody>
</table>
<p>
<font size="3"><font face="宋体 ">复制</font><font face="Tahoma ">/usr/share/examples/cvsup/stable-supfile</font><font face="宋体 ">到</font><font face="Tahoma ">/root/</font></font></p>
<p align="left">&nbsp;</p>
<p align="left"><font face="Tahoma "><font style="font-size: 12pt;">Shell:</font></font></p>
<p>&nbsp;</p>
<table width="95%" cellspacing="0" align="center" style="background: rgb(89, 89, 89) none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" class="t_table">
<tbody>
<tr>
<td width="99%">
<p align="left">&nbsp;</p>
<p align="left"><strong><font color="#ffff00"><font face="Tahoma "><font size="2">cd /root</font></font></font></strong></p>
<p>&nbsp;</p>
<p align="left">&nbsp;</p>
<p align="left"><font size="2"><strong><font color="#ffff00"><font face="Tahoma ">cp /usr/share/examples/cvsup/stable-supfile /root/</font></font></strong></font></p>
<p>&nbsp;</p>
</td>
</tr>
</tbody>
</table>
<p><font size="3"><font face="宋体 ">修改</font><font face="Tahoma ">stable -supfile</font><font face="宋体 ">文件，选择最近的</font><font face="Tahoma ">CVS</font><font face="宋体 ">服务器。</font><font face="Tahoma ">(</font><font face="宋体 ">以上测试得知最近的是</font><font face="Tahoma ">cvsup4.cn.freebsd.org)</font></font></p>
<p align="left">&nbsp;</p>
<p align="left"><font face="Tahoma "><font style="font-size: 12pt;">Shell:</font></font></p>
<p>&nbsp;</p>
<table width="95%" cellspacing="0" align="center" style="background: rgb(89, 89, 89) none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" class="t_table">
<tbody>
<tr>
<td width="99%">
<p align="left">&nbsp;</p>
<p align="left"><strong><font color="#ffff00"><font face="Tahoma "><font size="2">cd /root</font></font></font></strong></p>
<p>&nbsp;</p>
<p align="left">&nbsp;</p>
<p align="left"><font size="2"><strong><font color="#ffff00"><font face="Tahoma ">vi /root/stable-supfile</font></font></strong></font></p>
<p>&nbsp;</p>
</td>
</tr>
</tbody>
</table>
<p><font size="3"><font face="宋体 ">修改以下部分</font></font></p>
<p align="left">&nbsp;</p>
<p align="left">&nbsp;</p>
<p>&nbsp;</p>
<table width="95%" cellspacing="0" align="center" style="background: rgb(224, 224, 224) none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" class="t_table">
<tbody>
<tr>
<td width="99%">
<p align="left">&nbsp;</p>
<p align="left"><font face="宋体 "><font style="font-size: 10.5pt;"><font size="3">修改前：</font></font></font></p>
<p>&nbsp;</p>
<p align="left">&nbsp;</p>
<p align="left"><font face="Tahoma "><font style="font-size: 10.5pt;"><font size="3">*default host=CHANGE_THIS.FreeBSD.org</font></font></font></p>
<p>&nbsp;</p>
<p align="left">&nbsp;</p>
<p align="left"><font color="#ff00ff"><font face="宋体 "><font style="font-size: 10.5pt;"><font size="3">修改后：</font></font></font></font></p>
<p>&nbsp;</p>
<p align="left">&nbsp;</p>
<p align="left"><font face="Tahoma "><font style="font-size: 10.5pt;"><font size="3">*default host=<font color="#ff00ff">cvsup4.cn.FreeBSD.org</font></font></font></font></p>
<p>&nbsp;</p>
<p align="left">&nbsp;</p>
<p align="left">&nbsp;</p>
<p>&nbsp;</p>
<p align="left">&nbsp;</p>
<p align="left"><font face="宋体 "><font style="font-size: 10.5pt;"><font size="3">修改前：</font></font></font></p>
<p>&nbsp;</p>
<p align="left">&nbsp;</p>
<p align="left"><font face="Tahoma "><font style="font-size: 10.5pt;"><font size="3">*default release=cvs tag=RELENG_6</font></font></font></p>
<p>&nbsp;</p>
<p align="left">&nbsp;</p>
<p align="left"><font color="#ff00ff"><font face="宋体 "><font style="font-size: 10.5pt;"><font size="3">修改后：</font></font></font></font></p>
<p>&nbsp;</p>
<p align="left">&nbsp;</p>
<p align="left"><font face="Tahoma "><font style="font-size: 10.5pt;"><font size="3">*default release=<font color="#ff00ff">cvs tag=RELENG_6_2</font></font></font></font></p>
<p>&nbsp;</p>
<p align="left">&nbsp;</p>
<p align="left">&nbsp;</p>
<p>&nbsp;</p>
</td>
</tr>
</tbody>
</table>
<p>
<font size="3"><font face="宋体 ">复制修改好的</font><font face="Tahoma ">stable-supfile</font><font face="宋体 ">文件，到</font><font face="Tahoma ">/etc/ stable-supfile</font><font face="宋体 ">。并且改权限为</font><font face="Tahoma ">640</font><font face="宋体 ">只有</font><font face="Tahoma ">root</font><font face="宋体 ">用户才可以读写</font></font></p>
<p align="left">&nbsp;</p>
<p align="left"><font face="Tahoma "><font style="font-size: 12pt;">Shell:</font></font></p>
<p>&nbsp;</p>
<table width="95%" cellspacing="0" align="center" style="background: rgb(89, 89, 89) none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" class="t_table">
<tbody>
<tr>
<td width="99%">
<p align="left">&nbsp;</p>
<p align="left"><strong><font color="#ffff00"><font face="Tahoma "><font size="2">cd /root</font></font></font></strong></p>
<p>&nbsp;</p>
<p align="left">&nbsp;</p>
<p align="left"><font size="2"><strong><font color="#ffff00"><font face="Tahoma ">cp /root/stable-supfile /etc/stable-supfile</font></font></strong><strong><font color="#ffff00"><font face="Tahoma "><font style="font-size: 10.5pt;"> </font></font></font></strong></font></p>
<p>&nbsp;</p>
<p align="left">&nbsp;</p>
<p align="left"><font size="2"><strong><font color="#ffff00"><font face="Tahoma "><font style="font-size: 10.5pt;">chmod 640 /etc/</font></font></font></strong><strong><font color="#ffff00"><font face="Tahoma "> stable-supfile</font></font></strong></font></p>
<p>&nbsp;</p>
</td>
</tr>
</tbody>
</table>
<p>
<font size="3"><strong><font face="宋体 ">正式开始进行系统</font></strong><strong><font face="Tahoma ">Src</font></strong><strong><font face="宋体 ">升级</font></strong></font><br />
<font size="3"><font face="宋体 ">执行</font><font face="Tahoma ">/root/scripts/src-update.sh</font><font face="宋体 ">文件，进行同步</font></font></p>
<p align="left">&nbsp;</p>
<p align="left"><font face="Tahoma "><font style="font-size: 12pt;">Shell:</font></font></p>
<p>&nbsp;</p>
<table width="95%" cellspacing="0" align="center" style="background: rgb(89, 89, 89) none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" class="t_table">
<tbody>
<tr>
<td width="99%">
<p align="left">&nbsp;</p>
<p align="left"><strong><font color="#ffff00"><font face="Tahoma "><font size="2">/root/scripts/src-update.sh</font></font></font></strong></p>
<p>&nbsp;</p>
<p align="left">&nbsp;</p>
<p align="left"><font color="#c0c0c0"><font face="Tahoma "><font style="font-size: 10.5pt;"><font size="2">Beginning Source Update</font></font></font></font></p>
<p>&nbsp;</p>
<p align="left">&nbsp;</p>
<p align="left"><font color="#c0c0c0"><font face="Tahoma "><font style="font-size: 10.5pt;"><font size="2">Parsing supfile &quot;/etc/stable-supfile&quot;</font></font></font></font></p>
<p>&nbsp;</p>
<p align="left">&nbsp;</p>
<p align="left"><font color="#c0c0c0"><font face="Tahoma "><font style="font-size: 10.5pt;"><font size="2">Connecting to cvsup4.cn.FreeBSD.org</font></font></font></font></p>
<p>&nbsp;</p>
<p align="left">&nbsp;</p>
<p align="left"><font color="#c0c0c0"><font face="Tahoma "><font style="font-size: 10.5pt;"><font size="2">Shutting down connection to server</font></font></font></font></p>
<p>&nbsp;</p>
<p align="left">&nbsp;</p>
<p align="left"><font color="#c0c0c0"><font face="Tahoma "><font style="font-size: 10.5pt;"><font size="2">Finished successfully</font></font></font></font></p>
<p>&nbsp;</p>
<p align="left">&nbsp;</p>
<p align="left"><font color="#c0c0c0"><font face="Tahoma "><font style="font-size: 10.5pt;"><font size="2">Source Update Complete</font></font></font></font></p>
<p>&nbsp;</p>
</td>
</tr>
</tbody>
</table>
<p><font size="3"><font face="宋体 ">至此系统同步升级完成。</font></font></p>
<p></font></strong></div>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://observerlife.com/xargs-%e5%91%bd%e4%bb%a4%e7%94%a8%e6%b3%95/" rel="bookmark" class="crp_title">xargs 命令用法</a></li><li><a href="http://observerlife.com/%e9%87%91%e5%b1%b1%e7%bb%88%e4%b8%8a%e5%b8%82-%e6%81%ad%e8%b4%ba/" rel="bookmark" class="crp_title">金山终上市-恭贺</a></li><li><a href="http://observerlife.com/%e5%8c%97%e4%ba%ac%e8%bd%a6%e7%ab%99%e7%94%b5%e8%af%9d%e4%bf%a1%e6%81%af/" rel="bookmark" class="crp_title">北京车站电话信息</a></li><li><a href="http://observerlife.com/squid%e8%af%b7%e6%b1%82%e5%a4%84%e7%90%86%e7%9a%84%e5%85%b8%e5%9e%8b%e6%b5%81%e7%a8%8b/" rel="bookmark" class="crp_title">Squid请求处理的典型流程</a></li><li><a href="http://observerlife.com/php-interview-questions-from-yahoo/" rel="bookmark" class="crp_title">PHP Interview questions from YAHOO</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://observerlife.com/freebsd7%e5%ae%89%e8%a3%85%e6%89%8b%e5%86%8c-%e6%9b%b4%e6%96%b0ports-%e5%92%8csrc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
