MooseFS VS NFS

MooseFS(MFS)是一个分布式集群文件系统,介绍看 这里, 还有官方的 中文文档, 这里主要是进行 NFS和MFS的benchmark, 测试方法为使用 ab进行单个文件访问测试,后端server使用 ngnix, write性能测试使用 dd.

环境:

server: 192.168.1.8, Ubuntu, NFS, MFS, 8G内存, 双核Intel(R) Core(TM) i3 CPU 2.93GHz, MFS挂载目录为/mnt/mfsdir1, 是独立的磁盘块(dd建立)


client: 192.168.1.106, Mac OS X, Nginx, Nginx访问目录中分别挂载192.168.1.8的/mnt/mfsdir1(MFS分区)和NFS共享目录/mnt/nfs(属于/分区)


NFS和MFS的配置均为默认的, 这里要注意的是因为测试平台是Mac OS, 所以在NFS共享文件配置中需要加入参数insecure, 否则Mac OS会报opeartion not permite


小文件read测试

测试的文件为389K的图片文件

NFS测试结果:

view plain copy to clipboard print ?
  1. #ab -c 100 -n 1000 http://192.168.1.106/filesystem_benckmark/nfs/big.jpg  
  2.   
  3. Server Software:        nginx/0.7.65  
  4. Server Hostname:        192.168.1.106  
  5. Server Port:            80  
  6.   
  7. Document Path:          /filesystem_benckmark/nfs/big.jpg  
  8. Document Length:        398102 bytes  
  9.   
  10. Concurrency Level:      100  
  11. Time taken for tests:   1.510 seconds  
  12. Complete requests:      1000  
  13. Failed requests:        0  
  14. Write errors:           0  
  15.   
  16. Total transferred:      398317000 bytes  
  17. HTML transferred:       398102000 bytes  
  18. Requests per second:    662.46 [#/sec] (mean)  
  19. Time per request:       150.952 [ms] (mean)  
  20. Time per request:       1.510 [ms] (mean, across all concurrent requests)  
  21. Transfer rate:          257684.67 [Kbytes/sec] received  
  22.   
  23. Connection Times (ms)  
  24.               min  mean[+/-sd] median   max  
  25. Connect:        0    1   1.1      0      10  
  26. Processing:    12  147  43.8    148     326  
  27. Waiting:        1   62  29.6     59     159  
  28. Total:         12  147  44.1    148     329  
  29.   
  30. Percentage of the requests served within a certain time (ms)  
  31.   50%    148  
  32.   66%    164  
  33.   75%    172  
  34.   80%    177  
  35.   90%    200  
  36.   95%    228  
  37.   98%    249  
  38.   99%    264  
  39.  100%    329 (longest request)  

MFS测试结果:

view plain copy to clipboard print ?
  1. #ab -c 100 -n 1000 http://192.168.1.106/filesystem_benckmark/mfs/big.jpg  
  2.   
  3. Server Software:        nginx/0.7.65  
  4. Server Hostname:        192.168.1.106  
  5. Server Port:            80  
  6.   
  7. Document Path:          /filesystem_benckmark/mfs/big.jpg  
  8. Document Length:        398102 bytes  
  9.   
  10. Concurrency Level:      100  
  11. Time taken for tests:   0.721 seconds  
  12. Complete requests:      1000  
  13. Failed requests:        0  
  14. Write errors:           0  
  15.   
  16. Total transferred:      401711927 bytes  
  17. HTML transferred:       401494992 bytes  
  18. Requests per second:    1386.30 [#/sec] (mean)  
  19. Time per request:       72.135 [ms] (mean)  
  20. Time per request:       0.721 [ms] (mean, across all concurrent requests)  
  21. Transfer rate:          543840.75 [Kbytes/sec] received  
  22.   
  23. Connection Times (ms)  
  24.               min  mean[+/-sd] median   max  
  25. Connect:        0    2   1.4      2      13  
  26. Processing:    31   68  11.8     68      96  
  27. Waiting:        1   11   8.5      9      33  
  28. Total:         33   70  11.8     70      97  
  29.   
  30. Percentage of the requests served within a certain time (ms)  
  31.   50%     70  
  32.   66%     73  
  33.   75%     75  
  34.   80%     76  
  35.   90%     87  
  36.   95%     91  
  37.   98%     95  
  38.   99%     96  
  39.  100%     97 (longest request)  

 

从以上测试可以看出MooseFS在读性能上还是完胜NFS的, 为NFS的200%


大文件read测试

测试的文件为5.6M的二进制文件

NFS测试结果:

view plain copy to clipboard print ?
  1. #ab -c 10 -n 100 http://192.168.1.106/filesystem_benckmark/nfs/production-20100326.log.tar.gz  
  2.   
  3. Concurrency Level:      10  
  4. Time taken for tests:   2.156 seconds  
  5. Complete requests:      100  
  6. Failed requests:        0  
  7. Write errors:           0  
  8. Total transferred:      591628100 bytes  
  9. HTML transferred:       591605100 bytes  
  10. Requests per second:    46.38 [#/sec] (mean)  
  11. Time per request:       215.603 [ms] (mean)  
  12. Time per request:       21.560 [ms] (mean, across all concurrent requests)  
  13. Transfer rate:          267974.85 [Kbytes/sec] received  
  14.   
  15. Connection Times (ms)  
  16.               min  mean[+/-sd] median   max  
  17. Connect:        0    0   0.7      0       5  
  18. Processing:    17  211 110.5    215     480  
  19. Waiting:        1   12  10.4      9      64  
  20. Total:         17  211 110.6    215     481  
  21.   
  22. Percentage of the requests served within a certain time (ms)  
  23.   50%    215  
  24.   66%    261  
  25.   75%    287  
  26.   80%    305  
  27.   90%    340  
  28.   95%    387  
  29.   98%    474  
  30.   99%    481  
  31.  100%    481 (longest request)  

MFS测试结果:

view plain copy to clipboard print ?
  1. #ab -c 10 -n 100 http://192.168.1.106/filesystem_benckmark/mfs/production-20100326.log.tar.gz  
  2.   
  3. Concurrency Level:      10  
  4. Time taken for tests:   0.671 seconds  
  5. Complete requests:      100  
  6. Failed requests:        0  
  7. Write errors:           0  
  8. Total transferred:      591628100 bytes  
  9. HTML transferred:       591605100 bytes  
  10. Requests per second:    149.06 [#/sec] (mean)  
  11. Time per request:       67.089 [ms] (mean)  
  12. Time per request:       6.709 [ms] (mean, across all concurrent requests)  
  13. Transfer rate:          861190.96 [Kbytes/sec] received  
  14.   
  15. Connection Times (ms)  
  16.               min  mean[+/-sd] median   max  
  17. Connect:        0    0   0.1      0       1  
  18. Processing:    50   65   9.8     63      93  
  19. Waiting:        0    2   1.0      1       4  
  20. Total:         50   65   9.8     63      93  
  21. WARNING: The median and mean for the waiting time are not within a normal deviation  
  22.         These results are probably not that reliable.  
  23.   
  24. Percentage of the requests served within a certain time (ms)  
  25.   50%     63  
  26.   66%     68  
  27.   75%     71  
  28.   80%     73  
  29.   90%     76  
  30.   95%     88  
  31.   98%     91  
  32.   99%     93  
  33.  100%     93 (longest request)  

在大文件的读取上MFS更是表现明显, 性能为NFS的300%


write测试

写测试这里使用了dd方法, 写入数据大小为100M

NFS write

view plain copy to clipboard print ?
  1. #time dd if=/dev/zero of=sometestfile bs=1024 count=100000  
  2. 100000+0 records in  
  3. 100000+0 records out  
  4. 102400000 bytes transferred in 8.829279 secs (11597776 bytes/sec)  
  5.         8.91 real         0.10 user         3.39 sys  

MFS write

view plain copy to clipboard print ?
  1. #time dd if=/dev/zero of=sometestfile bs=1024 count=100000  
  2. 100000+0 records in  
  3. 100000+0 records out  
  4. 102400000 bytes transferred in 6.531960 secs (15676765 bytes/sec)  
  5.         8.81 real         0.12 user         2.56 sys  

可以看出MFS的写性能达到了百兆网卡的全速(14Mb/s), NFS为11Mb/s, 在时间上也可以看出MFS的优势, 再加上MooseFS的分布式存储和容错功能, 的确非常不错

对于单目录下存在大量文件时单个文件查找和操作仍需要测试,待续


你可能感兴趣的:(服务器安全,维护,服务器)