Filesystem Performance Benchmarking

Filesystem Performance Benchmarking

Filesystem performance has a big impact on overall GitLab performance, especially for actions that read or write to Git repositories. This information will help benchmark filesystem performance against known good and bad real-world systems.

通常,在谈论文件系统性能时,最大的顾虑是网络文件系统(NFS). 但是,即使某些本地磁盘也可能具有缓慢的 I / O. 此页面上的信息可用于两种情况.

我们建议使用测试 I / O 性能. 该测试应该在 NFS 服务器和与 NFS 服务器通信的应用程序节点上都运行.

安装:

  • 在 Ubuntu 上: apt install fio .
  • yum管理的环境中: yum install fio .

这将在/path/to/git-data/testfile创建一个 4GB 的文件. 它使用文件中的 75%/ 25%的拆分来执行 4KB 读取和写入,一次运行 64 个操作. 测试完成后,请确保删除文件.

输出将根据所安装的fio版本而有所不同. 以下是网络固态驱动器(SSD)上fio v2.2.10 的输出示例:

  1. test: (g=0): rw=randrw, bs=4K-4K/4K-4K/4K-4K, ioengine=libaio, iodepth=64
  2. test: Laying out IO file(s) (1 file(s) / 1024MB)
  3. Jobs: 1 (f=1): [m(1)] [100.0% done] [131.4MB/44868KB/0KB /s] [33.7K/11.3K/0 iops] [eta 00m:00s]
  4. test: (groupid=0, jobs=1): err= 0: pid=10287: Sat Feb 2 17:40:10 2019
  5. read : io=784996KB, bw=133662KB/s, iops=33415, runt= 5873msec
  6. write: io=263580KB, bw=44880KB/s, iops=11219, runt= 5873msec
  7. cpu : usr=6.56%, sys=23.11%, ctx=266267, majf=0, minf=8
  8. IO depths : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.1%, 32=0.1%, >=64=100.0%
  9. submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
  10. complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.1%, >=64=0.0%
  11. Run status group 0 (all jobs):
  12. READ: io=784996KB, aggrb=133661KB/s, minb=133661KB/s, maxb=133661KB/s, mint=5873msec, maxt=5873msec
  13. WRITE: io=263580KB, aggrb=44879KB/s, minb=44879KB/s, maxb=44879KB/s, mint=5873msec, maxt=5873msec

注意此输出中的iops值. 在此示例中,SSD 每秒执行 33,415 次读操作和每秒 11,219 次写操作. 旋转磁盘可能每秒产生 2,000 和 700 的读取和写入操作.

Simple benchmarking

注意:此测试是幼稚的,但如果系统上没有fio可能有用. 在此测试中可能会收到不错的结果,但由于读取速度和其他各种因素,性能仍然很差.

  1. 更改为适当的的根目录.
  2. 为测试创建一个临时目录,以便以后轻松删除文件:

  3. 运行命令:

    1. time for i in {0..1000}; do echo 'test' > "test${i}.txt"; done
  4. 要测试读取性能,请运行以下命令:

  1. cd ../; rm -rf test

根据与多个客户的经验,此任务应花费 10 秒以表明文件系统性能良好.