如何最佳化XFS呢?

如果您覺得您的問題不屬於 debian desktop 或是 debian server 版的範圍內,請在這裡發問。

版主: mufa

文章scsi » 週四 3月 19, 2009 5:08 pm

我最近又在測xfs及reiserfs發現了有趣的現象
此篇同步貼於gentoo.tw討論區(含測試程式原始碼)

我之前曾經測試xfs及reiserfs的一些效能
在讀寫方面xfs及reiserfs的讀寫相差不大
但是在檔案的建立及刪除效能上卻有很大的差別
以下是我之前在舊電腦的測試數據
代碼: 選擇全部
XFS(normal partion )
create 10000 files: 33.499s (CPU 1.120s)
create 10000 dirs: 30.681s (CPU 1.030s)
open 10000 files: 0.104s (CPU 0.060s)
open 10000 dirs: 0.105s (CPU 0.060s)
open dir with 20000 files: 0.008s (CPU 0.010s)
remove 10000 files: 30.746s (CPU 0.990s)
remove 10000 dirs: 31.983s (CPU 0.920s)
write 6 Gbytes: 72.532s (CPU 14.740s)
read 6 Gbytes: 2.356s (CPU 2.130s)
remove 6 Gbytes file: 0.163s (CPU 0.070s)

ReiserFS 3(normal partion )
create 10000 files: 0.495s (CPU 0.420s)
create 10000 dirs: 0.615s (CPU 0.530s)
open 10000 files: 0.096s (CPU 0.050s)
open 10000 dirs: 0.095s (CPU 0.060s)
open dir with 20000 files: 0.011s (CPU 0.000s)
remove 10000 files: 0.589s (CPU 0.500s)
remove 10000 dirs: 0.670s (CPU 0.590s)
write 6 Gbytes: 51.618s (CPU 18.930s)
read 6 Gbytes: 2.398s (CPU 2.180s)
remove 6 Gbytes file: 0.534s (CPU 0.450s)


現在我在新電腦上組soft raid卻發現了很有趣的現象
使用raid0的reiserfs在建刪檔案的效能上並沒有太大的效益,進步了1倍左右 (0.495s->0.268s)
raid1的xfs正如預料的,依然有著緩慢的建刪檔時間(33.499s->24.736s)
但是raid0的xfs卻在刪建檔上有著奇蹟般的效果,進步了55倍(33.499s-> 0.602s)
從33秒進步到0.6秒,這樣的成績變成是可以接受了
不知道是什麼樣的原因造成這樣情況
我以前總是不了解為什麼這麼多人能忍受xfs異常緩慢的建刪檔效能

也許xfs的應用是適合在raid0或raid5之類的環境上使用 :finger1:

以下是新的測試數據
代碼: 選擇全部
Raid1 XFS
create 10000 files: 24.736s (CPU 0.340s)
create 10000 dirs: 27.482s (CPU 0.340s)
open 10000 files: 0.030s (CPU 0.030s)
open 10000 dirs: 0.022s (CPU 0.020s)
open dir with 20000 files: 0.005s (CPU 0.010s)
remove 10000 files: 26.409s (CPU 0.310s)
remove 10000 dirs: 31.512s (CPU 0.330s)
write 2 Gbytes: 23.150s (CPU 5.110s)
read 2 Gbytes: 0.298s (CPU 0.300s)
remove 2 Gbytes file: 0.288s (CPU 0.280s)

Raid0 XFS
create 10000 files: 0.602s (CPU 0.390s)
create 10000 dirs: 0.758s (CPU 0.290s)
open 10000 files: 0.025s (CPU 0.030s)
open 10000 dirs: 0.024s (CPU 0.020s)
open dir with 20000 files: 0.004s (CPU 0.000s)
remove 10000 files: 1.082s (CPU 0.310s)
remove 10000 dirs: 0.483s (CPU 0.270s)
write 2 Gbytes: 13.582s (CPU 4.310s)
read 2 Gbytes: 0.341s (CPU 0.360s)
remove 2 Gbytes file: 0.323s (CPU 0.330s)

Raid0 ReiserFS 3
create 10000 files: 0.268s (CPU 0.200s)
create 10000 dirs: 0.284s (CPU 0.220s)
open 10000 files: 0.025s (CPU 0.030s)
open 10000 dirs: 0.026s (CPU 0.030s)
open dir with 20000 files: 0.005s (CPU 0.000s)
remove 10000 files: 0.222s (CPU 0.220s)
remove 10000 dirs: 0.246s (CPU 0.250s)
write 2 Gbytes: 11.899s (CPU 7.170s)
read 2 Gbytes: 0.307s (CPU 0.300s)
remove 2 Gbytes file: 0.545s (CPU 0.550s)
世界再大,不過是妳我之間的事
scsi
可愛的小學生
可愛的小學生
 
文章: 75
註冊時間: 週四 12月 11, 2003 12:08 pm
來自: 台北

上一頁

回到 debian misc

誰在線上

正在瀏覽這個版面的使用者:沒有註冊會員 和 1 位訪客