<?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>peformance &#8211; richliu&#039;s blog</title>
	<atom:link href="https://blog.richliu.com/tag/peformance/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.richliu.com</link>
	<description>Linux, 工作, 生活, 家人</description>
	<lastBuildDate>Sat, 23 Jul 2011 16:00:54 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.2</generator>
	<item>
		<title>git 和 filesystem 的 Performance</title>
		<link>https://blog.richliu.com/2011/07/24/1109/git-%e5%92%8c-filesystem-%e7%9a%84-performance/</link>
					<comments>https://blog.richliu.com/2011/07/24/1109/git-%e5%92%8c-filesystem-%e7%9a%84-performance/#comments</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sat, 23 Jul 2011 16:00:54 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[btrfs]]></category>
		<category><![CDATA[ext3]]></category>
		<category><![CDATA[ext4]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[peformance]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[xfs]]></category>
		<category><![CDATA[問題]]></category>
		<category><![CDATA[效能]]></category>
		<guid isPermaLink="false">http://blog.richliu.com/?p=1109</guid>

					<description><![CDATA[<p>前二天因為硬碟壞掉, 所以硬碟升級成 raid1. 而 file system 手賤換成 xfs. 這個星期我 [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2011/07/24/1109/git-%e5%92%8c-filesystem-%e7%9a%84-performance/">git 和 filesystem 的 Performance</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>前二天因為硬碟壞掉, 所以硬碟升級成 raid1. 而 file system 手賤換成 xfs.<br />
這個星期我都在查詢 system 的 performance 問題.</p>
<p>因為我 git 的各項操作實在是太慢了.<br />
慢到整個系統大概可以和 P5 比吧 (反正就是慢慢慢)<br />
<span id="more-1109"></span><br />
一開始我以為是 raid/disk 的問題, 不過在數次交叉測試下, 看起來兇手指向 File System<br />
以下就是我的測試環境.</p>
<p>CPU: Intel(R) Core(TM)2 Quad CPU    Q9550  @ 2.83GHz<br />
OS: Ubuntu Linux 10.04 LTS<br />
HDD1: Device Model:     Seagate ST31000528AS (1T)<br />
HDD2: Device Model:     Seagate ST31000528AS (1T)<br />
同一顆.</p>
<p>測試方式.</p>
<p>HDD1, HDD2 分別切了 40G 的 Primary 1 Partition.<br />
第一次在 HDD1 測 ext4 , HDD2 測 xfs<br />
第二次在 HDD1 測 xfs , HDD2 測 ext3<br />
第二次測完後追加 ext3 和 btrfs<br />
使用 time command 測試時間.<br />
在 Copy 之前會先 mkfs disk .<br />
硬碟內先行準備好一個 git repository 的測試資料, 然後再另建一個目錄 clone 這份測試資料(不細測 Read/Write)</p>
<p>測試資料.<br />
9.1G 的 .git source tree. 包含 5G 的 .git database 還有 4.1G 的 source code/binary/image .. 等等資料. 約有 2800 個 commit.</p>
<p>以下是測試數據<br />
First Round<br />
sda1: ext4<br />
# time git clone ../trunk/<br />
Initialized empty Git repository in /mnt/disk/1/trunk/.git/<br />
Checking out files: 100% (216892/216892), done.</p>
<p>real 3m30.381s<br />
user 0m24.878s<br />
sys 0m31.402s</p>
<p>sdb1: xfs<br />
# time git clone ../trunk/<br />
Initialized empty Git repository in /mnt/disk2/1/trunk/.git/<br />
Checking out files: 100% (216892/216892), done.</p>
<p>real 13m47.297s<br />
user 0m31.510s<br />
sys 0m24.482s</p>
<p>Round 2:<br />
sda1: xfs<br />
# time git clone ../trunk/<br />
Initialized empty Git repository in /mnt/disk/1/trunk/.git/<br />
Checking out files: 100% (216892/216892), done.</p>
<p>real 13m10.405s<br />
user 0m32.122s<br />
sys 0m19.761s</p>
<p>sdb1: ext4<br />
# time git clone ../trunk/<br />
Initialized empty Git repository in /mnt/disk2/1/trunk/.git/<br />
Checking out files: 100% (216892/216892), done.</p>
<p>real 1m25.192s<br />
user 0m26.210s<br />
sys 0m14.017s</p>
<p>sdb: ext3<br />
# time git clone ../trunk/<br />
Initialized empty Git repository in /mnt/disk2/1/trunk/.git/<br />
Checking out files: 100% (216892/216892), done.</p>
<p>real 3m5.792s<br />
user 0m25.534s<br />
sys 0m23.065s</p>
<p>sda: btrfs<br />
# time git clone ../trunk/<br />
Initialized empty Git repository in /mnt/disk/1/trunk/.git/<br />
Checking out files: 100% (216892/216892), done.</p>
<p>real 1m13.981s<br />
user 0m24.670s<br />
sys 0m32.730s</p>
<p>簡單的做一個圖表做測試結果.</p>
<p><a href="http://blog.richliu.com/wp-content/uploads/2011/07/time.png"><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-1110" title="time" src="http://blog.richliu.com/wp-content/uploads/2011/07/time.png" alt="" width="483" height="292" srcset="https://blog.richliu.com/wp-content/uploads/2011/07/time.png 483w, https://blog.richliu.com/wp-content/uploads/2011/07/time-300x181.png 300w" sizes="(max-width: 483px) 100vw, 483px" /></a></p>
<p>由此圖可知, 我的效能問題是出在 xfs 上.將 raid system 改成 ext4 後, 這個問題就解決了.</p>
<p>但是奇怪的是, xfs 雖然花了 13m, 但是實際 CPU 使用時間並不多. 這個問題也有可能是 ubuntu/Linux kernel 造成的.</p>
<p>ext4 和  btrfs 都各有一次不錯的表現. 尤其是 btrfs, 才 1m13 秒. 大家有常常使用 git 的, 可以考慮一下 btrfs.</p>
<p>受限於個人時間, 這個測試並不嚴謹, 不過己經可以解決我目前的問題, 至於這個數據, 簡單整理一下以後, 可以給常常使用 git 的朋友一個參考的資料.<br />
接下來就是希望有人能夠花點時間做出更完整的數據, 或是順便 Debug 了. </p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2011/07/24/1109/git-%e5%92%8c-filesystem-%e7%9a%84-performance/">git 和 filesystem 的 Performance</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2011/07/24/1109/git-%e5%92%8c-filesystem-%e7%9a%84-performance/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
