SMB 文件服务器的性能优化Performance tuning for SMB file servers

4/14/2017

本文内容

SMB 配置注意事项SMB configuration considerations

不要启用您的文件服务器和客户端不需要的任何服务或功能。Do not enable any services or features that your file server and clients do not require. 其中可能包括 SMB 签名、客户端缓存、文件系统小型筛选器、搜索服务、计划任务、NTFS 加密、NTFS 压缩、IPSEC、防火墙筛选器、Teredo 和 SMB 加密。These might include SMB signing, client-side caching, file system mini-filters, search service, scheduled tasks, NTFS encryption, NTFS compression, IPSEC, firewall filters, Teredo, and SMB encryption.

确保 BIOS 和操作系统电源管理模式按需要设置,这可能包括高性能模式或更改的 C 状态。Ensure that the BIOS and operating system power management modes are set as needed, which might include High Performance mode or altered C-State. 确保安装了最新、最灵活、最快的存储和网络设备驱动程序。Ensure that the latest, most resilient, and fastest storage and networking device drivers are installed.

复制文件是在文件服务器上执行的常见操作。Copying files is a common operation performed on a file server. Windows Server 具有多个可使用命令提示符运行的内置文件复制实用工具。Windows Server has several built-in file copy utilities that you can run by using a command prompt. 建议使用 Robocopy。Robocopy is recommended. 在 Windows Server 2008 R2 中引入, Robocopy 选项 Robocopy 可以在复制 多个小文件时使用多个线程显著提高远程文件传输速度。Introduced in Windows Server 2008 R2, the /mt option of Robocopy can significantly improve speed on remote file transfers by using multiple threads when copying multiple small files. 我们还建议使用 /log 选项,通过将日志重定向到 NUL 设备或文件来减少控制台输出。We also recommend using the /log option to reduce console output by redirecting logs to a NUL device or to a file. 使用 Xcopy 时,建议将 /q 和 /k 选项添加到现有参数中。When you use Xcopy, we recommend adding the /q and /k options to your existing parameters. 前者通过减少控制台输出降低了 CPU 开销,后者可减少网络流量。The former option reduces CPU overhead by reducing console output and the latter reduces network traffic.

SMB 性能优化SMB performance tuning

文件服务器性能和可用的 tunings 取决于在每个客户端和服务器之间协商的 SMB 协议,以及已部署的文件服务器功能。File server performance and available tunings depend on the SMB protocol that is negotiated between each client and the server, and on the deployed file server features. 当前可用的最高协议版本是 Windows Server 2016 和 Windows 10 中的 SMB 3.1.1。The highest protocol version currently available is SMB 3.1.1 in Windows Server 2016 and Windows 10. 可以通过在客户端上使用 Windows PowerShell SMBConnection和 SMBSession | 来检查网络上使用的 SMB 版本。 Get-SMBSession | FL服务器上的 FL。You can check which version of SMB is in use on your network by using Windows PowerShell Get-SMBConnection on clients and Get-SMBSession | FL on servers.

SMB 3.0 协议系列SMB 3.0 protocol family

SMB 3.0 在 Windows Server 2012 中引入,在 Windows Server 2012 R2 中进一步增强 (SMB 3.02) 和 Windows Server 2016 (SMB 3.1.1) 。SMB 3.0 was introduced in Windows Server 2012 and further enhanced in Windows Server 2012 R2 (SMB 3.02) and Windows Server 2016 (SMB 3.1.1). 此版本引入了可显著提高文件服务器性能和可用性的技术。This version introduced technologies that may significantly improve performance and availability of the file server.

SMB 直通SMB Direct

SMB Direct 引入了将 RDMA 网络接口用于高吞吐量、低延迟和低 CPU 使用率的能力。SMB Direct introduced the ability to use RDMA network interfaces for high throughput with low latency and low CPU utilization.

当 SMB 检测到支持 RDMA 功能的网络时,它会自动尝试使用 RDMA 功能。Whenever SMB detects an RDMA-capable network, it automatically tries to use the RDMA capability. 但是,如果出于任何原因,SMB 客户端无法使用 RDMA 路径进行连接,它将直接使用 TCP/IP 连接。However, if for any reason the SMB client fails to connect using the RDMA path, it will simply continue to use TCP/IP connections instead. 与 SMB 直通兼容的所有 RDMA 接口都需要实现 TCP/IP 堆栈,并且 SMB 多通道可感知到这一点。All RDMA interfaces that are compatible with SMB Direct are required to also implement a TCP/IP stack, and SMB Multichannel is aware of that.

Smb Direct 在任何 SMB 配置中都不是必需的,但对于那些希望降低延迟和 CPU 使用率较低的用户,始终建议使用 SMB 直通。SMB Direct is not required in any SMB configuration, but it' s always recommended for those who want lower latency and lower CPU utilization.

SMB 多通道SMB Multichannel

SMB 多通道允许文件服务器同时使用多个网络连接并提供更高的吞吐量。SMB Multichannel allows file servers to use multiple network connections simultaneously and provides increased throughput.

有关 SMB 多通道的详细信息,请参阅 部署 smb 多通道。For more info about SMB Multichannel, see Deploy SMB Multichannel.

SMB 横向扩展SMB Scale-Out

SMB 扩展允许群集配置中的 SMB 3.0 在群集的所有节点中显示共享。SMB Scale-out allows SMB 3.0 in a cluster configuration to show a share in all nodes of a cluster. 利用此主动/主动配置,可以进一步缩放文件服务器群集,而无需使用多个卷、共享和群集资源的复杂配置。This active/active configuration makes it possible to scale file server clusters further, without a complex configuration with multiple volumes, shares and cluster resources. 最大共享带宽是所有文件服务器群集节点的总带宽。The maximum share bandwidth is the total bandwidth of all file server cluster nodes. 总带宽不再受限于单个群集节点的带宽,而是取决于后备存储系统的容量。The total bandwidth is no longer limited by the bandwidth of a single cluster node, but rather depends on the capability of the backing storage system. 你可以通过添加节点来增加总带宽。You can increase the total bandwidth by adding nodes.

SMB 3.0 的性能计数器Performance counters for SMB 3.0

以下 SMB 性能计数器是在 Windows Server 2012 中引入的,并且在监视 SMB 2 和更高版本的资源使用情况时,它们被视为一组基本计数器。The following SMB performance counters were introduced in Windows Server 2012, and they are considered a base set of counters when you monitor the resource usage of SMB 2 and higher versions. 将性能计数器记录到本地原始 ( .blg) 性能计数器日志。Log the performance counters to a local, raw (.blg) performance counter log. 使用通配符 () 来收集所有实例的开销较低 * ,然后使用 Relog.exe 在后期处理过程中提取特定实例。It is less expensive to collect all instances by using the wildcard character (*), and then extract particular instances during post-processing by using Relog.exe.

SMB 客户端共享SMB Client Shares

这些计数器显示有关正在使用 SMB 2.0 或更高版本的客户端访问的服务器上的文件共享的信息。These counters display information about file shares on the server that are being accessed by a client that is using SMB 2.0 or higher versions.

如果你已熟悉 Windows 中的常规磁盘计数器,则可能会注意到某个相似性。If you' re familiar with the regular disk counters in Windows, you might notice a certain resemblance. 这不是意外情况。That' s not by accident. SMB 客户端共享性能计数器的设计与磁盘计数器完全匹配。The SMB client shares performance counters were designed to exactly match the disk counters. 这样一来,您就可以轻松地重复使用目前所用的应用程序磁盘性能优化指南。This way you can easily reuse any guidance on application disk performance tuning you currently have. 有关计数器映射的详细信息,请参阅 按共享客户端性能计数器博客。

SMB 服务器共享SMB Server Shares

这些计数器显示有关服务器上的 SMB 2.0 或更高版本的文件共享的信息。These counters display information about the SMB 2.0 or higher file shares on the server.

SMB 服务器会话SMB Server Sessions

这些计数器显示有关使用 SMB 2.0 或更高版本的 SMB 服务器会话的信息。These counters display information about SMB server sessions that are using SMB 2.0 or higher.

如果在服务器端 (服务器共享或服务器) 会话中打开计数器,则高 IO 工作负荷可能会对性能产生重大影响。Turning on counters on server side (server shares or server sessions) may have significant performance impact for high IO workloads.

继续密钥筛选器Resume Key Filter

这些计数器显示有关简历密钥筛选器的信息。These counters display information about the Resume Key Filter.

SMB 直接连接SMB Direct Connection

这些计数器衡量连接活动的不同方面。These counters measure different aspects of connection activity. 一台计算机可以具有多个 SMB 直接连接。A computer can have multiple SMB Direct connections. SMB 直接连接计数器将每个连接表示为一对 IP 地址和端口,其中,第一个 IP 地址和端口表示连接的本地终结点,第二个 IP 地址和端口表示连接的远程终结点。The SMB Direct Connection counters represent each connection as a pair of IP addresses and ports, where the first IP address and port represent the connection's local endpoint, and the second IP address and port represent the connection's remote endpoint.

物理磁盘、SMB、CSV FS 性能计数器关系Physical Disk, SMB, CSV FS performance counters relationships

有关物理磁盘、SMB 和 CSV FS (文件系统) 计数器如何相关的详细信息,请参阅以下博客文章: 群集共享卷性能计数器。For more info on how Physical Disk, SMB, and CSV FS (file system) counters are related, see the following blog post: Cluster Shared Volume Performance Counters.

SMB 文件服务器的优化参数Tuning parameters for SMB file servers

以下 REG _ DWORD 注册表设置可能会影响 SMB 文件服务器的性能:The following REG_DWORD registry settings can affect the performance of SMB file servers:

Smb2CreditsMin 和 smb2creditsmax 为Smb2CreditsMin and Smb2CreditsMax

HKLM\System\CurrentControlSet\Services\LanmanServer\Parameters\Smb2CreditsMin

HKLM\System\CurrentControlSet\Services\LanmanServer\Parameters\Smb2CreditsMax

默认值分别为512和8192。The defaults are 512 and 8192, respectively. 这些参数允许服务器在指定边界内动态地限制客户端操作并发。These parameters allow the server to throttle client operation concurrency dynamically within the specified boundaries. 某些客户端可能会提高吞吐量,增加并发限制,例如,通过高带宽、高延迟链路复制文件。Some clients might achieve increased throughput with higher concurrency limits, for example, copying files over high-bandwidth, high-latency links.

提示

在 Windows 10 和 Windows Server 2016 之前,根据网络延迟和信用使用情况,向客户端授予的信用额度将在 Smb2CreditsMin 和 Smb2creditsmax 为之间动态变化。Prior to Windows 10 and Windows Server 2016, the number of credits granted to the client varied dynamically between Smb2CreditsMin and Smb2CreditsMax based on an algorithm that attempted to determine the optimal number of credits to grant based on network latency and credit usage. 在 Windows 10 和 Windows Server 2016 中,SMB 服务器已更改为在请求达到配置的最大信用额度时无条件地授予信用额度。In Windows 10 and Windows Server 2016, the SMB server was changed to unconditionally grant credits upon request up to the configured maximum number of credits. 作为此更改的一部分,信用限制机制会在服务器处于内存压力下时减少每个连接的信用时段的大小。As part of this change, the credit throttling mechanism, which reduces the size of each connection's credit window when the server is under memory pressure, was removed. 触发限制的内核内存不足事件仅在服务器内存较低时发出信号 ( # A0 几 MB) 无法使用。The kernel's low memory event that triggered throttling is only signaled when the server is so low on memory (< a few MB) as to be useless. 由于服务器不再缩小信用时段,Smb2CreditsMin 设置不再是必需的,现已被忽略。Since the server no longer shrinks credit windows the Smb2CreditsMin setting is no longer necessary and is now ignored.

可以监视 SMB 客户端共享 \ 信用额度,以查看是否存在任何信用额度问题。You can monitor SMB Client Shares\Credit Stalls /Sec to see if there are any issues with credits.

AdditionalCriticalWorkerThreadsAdditionalCriticalWorkerThreads

HKLM\System\CurrentControlSet\Control\Session Manager\Executive\AdditionalCriticalWorkerThreads

默认值为0,表示不添加其他关键内核工作线程。The default is 0, which means that no additional critical kernel worker threads are added. 此值影响文件系统缓存用于预读和后写请求的线程数。This value affects the number of threads that the file system cache uses for read-ahead and write-behind requests. 如果引发此值,则可以在存储子系统中进行更多的排队 i/o,还可以提高 i/o 性能,尤其是在具有很多逻辑处理器和强大的存储硬件的系统上。Raising this value can allow for more queued I/O in the storage subsystem, and it can improve I/O performance, particularly on systems with many logical processors and powerful storage hardware.

提示

如果缓存管理器脏数据 (性能计数器缓存 \ 脏页) 的数量不断增长, (超过 ~ 25 ) % 的内存或系统正在执行大量同步读 i/o 操作,则可能需要增加此值。The value may need to be increased if the amount of cache manager dirty data (performance counter Cache\Dirty Pages) is growing to consume a large portion (over ~25%) of memory or if the system is doing lots of synchronous read I/Os.

MaxThreadsPerQueueMaxThreadsPerQueue

HKLM\System\CurrentControlSet\Services\LanmanServer\Parameters\MaxThreadsPerQueue

默认值为 20。The default is 20. 增加此值会引发文件服务器可用于为并发请求服务的线程数。Increasing this value raises the number of threads that the file server can use to service concurrent requests. 当需要为大量活动的连接提供服务,并且硬件资源(例如存储带宽)足够时,增加该值可以提高服务器的可伸缩性、性能和响应时间。When a large number of active connections need to be serviced, and hardware resources, such as storage bandwidth, are sufficient, increasing the value can improve server scalability, performance, and response times.

提示

指示可能需要增加值的情况是,如果 SMB2 工作队列增长得非常大 (性能计数器 "服务器工作队列 \ 队列长度 \ SMB2 非阻止性 * " 的大小一直低于 ~ 100) 。An indication that the value may need to be increased is if the SMB2 work queues are growing very large (performance counter ‘Server Work Queues\Queue Length\SMB2 NonBlocking *' is consistently above ~100).

备注

在 Windows 10 和 Windows Server 2016 中,MaxThreadsPerQueue 不可用。In Windows 10 and Windows Server 2016, MaxThreadsPerQueue is unavailable. 线程池的线程数将为 "20 * NUMA 节点中的处理器数"。The number of threads for a thread pool will be "20 * the number of processors in a NUMA node".

AsynchronousCreditsAsynchronousCredits

HKLM\System\CurrentControlSet\Services\LanmanServer\Parameters\AsynchronousCredits

默认值为 512。The default is 512. 此参数限制单个连接上允许的并发异步 SMB 命令数。This parameter limits the number of concurrent asynchronous SMB commands that are allowed on a single connection. 某些情况下 (例如,当存在具有后端 IIS 服务器的前端服务器时) 需要大量并发 (文件更改通知请求,尤其是) 。Some cases (such as when there is a front-end server with a back-end IIS server) require a large amount of concurrency (for file change notification requests, in particular). 此项的值可以增加以支持这些情况。The value of this entry can be increased to support these cases.

SMB 服务器优化示例SMB server tuning example

在许多情况下,以下设置可以优化计算机的文件服务器性能。The following settings can optimize a computer for file server performance in many cases. 所有计算机上的这些设置都不是最佳或最合适的。The settings are not optimal or appropriate on all computers. 应在应用各个设置之前评估其影响。You should evaluate the impact of individual settings before applying them.

参数Parameter

值Value

默认Default

AdditionalCriticalWorkerThreadsAdditionalCriticalWorkerThreads

6464

00

MaxThreadsPerQueueMaxThreadsPerQueue

6464

2020

SMB 客户端性能监视器计数器SMB client performance monitor counters

smb服务器速度测试_SMB 文件服务器的性能优化相关推荐

  1. smb服务器速度测试_通过 SMB 直通优化文件服务器的性能 | Microsoft Docs

    SMB 直通SMB Direct 04/05/2018 本文内容 适用于:Windows Server 2012 R2.Windows Server 2012.Windows Server 2016A ...

  2. 宝塔php并发500什么意思,宝塔bt面板服务器设置调整PHP最大并发性能优化设置方法方案...

    这篇文章主要为大家详细介绍了宝塔bt面板服务器设置调整PHP最大并发性能优化设置方法方案,具有一定的参考价值,感兴趣的小伙伴们可以参考一下,有需要的朋友可以收藏方便以后借鉴. 今天要给大家介绍的是宝塔 ...

  3. X86服务器虚拟化的资源划分和性能优化

    概述:虚拟化是一个广义术语,通常是指计算元件在虚拟的基础上而不是真实的基础上运行,是一个为了简化管理,优化资源的解决方案.服务器虚拟化则是一项用以整合基于x86服务器,来提高资源利用效率和性能的技术. ...

  4. ue4渲染速度太慢_[UE4]性能优化指南(程序向)

    封面来源:A Cold Stop(Mixer 制作材质.UE4渲染 ) [UE4]性能优化指南(美术向)玄冬Wong:[UE4]性能优化指南(美术向)​zhuanlan.zhihu.com 内容都是处 ...

  5. 服务器显示屏出现白屏,前端性能优化之白屏时间

    定场诗 曲木为直终必弯,养狼当犬看家难: 墨染鸬鹚黑不久,粉刷乌鸦白不天. 蜜饯黄莲终需苦,强摘瓜果不能甜: 好事总得善人做,哪有凡人做神仙. 前言 该篇文章会为您分享在前端性能优化中非常重要的一环- ...

  6. 让你页面速度飞起来 Web前端性能优化

    百度网盘下载 第1章 课程简介 对课程做简单的介绍. 第2章 资源合并与压缩 通过本章,我们学习和理解了web前端的概念,以及性能优化的意义所在,并且通过实战中的压缩与合并,深入理解了减少http请求 ...

  7. 网维大师系统虚拟盘控制台 网络中存在另外一台主服务器,网维大师系统虚拟盘性能优化及常见问题...

    网维大师系统虚拟盘性能优化及常见问题 性能优化及常见问题: ├─为什么客户机无法获取dhcp? ├─如何对网卡进行pnp? ├─如何对主板.显卡.声卡进行pnp? ├─客户机系统的页面文件(虚拟内存) ...

  8. PHP高性能编程-提高PHP速度-加速PHP执行-PHP性能优化实践

    1. 能用PHP数组完成的工作,绝不用文件形式来代替,数组是内存操作,内存操作速度对比文件操作快很多! 2. 判断一个数值是否在一个数组中,然后决定是否追加数组内容时,不推荐使用in_array或者a ...

  9. oracle游标速度很慢,oracle程序性能优化实录-关于游标打开超出最大数限制

    关于游标打开超出最大数限制,两个地方需要注意: 1.oracle程序包中,一般返回值是cursor,这个不用关闭. 但是中间用到的cursor必须关闭.如下例子: open result_cursor ...

最新文章

  1. visualstudio发布网站到服务器,发布到网站 - Visual Studio (Windows) | Microsoft Docs
  2. 练习5.1更新——四则运算 测试与封装
  3. 兰蔻御用运维总结之一
  4. python多线程处理文件_python多线程分块读取文件
  5. ElementUI中的el-form怎样格式化显示1和0为是和否
  6. ajax success function_Ajax封装
  7. Live555研究之二Sleep实现
  8. LeetCode 703. 数据流中的第K大元素(优先队列)
  9. C语言当中int,float,double,char这四个有什么区别?
  10. mysql 事务类型表的用法
  11. FEA-Net论文梳理
  12. 【大数据部落】基于LDA主题模型聚类的商品评论文本挖掘
  13. 学会计需要学计算机应用吗,会计都要学什么
  14. linux中ldd命令查看二进制文件(程序或库)所依赖的其他库(LIBTIFF_4.0未定义的引用问题)
  15. JAVA在线看CAD图纸快速入门
  16. Unmapped Spring configuration files found.Please configure Spring facet.”
  17. Vue项目-手机app瑞幸咖啡详解(全网最细) 从脚手架搭建到前后端数据交互(二)
  18. 描述linux shell中单引号,linux shell中单引号、双引号、反引号、反斜杠的区别
  19. ubuntu下使用 RabbitVCSRapidSVN
  20. html5如何快速选择工具,Photoshop教程:在PS中如何使用快速选择工具建立有效选区...

热门文章

  1. android 添加黄油刀,Android Butterknife 黄油刀的使用
  2. Mactalk里的池建强,约你来吗?
  3. CNN情感分析(文本分类)
  4. 如何写出优雅的java代码
  5. 相邻两球不同的三色球排列
  6. 2021年中国电子元件营收第一,揭秘立讯精密高质量发展之路
  7. 软件建模与分析【二】
  8. RH124-Linux系统中的软件管理
  9. 论文必备 | 12个神经网络可视化工具
  10. steps animation,极光下奔跑的熊