流量管理器的性能注意事项Performance considerations for Traffic Manager

本页介绍使用流量管理器的性能注意事项。This page explains performance considerations using Traffic Manager. 请考虑下列方案:Consider the following scenario:

在中国北部和中国东部区域分别创建了网站的实例。You have instances of your website in the ChinaNorth and ChinaEast regions. 其中一个实例未通过流量管理器探测的运行状况检查。One of the instances is failing the health check for the traffic manager probe. 应用程序流量定向到正常的区域。Application traffic is directed to the healthy region. 这种故障转移是意料之中的,但由于流量现在要传送到远方区域,这种延迟会给性能造成问题。This failover is expected but performance can be a problem based on the latency of the traffic now traveling to a distant region.

流量管理器的性能注意事项Performance considerations for Traffic Manager

流量管理器对网站产生的唯一性能影响是初始 DNS 查找。The only performance impact that Traffic Manager can have on your website is the initial DNS lookup. 针对流量管理器配置文件名称发出的 DNS 请求由托管 trafficmanager.cn 区域的 Azure DNS 根服务器处理。A DNS request for the name of your Traffic Manager profile is handled by the Azure DNS root server that hosts the trafficmanager.cn zone. 流量管理器根据流量管理器策略和探测结果填充并定期更新世纪互联的 DNS 根服务器。Traffic Manager populates, and regularly updates, the 21Vianet's DNS root servers based on the Traffic Manager policy and the probe results. 因此,即使在初始 DNS 查找期间,也不会将 DNS 查询发送到流量管理器。So even during the initial DNS lookup, no DNS queries are sent to Traffic Manager.

流量管理器由多个组件构成:DNS 名称服务器、API 服务、存储层和终结点监视服务。Traffic Manager is made up of several components: DNS name servers, an API service, the storage layer, and an endpoint monitoring service. 如果流量管理器服务组件发生故障,与流量管理器配置文件关联的 DNS 名称不会受到影响。If a Traffic Manager service component fails, there is no effect on the DNS name associated with your Traffic Manager profile. Azure DNS 服务器中的记录将保持不变。The records in the Azure DNS servers remain unchanged. 但是,终结点监视和 DNS 更新不会发生。However, endpoint monitoring and DNS updating do not happen. 因此,当主站点关闭时,流量管理器无法将 DNS 更新为指向故障转移站点。Therefore, Traffic Manager is not able to update DNS to point to your failover site when your primary site goes down.

DNS 名称解析速度会加快,结果会被缓存。DNS name resolution is fast and results are cached. 初始 DNS 查找速度取决于客户端用于名称解析的 DNS 服务器。The speed of the initial DNS lookup depends on the DNS servers the client uses for name resolution. 通常,客户端可在大约 50 毫秒内完成一个 DNS 查找。Typically, a client can complete a DNS lookup within ~50 ms. 查找结果按照 DNS 生存时间 (TTL) 的持续时间缓存。The results of the lookup are cached for the duration of the DNS Time-to-live (TTL). 流量管理器的默认 TTL 为 300 秒。The default TTL for Traffic Manager is 300 seconds.

流量不会通过流量管理器。Traffic does NOT flow through Traffic Manager. 完成 DNS 查找后,客户端便获得了网站实例的 IP 地址。Once the DNS lookup completes, the client has an IP address for an instance of your web site. 客户端直接连接到该地址,而不通过流量管理器。The client connects directly to that address and does not pass through Traffic Manager. 选择的流量管理器策略对 DNS 性能没有影响。The Traffic Manager policy you choose has no influence on the DNS performance. 但是,“性能”路由方法可能会对应用程序体验产生负面影响。However, a Performance routing-method can negatively impact the application experience. 例如,如果策略将来自中国北部的流量重定向到中国东部托管的实例,这些会话的网络延迟可能会造成性能问题。For example, if your policy redirects traffic from China North to an instance hosted in China East, the network latency for those sessions may be a performance issue.

测量流量管理器性能Measuring Traffic Manager Performance

可以使用多个网站了解流量管理器配置文件的性能和行为。There are several websites you can use to understand the performance and behavior of a Traffic Manager profile. 其中的许多站点可以免费使用,但可能附带限制。Many of these sites are free but may have limitations. 某些站点以收费形式提供增强型监视和报告。Some sites offer enhanced monitoring and reporting for a fee.

这些站点上的工具可以测量 DNS 延迟,并显示中国各地客户端位置的已解析 IP 地址。The tools on these sites measure DNS latencies and display the resolved IP addresses for client locations around China. 其中的大多数工具不会缓存 DNS 结果。Most of these tools do not cache the DNS results. 因此,每次运行测试时,这些工具会显示完整的 DNS 查找。Therefore, the tools show the full DNS lookup each time a test is run. 从自己的客户端测试时,只能在 TTL 持续期间内体验完整的 DNS 查找性能一次。When you test from your own client, you only experience the full DNS lookup performance once during the TTL duration.

用于测量 DNS 性能的工具示例Sample tools to measure DNS performance

  • SolveDNSSolveDNS

    SolveDNS 提供许多性能工具。SolveDNS offers many performance tools. DNS Comparison 工具可以显示解析 DNS 名称花费的时间,以及该时间与使用其他 DNS 服务提供程序时花费的时间的对比。The DNS Comparison tool can show you how long it takes to resolve your DNS name and how that compares to other DNS service providers.

  • WebSitePulseWebSitePulse

    其中最简单的工具就是 WebSitePulse。One of the simplest tools is WebSitePulse. 输入 URL 即可查看 DNS 解析时间、第一个字节、最后一个字节和其他性能统计信息。Enter the URL to see DNS resolution time, First Byte, Last Byte, and other performance statistics. 可以从三个不同的测试位置中选择。You can choose from three different test locations. 在此示例中可以看到,第一次执行显示 DNS 查找花费了 0.204 秒。In this example, you see that the first execution shows that DNS lookup takes 0.204 sec.

    pulse1

    由于结果会缓存,针对同一个流量管理器终结点执行第二次测试时,DNS 查找仅花费了 0.002 秒。Because the results are cached, the second test for the same Traffic Manager endpoint the DNS lookup takes 0.002 sec.

    pulse2

  • CA App Synthetic MonitorCA App Synthetic Monitor

    以前称为 Watch-mouse Check Website Tool,此站点同时显示来自多个地理区域的 DNS 解析时间。Formerly known as the Watch-mouse Check Website tool, this site show you the DNS resolution time from multiple geographic regions simultaneously. 输入 URL 即可查看 DNS 解析时间、连接时间以及各个地理位置的连接速度。Enter the URL to see DNS resolution time, connection time, and speed from several geographic locations. 使用此测试可以查看针对中国不同位置返回了哪个托管服务。Use this test to see which hosted service is returned for different locations around China.

    pulse1

  • PingdomPingdom

    此工具提供网页上每个元素的性能统计信息。This tool provides performance statistics for each element of a web page. “Page Analysis”(页面分析)选项卡显示 DNS 查找花费的时间百分比。The Page Analysis tab shows the percentage of time spent on DNS lookup.

  • 我的 DNS 是什么?What's My DNS?

    此站点从 20 个不同的位置执行 DNS 查找,并在地图上显示结果。This site does a DNS lookup from 20 different locations and displays the results on a map.

  • 深入了解 Web 接口Dig Web Interface

    此站点显示更详细的 DNS 信息,包括 CNAME 和 A 记录。This site shows more detailed DNS information including CNAMEs and A records. 请确保在选项下选中“着色输出”和“统计信息”,并在 Nameservers 下选中“全部”。Make sure you check the 'Colorize output' and 'Stats' under options, and select 'All' under Nameservers.

后续步骤Next Steps

关于流量管理器流量路由方法About Traffic Manager traffic routing methods

测试流量管理器设置Test your Traffic Manager settings

流量管理器上的操作(REST API 参考)Operations on Traffic Manager (REST API Reference)

Azure 流量管理器 cmdletAzure Traffic Manager Cmdlets