跳转到主内容

为什么小文件与大文件的文件传输速度可能不同

Views:
351
Visibility:
Public
Votes:
0
Category:
ontap-9
Specialty:
nas
Last Updated:

适用场景

  • ONTAP 9
  • 集群模式 Data ONTAP 8
  • 7-模式 Data ONTAP

问题解答

  • 将许多小文件复制到某个位置所需的时间比将几个大文件复制到同一位置所需的时间长、这些文件的总大小等于这些小文件的大小。这是一个众所周知、但人们很少了解的基于主机的文件系统性能问题描述。
  • 对于所有主要操作系统、尝试读取或写入大量小文件会产生大量操作系统开销。这是因为在操作系统级别上花费了更多的时间对正在处理的每个文件执行find()、open()和Close()操作。
  • 虽然这些操作不一定需要花费大量时间来处理单个文件、但在处理数百或数千个小文件时、它们可以快速进行机架安装。执行备份、还原、病毒扫描等活动时会出现这些问题... 与读取或写入数据相比、使用4K等小型文件、您可以将更多的时间用于查找、打开和关闭文件。
  • 一旦操作系统在文件系统中找到文件、然后打开该文件、即开始读/写该文件的内容并与存储阵列进行通信。这就是从存储阵列性能角度看一切都正常的原因。
  • 阵列对操作系统发出的读/写请求响应非常快在这些情况下、更快的CPU和最低延迟的磁盘会有所帮助、但您永远无法真正消除问题描述。即使将所有文件存储在SSD或基于RAM的磁盘上、操作系统仍必须对每个文件执行所有系统调用。
  • 对于较大的文件、上面发现的打开和关闭操作仍然存在、但由于文件数量较少、完成这些访问部分所需的时间会减少、而实际读/写所需的时间会增加。

追加信息

Microsoft知识库 正在对小型文件的写入性能进行过缓慢的处理

 

NetApp provides no representations or warranties regarding the accuracy or reliability or serviceability of any information or recommendations provided in this publication or with respect to any results that may be obtained by the use of the information or observance of any recommendations provided herein. The information in this document is distributed AS IS and the use of this information or the implementation of any recommendations or techniques herein is a customer's responsibility and depends on the customer's ability to evaluate and integrate them into the customer's operational environment. This document and the information contained herein may be used solely in connection with the NetApp products discussed in this document.