简体   繁体   English

Azure SQL 数据库“DTU 百分比”指标

[英]Azure SQL Database “DTU percentage” metric

With the new Azure SQL Database tier structure , it seems important to monitor your database "DTU" usage to know whether to upgrade or downgrade to another tier.使用新的Azure SQL 数据库层结构,监视数据库“DTU”使用情况以了解是升级还是降级到另一层似乎很重要。

When reading Azure SQL Database Service Tiers and Performance Levels , it only talks about monitoring with CPU, Data and Log percentage usage.在阅读Azure SQL Database Service Tiers and Performance Levels 时,它只讨论监控 CPU、数据和日志百分比使用情况。

But, when I add new metrics, I also have an DTU percentage option:但是,当我添加新指标时,我还有一个DTU 百分比选项:

添加数据库指标

I can't find any about this online.我在网上找不到任何关于此的信息。 Is this essentially a summary of the other DTU-related metrics?这本质上是其他 DTU 相关指标的摘要吗?

A DTU is a unit of measure for the performance of a service tier and is a summary of several database characteristics. DTU 是衡量服务层性能的单位,是几个数据库特征的汇总。 Each service tier has a certain number of DTUs assigned to it as an easy way to compare the performance level of one tier versus another.每个服务层都有一定数量的 DTU 分配给它,作为比较一层与另一层性能水平的简单方法。

Database Throughput Unit (DTU): DTUs provide a way to describe the relative capacity of a performance level of Basic, Standard, and Premium databases. 数据库吞吐量单位 (DTU): DTU 提供了一种描述基本、标准和高级数据库性能级别的相对容量的方法。 DTUs are based on a blended measure of CPU, memory, reads, and writes. DTU 基于 CPU、内存、读取和写入的混合度量。 As DTUs increase, the power offered by the performance level increases.随着 DTU 的增加,性能级别提供的能力也会增加。 For example, a performance level with 5 DTUs has five times more power than a performance level with 1 DTU.例如,具有 5 个 DTU 的性能级别的功率是具有 1 个 DTU 的性能级别的五倍。 A maximum DTU quota applies to each server.最大 DTU 配额适用于每个服务器。

The DTU Quota applies to the server, not the individual databases and each server has a maximum of 1600 DTUs. DTU 配额适用于服务器,而不是单个数据库,每个服务器最多有 1600 个 DTU。 The DTU% is the percentage of units your particular database is using and it seems that this number can go over 100% of the DTU rating of the service tier (I assume to the limit of the server). DTU% 是您的特定数据库使用的单位百分比,这个数字似乎可以超过服务层的 DTU 评级的 100%(我假设是服务器的限制)。 This percentage number is designed to help you choose the appropriate service tier.此百分比数字旨在帮助您选择适当的服务层。

From down toward the bottom of this announcement : 本公告自下而上:

For example, if your DTU consumption shows a value of 80%, it indicates it is consuming DTU at the rate of 80% of the limit an S2 database would have.例如,如果您的 DTU 消耗显示值为 80%,则表明它正在以 S2 数据库限制的 80% 的速率消耗 DTU。 If you see values greater than 100% in this view it means that you need a performance tier larger than S2.如果您在此视图中看到大于 100% 的值,则意味着您需要一个大于 S2 的性能层。

As an example, let's say you see a percentage value of 300%.例如,假设您看到 300% 的百分比值。 This tells you that you are using three times more resources than would be available in an S2.这表明您使用的资源是 S2 中可用资源的三倍。 To determine a reasonable starting size, compare the DTUs available in an S2 (50 DTUs) with the next higher sizes (P1 = 100 DTUs, or 200% of S2, P2 = 200 DTUs or 400% of S2).要确定合理的起始大小,请将 S2 中可用的 DTU(50 个 DTU)与下一个更高的大小(P1 = 100 个 DTU,或 S2 的 200%,P2 = 200 个 DTU 或 S2 的 400%)进行比较。 Because you are at 300% of S2 you would want to start with a P2 and re-test.因为您处于 S2 的 300%,所以您希望从 P2 开始并重新测试。

Still not cool enough to comment, but regarding @vladislav's comment the original article was fairly old.仍然不够酷,无法发表评论,但关于@vladislav 的评论,原始文章相当陈旧。 Here is an update document regarding DTU's, which would help answer the OP's question.这是关于 DTU 的更新文档,它有助于回答 OP 的问题。

https://docs.microsoft.com/en-us/azure/sql-database/sql-database-what-is-a-dtu https://docs.microsoft.com/en-us/azure/sql-database/sql-database-what-is-a-dtu

From this document, this DTU percent is determined by this query:从本文档中,此 DTU 百分比由以下查询确定:

SELECT end_time,   
  (SELECT Max(v)    
   FROM (VALUES (avg_cpu_percent), (avg_data_io_percent), 
(avg_log_write_percent)) AS    
   value(v)) AS [avg_DTU_percent]   
FROM sys.dm_db_resource_stats;  

looks like the max of avg_cpu_percent , avg_data_io_percent and avg_log_write_percent看起来像avg_cpu_percentavg_data_io_percentavg_log_write_percent

Reference:参考:

https://docs.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-db-resource-stats-azure-sql-database https://docs.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-db-resource-stats-azure-sql-database

DTU is nothing but a blend of CPU, memory and IO. DTU 只不过是 CPU、内存和 IO 的混合体。 Why do we need a blend when these 3 are pretty clear?当这三个很清楚时,为什么我们需要混合? Because we want a unit for power.因为我们想要一个功率单位。 But it is still confusing in many ways.但它在许多方面仍然令人困惑。 eg: If I simply increase memory will it increase power(DTU)?例如:如果我只是增加内存会增加功率(DTU)吗? If yes, how can DTU be a blend?如果是,DTU 怎么可能是混合物? It is a yes.是的。 In this memory-increase case, as per the query in the answer given by jyong, DTU will be equivalent to memory(since we increased it).在这种内存增加的情况下,根据 jyong 给出的答案中的查询,DTU 将等同于内存(因为我们增加了它)。 MS has even a pricing model based on this DTU and it raised many questions. MS 甚至有一个基于这个 DTU 的定价模型,它提出了许多问题。

Because of these confusions and questions, MS wanted to bring in another option.由于这些困惑和问题,MS 想引入另一种选择。 We already had some specs in on-premise, why can't we use them?我们已经在内部部署了一些规范,为什么我们不能使用它们? As a result, 'vCore pricing model' was born.因此,“vCore 定价模型”应运而生。 In this model we have visibility to RAM and CPU.在这个模型中,我们可以看到 RAM 和 CPU。 But not in DTU model.但不是在 DTU 模型中。

The counter argument from DTU would be that DTU measures are calibrated using a benchmark that simulates real-world database workload. DTU 的反对意见是 DTU 测量是使用模拟真实世界数据库工作负载的基准进行校准的。 And that we are not in on-premise anymore ;).并且我们不再在内部部署;)。 Yes it is designed with cloud computing in mind(but is also used in OLTP workloads).是的,它的设计考虑到了云计算(但也用于 OLTP 工作负载)。

But that is not all.但这还不是全部。 Now that we are entering the pricing model the equation changes.现在我们正在进入定价模型,方程式发生了变化。 The question now is about money and the bundle(what all features are included).现在的问题是关于金钱和捆绑包(包括所有功能)。 Here DTU has some advantages(the way I see it) but enterprises with many existing licenses would disagree.在这里,DTU 有一些优势(在我看来),但拥有许多现有许可证的企业会不同意。

  • DTU has one pricing(Compute + Storage + Backup). DTU 有一个定价(计算 + 存储 + 备份)。 Simpler and can start with lower pricing.更简单,可以从较低的价格开始。
  • vCore has different pricing (Compute, Storage). vCore 有不同的定价(计算、存储)。 Software assurance is available here.此处提供软件保证。 Enterprises will have on-premise licenses, this can be easily ported here(so they get big machines for less price than DTU model).企业将拥有本地许可证,这可以很容易地移植到这里(因此他们以低于 DTU 模型的价格获得大型机器)。 Plus they commit for multiple years and get additional discounts.此外,他们承诺多年并获得额外折扣。

We can switch between both when needed so if not sure start with DTU(Basic/Standard/Premium).我们可以在需要时在两者之间切换,所以如果不确定从 DTU(基本/标准/高级)开始。

How can we know which pricing tier to use?我们如何知道要使用哪个定价层? Go to configure menu as given below: (on the right/left you can switch between both)转到如下所示的配置菜单:(在右侧/左侧,您可以在两者之间切换) 核心

数据单元

Even though Vcore is bigger 'machine' and for bigger things, the cost can sometimes be cheaper for enterprise organizations.尽管 Vcor​​e 是更大的“机器”并且对于更大的东西,对于企业组织来说,成本有时会更便宜。 Here is a proof.这是一个证明。 DTU costs $147 . DTU 成本 147 美元。 But Vcore costs $111.但 Vcor​​e 售价 111 美元。 That is because you can commit for 3 years(but still pay monthly) and also because of the license re-use option(enterprises will have on-premise licenses).那是因为您可以承诺 3 年(但仍需按月支付)以及许可证重用选项(企业将拥有本地许可证)。

成本 DTU

在此处输入图片说明

It is a bit too much than answering direct question but I am gonna go ahead and make this complete by answering 'how to choose between different options in DTU let alone choosing between DTU and vCore'.这比回答直接问题有点太多了,但我将继续回答“如何在 DTU 中的不同选项之间进行选择,更不用说在 DTU 和 vCore 之间进行选择”来完成这个问题。 This is answered in this beautiful blog and this flowchart explains it all这在这个美丽的博客中得到了回答,这个流程图解释了这一切

在此处输入图片说明

To check the accurate usage for your services be it is free (as per always free or 12 months free) or Pay-As-You-Go, it is important to monitor the usage so that you know upfront on the cost incurred or when to upgrade your service tier.要检查您的服务的准确使用情况,它是免费的(始终免费或 12 个月免费)还是现收现付,重要的是要监控使用情况,以便您预先知道所产生的费用或何时升级您的服务层。

To check your free service usage and its limits, Go to search in Portal, search with "Subscription" and click on it.要检查您的免费服务使用情况及其限制,请在门户中搜索,使用“订阅”进行搜索并单击它。 you will see the details of each service that you have used.您将看到您使用过的每项服务的详细信息。

In case of free azure from Microsoft, you get to see the cost incurred for each one.如果是 Microsoft 提供的免费 azure,您可以查看每个产品的费用。

Visit Check usage of free services included with your Azure free account访问检查 Azure 免费帐户中包含的免费服务的使用情况在此处输入图片说明

Hope this helps someone!希望这可以帮助某人!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM