파일시스템 탐구생활3

koseph의 이미지

지난 주에 이어 세번째 벤치마크 자료를 올립니다.

장비는 집에 놀고 있는 구형 P4 머신에 젠투 2008.0-r1을 새로 설치해서 해봤습니다.

먼저, 테스트 머신의 사양은 다음과 같습니다.

# uname -a
Linux central 2.6.27-gentoo-r4 #1 SMP Fri Dec 5 13:25:26 KST 2008 i686 Intel(R) Celeron(R) CPU 2.40GHz GenuineIntel GNU/Linux

DISK I/O 알고리즘은 CFQ로 주었습니다.

# cat /proc/meminfo
MemTotal:       512124 kB

보시는 바와 같이 스펙은 허접합니다. 그래도 이번엔 실제 머신이구요. 시스템 리빌딩까지 해서 작업을 했기 때문에 시간 꽤나 걸렸습니다. ^^

하드디스크는
* ATA-5: IBM-DJSA-230, JS6OAC0A, max UDMA/66 120GB (시스템 디스크) /dev/sdb
* ATA-7: SAMSUNG SP1614C, SW100-30, max UDMA7 160GB (시험 디스크) /dev/sda
이렇게 두 개를 사용했습니다.

지난주와 마찬가지로 이번에도 커널 소스 트리 2개 버전(모두 컴파일 한 상태로 오브젝트 파일까지 있는)을 tar로 백업해서 리스토어 해보는 것입니다.

# cd /usr/src
# du -sh .
3.4G    .

참고로 /usr 파티션은 xfs로 포맷해서 마운팅한 상태입니다.

시험 스크립트는 아주 초간단하게.....

#!/bin/bash
mkdir /mnt/test/target1
cd /usr/src
tar -cpf - .| (cd /mnt/test/target1; tar xvpf -)

1. ext4

맨 처음 기본 옵션으로

# mkfs.ext4 -T ext4dev /dev/sda1 && mount /dev/sda1 /mnt/test
 
real    4m46.763s
user    0m12.700s
sys     1m40.000s

noatime을 추가했습니다. 약간 줄었군요.

# mkfs.ext4 -T ext4dev /dev/sda1 && mount -o noatime /dev/sda1 /mnt/test
 
real    4m46.212s
user    0m12.230s
sys     1m44.410s

다음으로 기본 블럭 크기를 4K -> 1K로 줄여봤습니다. 시간이 약간 늘어났지만 지난번 ext3에서 보다는 차이가 널 나는군요. 이 정도면 아주 만족스러운 수준입니다.

# mkfs.ext4 -b 1024 -T ext4dev /dev/sda1 && mount -o noatime /dev/sda1 /mnt/test
 
real    4m58.040s
user    0m12.740s
sys     1m48.120s

이번엔 extents 옵션을 줘 봤습니다. ext4는 ext3 + extents 기반의 할당방식을 추가했죠?
헉! 더 빠릅니다. 블럭까지 1K로 줄였음에도 더 빠릅니다.

# mkfs.ext4 -b 1024 -T ext4dev /dev/sda1 && mount -o extents /dev/sda1 /mnt/test
 
real    3m49.043s
user    0m11.970s
sys     1m45.370s

2. ext3

# mkfs.ext2 -j /dev/sda1 && mount /dev/sda1 /mnt/test
 
real    4m53.311s
user    0m11.520s
sys     1m50.310s

3. reiserfs

# mkreiserfs /dev/sda1 && mount /dev/sda1 /mnt/test
 
real    4m58.874s
user    0m12.260s
sys     2m25.290s

4. jfs

# mkfs.jfs /dev/sda1 && mount /dev/sda1 /mnt/test
 
real    5m3.007s
user    0m11.080s
sys     1m42.030s

5. xfs

# mkfs.xfs -f -bsize=4096 /dev/sda1 && mount /dev/sda1 /mnt/test
 
real    8m46.092s
user    0m11.360s
sys     1m44.920s

xfs는 블럭사이즈를 512로 주면 오히려 좀 더 빨라집니다. 하지만, 역시 작은 파일에선 느리죠.

# mkfs.xfs -f -b size=512 /dev/sda1 && mount /dev/sda1 /mnt/test
 
real    6m30.189s
user    0m12.490s
sys     2m2.880s

6. ext4 추가 시험
이렇게 보니 ext4가 이번에 장원이군요. 그래서 과감하게(?) /usr을 xfs에서 ext4로 파일시스템을 변경했습니다.

그런 후 다시 시험을 해보았더니..... 이상한 결과가 나오기 시작합니다.

자, 아래 내용은 소스 파일시스템도 ext4이고 타겟 역시 ext4로 설정한 상태에서 복사해 본 것입니다.

# mkfs.ext4 -T ext4dev /dev/sda1 && mount /dev/sda1 /mnt/test
 
real    7m41.198s
user    0m11.840s
sys     1m36.990s

앞서 5분도 안걸리던 시간이 7분을 넘겨 버리는군요.

블럭 사이즈를 줄이고 extents를 켜보았더니 역시 시간이 살짝 늘어나는데 5분이 안걸리던 시간이 7분을 상회하고 있네요.

mkfs.ext4 -b 1024 -T ext4dev /dev/sda1 && mount -o extents,noatime /dev/sda1 /mnt/test
 
real    7m51.845s
user    0m11.500s
sys     1m41.640s

ext4가 아직 코드가 안정화 된 것은 아니기 때문에 얼마든지 가능한 일입니다.
그래서 맨 처음에 했던 실험을 걸었습니다.
디렉토리 10만개, 파일 100만개 생성하고 목록보고 삭제하기.

10만개 Directories

생성

real    0m41.941s
user    0m3.700s
sys     0m20.480s

목록보기

real    0m1.411s
user    0m0.750s
sys     0m0.440s

삭제하기

real    4m29.924s
user    0m3.040s
sys     4m11.880s

별 문제는 없어 보입니다.

그런데 100만개 파일에서는 문제가 생기더군요.

생성
일단 파일은 424,690개를 생성할 수 있습니다.

Sorry, I couldn't create ./target/424691
 
real    2m47.545s
user    0m32.840s
sys     1m14.330s

목록보기

real    0m9.022s
user    0m4.260s
sys     0m2.730s

삭제하기

....
rm: cannot remove `target/111064': No such file or directory
rm: cannot remove `target/360270': No such file or directory
 
real    9m48.887s
user    0m2.560s
sys     0m28.250s

파일을 한 디렉토리에 40만개 이상을 만드니까 unlink 할 때 문제가 생깁니다. 아마 더 작은 파일 갯수에서도 문제가 생기는 듯 합니다. 삭제하긴 하는데 못 찾는다는 오류를 많이 내더군요. 단순히 오류 메시지인지 실제로 inode table에 문제가 생기는 지까지는 확인을 못했습니다.

bonnie++의 경우도 ext4에서는 파일을 삭제하면서 오류가 발생하고 멈추어 버렸습니다.

아마도 ext4로 마이그레이션 하시려고 고려중이신 분들도 계시리라 생각합니다. 일부 과감한 사용자들께서는 이미 쓰고 계실지도 모르겠네요.

ext3보다 성능이 나아졌다는 것이 중론이지만 코드가 버전업 되면서 extents와 관련해서 성능이 문제가 있다는 포스팅도 볼 수 있었습니다.

아마 큰 버그없이 ext4 <-> ext4의 성능이 xfs <-> ext4 성능 정도까지 내준다면 차세대 리눅스 파일시스템으로 손색이 없을 것 같기도 합니다.

현재 이 결과값 만으로 성급한 결론을 내리긴 힘들지만 하루속히 ext4가 안정화되길 바라면서
다음에는 조금 더 큰 파일을 가지고 시험해 보고자 합니다.

그럼, 즐리눅싱 하시길.....

snowall의 이미지

와...

멋지군요.

--------------------------
snowall의 블로그입니다.
http://snowall.tistory.com

피할 수 있을때 즐겨라! http://melotopia.net/b

koseph의 이미지

말씀하신 내용은.......

# ls -al /sbin/mkfs.ext3
lrwxrwxrwx 1 root root 6 Dec  4 19:22 /sbin/mkfs.ext3 -> mke2fs

이걸루 답이.......

There's always another way, dear.

---------------------------------
There's always another way, dear.

atie의 이미지

이 글도 같은 결론인데, koseph님이 쓰신 탐구생활 글을 훨씬 친근하게 읽을 수가 있었습니다. +1 !
----
I paint objects as I think them, not as I see them.
atie's minipage

----
I paint objects as I think them, not as I see them.
atie's minipage

Gyu의 이미지

성공을 못해서 여전히 해메고있는데

위 내용은 저한텐 머나먼 얘기네요 ㅎㅎ

koseph의 이미지

그냥 howto만 보고서 해결하기 힘듭니다. 구글링하셔야 해결 가능하시구요.

하드웨어가 최신이 아니라면 2007도 괜찮습니다.

그리고, 젠투는 2007로 깔았다 하더라도 상위 프로파일로 이동(즉, 버전업)이 시간이 많이 걸려서 그렇지 하기가 어렵지 않습니다.

끈기를 가지고 도전해 보세요. 좋은 결과가 있기를 바랍니다.

There's always another way, dear.

---------------------------------
There's always another way, dear.

권순선의 이미지

무조건 +1 :-)

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.