扩展DTU [英] Scaling DTU

查看:47
本文介绍了扩展DTU的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Azure SQL数据库,它运行在200 DTU。我们每天凌晨4点开始运行维护脚本来重建索引等,这大大降低了我们的DTU使用率。

I have a Azure SQL database which is running at 200 DTU. We've started running maintenance scripts to rebuild indexes etc. each morning at 4am which has significantly reduced our DTU usage.

如果我现在查看门户网站中显示的资源利用率图表"使用Max DTU"那么当我们在凌晨4点运行维护脚本时,最高值是47.71。通常,最大值约为20 DTU,然后平均值约为3 DTU。

If I now look at the resource utilization graph in the portal showing "Max DTU Used" then the highest value is 47.71 outside of when we run the maintenance scripts at 4am. Typically the max is around 20 DTU and then average is around 3 DTU.

显示的最大值是否始终正确?因此,我认为如果我将数据库缩减到50 DTU,对我的数据库性能没有任何影响,除非我们在凌晨4点运行维护脚本时出错

Is the max value shown always correct? Therefore, am I correct in thinking that if I scale the DB down to 50 DTU there will be no impact on my database performance except for when we run the maintenance scripts at 4am? 

推荐答案

你好,



而不是依靠DTU图,我建议你从sys.dm_db_resource_stats收集信息,并可能存储它来分析它。下面是一个例子:

 

DECLARE
@s datetime;  

DECLARE @s datetime; 

DECLARE
@e datetime;  

DECLARE @e datetime; 

SET
@ s = DateAdd(分钟,
- 5 ,GetUTCDate());  

SET @s= DateAdd(minute,-5,GetUTCDate()); 

SET
@ e = GETUTCDATE();

SELECT

  end_time
AS [EndTime]

 end_time AS [EndTime]

 
,(
SELECT
Max(v)
FROM VALUES
(avg_cpu_percent),(avg_data_io_percent),(avg_log_write_percent))
AS
value(v))
AS [AvgDTU_Percent]  

  , (SELECT Max(v) FROM (VALUES (avg_cpu_percent), (avg_data_io_percent), (avg_log_write_percent)) AS value(v)) AS [AvgDTU_Percent] 

 
,((dtu_limit)*((
SELECT
Max(v)
FROM VALUES
(avg_cpu_percent),(avg_data_io_percent),( avg_log_write_percent))
AS
value(v))/
100.00 ))
AS [AvgDTUsUsed]

  , ((dtu_limit)*((SELECT Max(v) FROM (VALUES (avg_cpu_percent), (avg_data_io_percent), (avg_log_write_percent)) AS value(v))/100.00)) AS [AvgDTUsUsed]

 
,dtu_limit
AS
[DTULimit]

  , dtu_limit AS [DTULimit]

FROM
sys.dm_db_resource_stats

WHERE
end_time
BETWEEN
@s
AND
@e

 

我的建议是尝试识别使用模式,并在此基础上尝试建立
a时间表,以便何时自动化数据库的缩放/缩小,并节省资金。



 

希望这会有所帮助。



问候,

Alberto Morillo

SQLCoffee.com


 
Hope this helps.

Regards,
Alberto Morillo
SQLCoffee.com

 


这篇关于扩展DTU的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆