How do I create an Alarm to detect DynamoDb limits have reached a certain percent and then increase it

為{幸葍}努か 提交于 2019-12-19 19:50:27

问题


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.

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.

Problems:

  • 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.

  • 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)


回答1:


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.

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

  • ConsumedReadCapacityUnits >= 240 for 60 minutes
  • ConsumedWriteCapacityUnits >= 240 for 60 minutes

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.

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.

note: 5 min corresponds to the sampling period.

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.

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



来源:https://stackoverflow.com/questions/12508594/how-do-i-create-an-alarm-to-detect-dynamodb-limits-have-reached-a-certain-percen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!