<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[运维进行时]]></title> 
<link>https://blog.liuts.com/index.php</link> 
<description><![CDATA[互联网运维与架构]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[运维进行时]]></copyright>
<item>
<link>https://blog.liuts.com/post/181/</link>
<title><![CDATA[排查Centos与ubuntu系统awk运行效率差异[原创]]]></title> 
<author>刘天斯 &lt;liutiansi@gmail.com&gt;</author>
<category><![CDATA[Linux]]></category>
<pubDate>Fri, 05 Mar 2010 10:02:26 +0000</pubDate> 
<guid>https://blog.liuts.com/post/181/</guid> 
<description>
<![CDATA[ 
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;同一个分析日志的awk脚本，在Centos、ubuntu操作系统运行效率存在巨大差异。即在ubuntu中只需1分钟，而在Centos中则需要20分钟。以下为我的排查步骤：<br/><strong>1、检查服务器内核版本</strong><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content"><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;拿一台升级过最新Linux内核(2.6.32.3)的CentOS5.4服务器来测试，结果还是没有改善 。<br/></div></div><br/><strong>2、检查内核ulimit参数</strong><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content"><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在Centos服务器调整所有ulimit参数与ubuntu系统一致，结果还是一样。<br/></div></div><br/><strong>3、优化awk脚本</strong><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content"><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;由于mawk与gawk部分语法上存在差异，如将转义符‘&#92;’换成'&#92;&#92;'，双引号换成单引号，依然没有效果。<br/></div></div><br/><strong>4、检查gawk版本</strong><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content"><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;检查两个系统的gawk版本，发现所有Centos版本默认自带的gawk都低于ubuntu系统自带的3.1.6，尝试在Centos服务器下载、安装源码gawk3.1.6，结果速度提升了20倍。测试结果如下：<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; time /usr/local/bin/gawk -f test.awk access.log >"temp.txt"<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; real&nbsp;&nbsp;&nbsp;&nbsp;0m48.739s<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; user&nbsp;&nbsp;&nbsp;&nbsp;0m42.904s<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sys&nbsp;&nbsp;&nbsp;&nbsp; 0m5.389s<br/></div></div><br/>Tags - <a href="https://blog.liuts.com/tags/centos/" rel="tag">centos</a> , <a href="https://blog.liuts.com/tags/ubuntu/" rel="tag">ubuntu</a> , <a href="https://blog.liuts.com/tags/awk/" rel="tag">awk</a>
]]>
</description>
</item><item>
<link>https://blog.liuts.com/post/181/#blogcomment30</link>
<title><![CDATA[[评论] 排查Centos与ubuntu系统awk运行效率差异[原创]]]></title> 
<author>selboo &lt;root@selboo.com.cn&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 09 Mar 2010 06:00:47 +0000</pubDate> 
<guid>https://blog.liuts.com/post/181/#blogcomment30</guid> 
<description>
<![CDATA[ 
	cat test.awk
]]>
</description>
</item><item>
<link>https://blog.liuts.com/post/181/#blogcomment71</link>
<title><![CDATA[[评论] 排查Centos与ubuntu系统awk运行效率差异[原创]]]></title> 
<author>猪立业 &lt;hjb510@gmail.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Fri, 30 Apr 2010 04:10:45 +0000</pubDate> 
<guid>https://blog.liuts.com/post/181/#blogcomment71</guid> 
<description>
<![CDATA[ 
	看了一下,以后还请多多指教<br/><br/>在此踩过!!...o(∩_∩)o...<br/>有空也可以和我做个友情链接啊!<br/><br/>&lt;a href=http://www.thinksoa.cn&gt;ThinkSOA&lt;/a&gt;
]]>
</description>
</item><item>
<link>https://blog.liuts.com/post/181/#blogcomment541</link>
<title><![CDATA[[评论] 排查Centos与ubuntu系统awk运行效率差异[原创]]]></title> 
<author>KEN &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 30 Dec 2010 09:16:44 +0000</pubDate> 
<guid>https://blog.liuts.com/post/181/#blogcomment541</guid> 
<description>
<![CDATA[ 
	完全不知道你作这个测试的意义是什么
]]>
</description>
</item><item>
<link>https://blog.liuts.com/post/181/#blogcomment683</link>
<title><![CDATA[[评论] 排查Centos与ubuntu系统awk运行效率差异[原创]]]></title> 
<author>KevinGam &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 26 Apr 2011 07:28:51 +0000</pubDate> 
<guid>https://blog.liuts.com/post/181/#blogcomment683</guid> 
<description>
<![CDATA[ 
	这个比较确实有意义，赞一个
]]>
</description>
</item>
</channel>
</rss>