LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1253|回复: 8

XFS 3.0.0 删除测试+压缩解压测试

[复制链接]
发表于 2009-6-23 00:19:32 | 显示全部楼层 |阅读模式
ext3 大张旗鼓的升级为 ext4
从xfsprogs工具版本看,xfs2也悄悄升级到 xfs3 了哦,不知道我这样理解对不。

xfs的龟速删除早有耳闻,现在来看看>=xfsprogs3.0.0的闪电删除!

  1. localhost ~ # xfs_info /test [color=red]现在使用的是默认参数,isize如果是512的话,性能更好,对selinux支持也好;如果block=6413更大一点,则更适合大内存PC[/color]
  2. meta-data=/dev/sda10             isize=256    agcount=4, agsize=3283785 blks
  3.          =                       sectsz=512   attr=2
  4. data     =                       bsize=4096   blocks=13135137, imaxpct=25
  5.          =                       sunit=0      swidth=0 blks
  6. naming   =version 2              bsize=4096   ascii-ci=0
  7. log      =internal               bsize=4096   blocks=6413, version=2
  8.          =                       sectsz=512   sunit=0 blks, lazy-count=0
  9. realtime =none                   extsz=4096   blocks=0, rtextents=0
  10. localhost ~ # du -sh /test        [color=red]总容量20GB[/color]
  11. 20G        /test
  12. localhost ~ # find /test/ -type f | wc -l      [color=red]文件个数12189[/color]
  13. 12189
  14. localhost ~ # find /test/ -type d | wc -l         [color=red]目录个数953[/color]
  15. 953
  16. localhost ~ # find /test/ -type f -size -10k | wc -l       [color=red]小于10k的文件5283个[/color]
  17. 5283
  18. localhost ~ # find /test/ -type f -size -10M | wc -l       [color=red]小于10M的文件11945个[/color]
  19. 11945
  20. localhost ~ # find /test/ -type f -size +10M | wc -l      [color=red]大于10M的文件227个[/color]
  21. 227
  22. localhost ~ # find /test/ -type f -size 10M | wc -l        [color=red]等于10M的文件17个,find命令应该不是精确到比特[/color]
  23. 17
  24. localhost ~ # find /test/ -type f -size +100M | wc -l        [color=red]大于100M的文件15个[/color]
  25. 15
  26. localhost ~ # find /test/ -type f -size +200M | wc -l        [color=red]大于200M的文件14个[/color]
  27. 14
  28. localhost ~ # find /test/ -type f -size +300M | wc -l        [color=red]大于300M的文件10个[/color]
  29. 10
  30. localhost ~ # find /test/ -type f -size +500M | wc -l        [color=red]大于500M的文件7个[/color]
  31. 7
  32. localhost ~ # find /test/ -type f -size +1G | wc -l           [color=red]大于1G的文件1个[/color]
  33. 1
  34. localhost ~ # time rm /test/ -rf
  35. rm: cannot remove directory `/test': Device or resource busy  [color=red]#/test是我磁盘挂载点,不能删除,/test下所有东西已清空[/color]

  36. real        0m27.013s
  37. user        0m0.038s
  38. sys        0m1.602s
复制代码


半分钟删完了,比ext3、ext4、reiserfs都快很多!
发表于 2009-6-23 08:50:30 | 显示全部楼层
以前用过xfs,感觉不如现在的EXT4啊,莫非没有调整对参数?我用的默认设置。
回复 支持 反对

使用道具 举报

发表于 2009-6-23 09:17:28 | 显示全部楼层
一个文件系统再快也快不了多少,倒是换个新型号的大容量硬盘会快不少,有钱再升级下CPU,要是不介意噪声挂上个存储用用,啥文件系统都健步如飞了,哈哈,后面两句不要当真。
回复 支持 反对

使用道具 举报

发表于 2009-6-23 10:47:03 | 显示全部楼层
XFS有这样的进步?

如果是改进了小文件处理,倒是可以考虑倒退回XFS
回复 支持 反对

使用道具 举报

发表于 2009-6-23 12:15:59 | 显示全部楼层
其实单一操作的测试作用不大,应该做些接近实际的,随机的又读又写又删才公平。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-6-27 23:09:36 | 显示全部楼层
准备工作
  1. $ clear
  2. bean@debian ~ $ mkdir temp
  3. bean@debian ~ $ cd temp
  4. bean@debian ~/temp $ time wget http://gentoo.mirrors.tds.net/gentoo/snapshots/portage-20090626.tar.bz2
  5. --2009-06-27 22:16:21--  http://gentoo.mirrors.tds.net/gentoo/snapshots/portage-20090626.tar.bz2
  6. Resolving gentoo.mirrors.tds.net... 216.165.129.134
  7. Connecting to gentoo.mirrors.tds.net|216.165.129.134|:80... connected.
  8. HTTP request sent, awaiting response... 200 OK
  9. Length: 36009378 (34M) [application/x-tar]
  10. Saving to: `portage-20090626.tar.bz2'
  11. 100%[============================================================================================================================>] 36,009,378   212K/s   in 2m 58s  
  12. 2009-06-27 22:19:20 (197 KB/s) - `portage-20090626.tar.bz2' saved [36009378/36009378]
  13. real        2m58.565s
  14. user        0m0.192s
  15. sys        0m0.712s
  16. bean@debian ~/temp $ time wget http://gentoo.mirrors.tds.net/gentoo/snapshots/portage-20090626.tar.bz2.md5sum
  17. --2009-06-27 22:22:24--  http://gentoo.mirrors.tds.net/gentoo/snapshots/portage-20090626.tar.bz2.md5sum
  18. Resolving gentoo.mirrors.tds.net... 216.165.129.134
  19. Connecting to gentoo.mirrors.tds.net|216.165.129.134|:80... connected.
  20. HTTP request sent, awaiting response... 200 OK
  21. Length: 59 [application/x-tar]
  22. Saving to: `portage-20090626.tar.bz2.md5sum'
  23. 100%[============================================================================================================================>] 59          --.-K/s   in 0s      
  24. 2009-06-27 22:22:25 (2.45 MB/s) - `portage-20090626.tar.bz2.md5sum' saved [59/59]
  25. real        0m0.759s
  26. user        0m0.004s
  27. sys        0m0.004s
  28. bean@debian ~/temp $ md5sum -c portage-20090626.tar.bz2.md5sum
  29. portage-20090626.tar.bz2: OK
  30. bean@debian ~/temp $ mkdir usr
复制代码
解压,耗时10分钟,应该算比较慢吧
  1. bean@debian ~/temp $ time tar jxf portage-20090626.tar.bz2 -C /home/bean/temp/usr/
  2. real        10m2.872s
  3. user        0m34.274s
  4. sys        0m17.993s
复制代码
此portage有114385个文件,20566个目录。
  1. bean@debian ~/temp $ time find ./usr/portage/ -type f | wc -l
  2. 114385
  3. real        0m1.251s
  4. user        0m0.320s
  5. sys        0m0.908s
  6. bean@debian ~/temp $ time find ./usr/portage/ -type d | wc -l
  7. 20566
  8. real        0m1.172s
  9. user        0m0.300s
  10. sys        0m0.852s
复制代码
压缩,神奇,不到1分钟,难道是xfs尽量用缓存的缘故?
  1. bean@debian ~/temp $ time tar jcf test.tar.bz2 ./usr/portage/
  2. real        0m56.696s
  3. user        0m54.851s
  4. sys        0m1.824s
  5. bean@debian ~/temp $ l
  6. total 69M
  7. drwxr-xr-x  3 bean bean  104 2009-06-27 22:44 .
  8. drwxr-xr-x 51 bean bean 4.0K 2009-06-27 22:16 ..
  9. -rw-r--r--  1 bean bean  35M 2009-06-27 09:45 portage-20090626.tar.bz2
  10. -rw-r--r--  1 bean bean   59 2009-06-27 09:55 portage-20090626.tar.bz2.md5sum
  11. -rw-r--r--  1 bean bean  35M 2009-06-27 22:45 test.tar.bz2
  12. drwxr-xr-x  3 bean bean   20 2009-06-27 22:26 usr
  13. bean@debian ~/temp $ ls -al
  14. total 70352
  15. drwxr-xr-x  3 bean bean      104 2009-06-27 22:44 .
  16. drwxr-xr-x 51 bean bean     4096 2009-06-27 22:16 ..
  17. -rw-r--r--  1 bean bean 36009378 2009-06-27 09:45 portage-20090626.tar.bz2
  18. -rw-r--r--  1 bean bean       59 2009-06-27 09:55 portage-20090626.tar.bz2.md5sum
  19. -rw-r--r--  1 bean bean 36020148 2009-06-27 22:45 test.tar.bz2
  20. drwxr-xr-x  3 bean bean       20 2009-06-27 22:26 usr
  21. bean@debian ~/temp $ mount -L
  22. mount: option requires an argument -- 'L'
  23. Usage: mount -V                 : print version
  24.        mount -h                 : print this help
  25.        mount                    : list mounted filesystems
  26.        mount -l                 : idem, including volume labels
  27. So far the informational part. Next the mounting.
  28. The command is `mount [-t fstype] something somewhere'.
  29. Details found in /etc/fstab may be omitted.
  30.        mount -a [-t|-O] ...     : mount all stuff from /etc/fstab
  31.        mount device             : mount device at the known place
  32.        mount directory          : mount known device here
  33.        mount -t type dev dir    : ordinary mount command
  34. Note that one does not really mount a device, one mounts
  35. a filesystem (of the given type) found on the device.
  36. One can also mount an already visible directory tree elsewhere:
  37.        mount --bind olddir newdir
  38. or move a subtree:
  39.        mount --move olddir newdir
  40. One can change the type of mount containing the directory dir:
  41.        mount --make-shared dir
  42.        mount --make-slave dir
  43.        mount --make-private dir
  44.        mount --make-unbindable dir
  45. One can change the type of all the mounts in a mount subtree
  46. containing the directory dir:
  47.        mount --make-rshared dir
  48.        mount --make-rslave dir
  49.        mount --make-rprivate dir
  50.        mount --make-runbindable dir
  51. A device can be given by name, say /dev/hda1 or /dev/cdrom,
  52. or by label, using  -L label  or by uuid, using  -U uuid .
  53. Other options: [-nfFrsvw] [-o options] [-p passwdfd].
  54. For many more details, say  man 8 mount .
  55. bean@debian ~/temp $ mount -l
  56. /dev/sda6 on / type xfs (rw,noatime,logbufs=8)
  57. tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
  58. proc on /proc type proc (rw,noexec,nosuid,nodev)
  59. sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
  60. procbususb on /proc/bus/usb type usbfs (rw)
  61. udev on /dev type tmpfs (rw,mode=0755)
  62. tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
  63. devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
  64. /dev/sda3 on /boot type ext3 (rw)
  65. /dev/sda9 on /data type xfs (rw,noatime,logbufs=8)
  66. /dev/sda8 on /home type xfs (rw,noatime,logbufs=8)
  67. /dev/sda10 on /lue type xfs (ro,noexec,nosuid,nodev,noatime,logbufs=8)
  68. /dev/sda7 on /var type xfs (rw,noatime,logbufs=8)
  69. shm on /dev/shm type tmpfs (rw,noexec,nosuid,nodev,size=1024M)
  70. binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
复制代码
删除用了6分半,不尽人意。
  1. bean@debian ~/temp $ time rm -rf usr/
  2. real        6m31.191s
  3. user        0m0.564s
  4. sys        0m16.253s
  5. bean@debian ~/temp $ ls -la
  6. total 70352
  7. drwxr-xr-x  2 bean bean       94 2009-06-27 22:54 .
  8. drwxr-xr-x 51 bean bean     4096 2009-06-27 22:16 ..
  9. -rw-r--r--  1 bean bean 36009378 2009-06-27 09:45 portage-20090626.tar.bz2
  10. -rw-r--r--  1 bean bean       59 2009-06-27 09:55 portage-20090626.tar.bz2.md5sum
  11. -rw-r--r--  1 bean bean 36020148 2009-06-27 22:45 test.tar.bz2
复制代码
回复 支持 反对

使用道具 举报

发表于 2009-6-28 01:46:20 | 显示全部楼层
不是吧。。。xfs3了?

以前最开始也是听别人都说xfs牛,arch装上后就觉得大概linux就如此吧。后来换了jfs,天那我以前过的什么日子。现在换了ext4,确实无论启动,还是小文件操作上比jfs还快
回复 支持 反对

使用道具 举报

发表于 2009-6-28 13:29:01 | 显示全部楼层
  我有时候觉得这种很多选择而每个选择都不是最好是个很恶心的事。
  ext4的性能提升在桌面都很明显。jfs没有用过。xfs老的确实不适合桌面用。
回复 支持 反对

使用道具 举报

发表于 2009-6-28 22:52:30 | 显示全部楼层
用过两次 xfs ,但都在 3 天内丢失重要系统配置文件而重装系统……
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表