如何创建警报以检测DynamoDb限制已达到一定百分比,然后将其增加 [英] How do I create an Alarm to detect DynamoDb limits have reached a certain percent and then increase it

查看:147
本文介绍了如何创建警报以检测DynamoDb限制已达到一定百分比,然后将其增加的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个网络应用程序,该应用程序在一天之中的流量一直在稳定增长。我想创建一个警报,该警报可以检测我的读/写限制是否已达到某个百分比(例如80%),然后增加该限制。然后,我将在午夜再次将其降低。

I'm writing a web application that has steadily increasing traffic through the day. I'd like to create an Alarm that can detect if my read / write limits have reached a certain percentage (like 80%), and then increase that limit. I will then decrease it again at midnight.

我尝试创建一个警报-平均似乎有点用处,始终为1.0。 Sum更有用,所以我认为我应该使用它。我还假设我应该在指标名称上使用消耗的写入/读取容量。

I've tried creating an Alarm - "Average" seems a bit useless and is always 1.0. "Sum" is more useful so I assume i should use this. I also assume i should use Consumed Write/Read Capacity at the metric name.

问题:


  • 总和似乎将绝对值 Count用作其限制。如果我的DynamoDB设置为100次写入,并且我设置了80%的警报,它将检查我的写入是否超过0.8,而不是80。

  • Sum seems to use an absolute value of "Count" for its limits. If my DynamoDB is set to 100 writes, and i setup an alarm for 80%, it checks if my writes exceed 0.8, not 80.

我已经设置一个电子邮件主题,但这是不正确的-我假设我需要创建一个可以调用该主题的函数/控制器。我将如何设置它,如果您有2个Amazon VM,两者都会被调用还是只有一个?还是这是一条错误的路线,并且可以对事件采取一种标准措施以增加DynamoDB限制而无需编写任何代码。 (我对SNS知识的缺乏可能在这里显示)

I've setup an email topic, but this is not correct - I assume I need to create a function/controller which a topic can call. How would i set this up and if you have 2 Amazon VM's, would both get called or just one? Or is this the wrong route and there is a standard action one can take on events to increase DynamoDB limits without coding anything. (my lack of SNS knowledge is probably showing here)

推荐答案

亚马逊的向导创建了一个表,它建议在 80%阈值处创建警报并将其链接到 SNS主题

When running Amazon's wizard to create a table, it suggests to create an alarm at 80% threshold and to link it to an SNS topic.

在引擎盖下,对于R / W容量为1,这会在以下情况上产生警报

Under the hood, for R/W capacity of 1, this creates an alarm on


  • ConsumedReadCapacityUnits> = 240 for 60分钟

  • ConsumedWriteCapacityUnits> = 240,持续60分钟

240 = 0.8 * 1 * 60 * 5 ,即容量(1)* seconds_in_5_minutes(300)*阈值(0.8)。警报时间为60分钟。您可以缩短至5分钟,但这可能会增加误报的次数。

240 = 0.8*1*60*5 that is to say, capacity(1) * seconds_in_5_minutes(300) * threshold(0.8). 60 minutes is the alarm period. You can shorten down to 5 min but this might increase the number of false positive.

换句话说,每当消耗容量单位为5分钟的范围超过24阈值至少1小时。

In other words, the alarm is triggered every time the sum of the consumed capacity units on ranges of 5 min exceeds the 24 treshold for at least 1 hour.

注意:5分钟对应于采样时间。

note: 5 min corresponds to the sampling period.

SNS 控制台,您可以在主题中添加 订户。它们可以是电子邮件,HTTP(S)回调... ...这使您可以联系多个人/机器。

In the SNS console, you can add 'subscribers' to a topic. They can be e-mails, HTTP(S) callbacks, ... This allow you to contact multiple human/machines.

每次触发扩展逻辑时,您将需要使用API​​使用此公式自动更新警报。

Every time your scaling logic is triggered, you will need to use the API to automatically update the alarms using this formula.

这篇关于如何创建警报以检测DynamoDb限制已达到一定百分比,然后将其增加的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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