How to create an alarm to detect limits DynamoDb reached a certain percentage, and then increase it

I am writing a web application that constantly increases traffic every other day. I would like to create an Alarm that can determine if my read / write limits have reached a certain percentage (for example, 80%), and then increased that limit. Then I will reduce it again at midnight.

I tried to create Alarm - "Average" seems a little useless and always 1.0. The "sum" is more useful, so I guess I should use it. I also suggest that I should use the value Consumed Write / Read Capacity for the metric name.

Problems:

  • Sum seems to use the absolute value of β€œCount” for its limits. If my DynamoDB is set to 100 records and I set the alarm to 80%, it checks if my record exceeds 0.8, not 80.

  • I installed the email subject, but this is not true. I assume that I need to create a function / controller that the theme can call. How would I install this, and if you have 2 Amazon VMs, will you receive a call or only one? Or is this the wrong route, and there is a standard action that can be taken at events to increase DynamoDB limits without coding anything. (my lack of SNS knowledge is probably shown here)

+4
source share
1 answer

When you start the Amazon wizard to create a table, it is suggested to create an alarm with a threshold of 80% and associate it with the SNS theme .

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

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

240 = 0.8*1*60*5 , i.e. capacity(1) * seconds_in_5_minutes(300) * threshold(0.8) . 60 minutes is a period of anxiety. You can reduce it to 5 minutes, but it can increase the number of false positives.

In other words, the alarm goes off every time when the sum of units of power consumed in the 5 min ranges exceeds 24 hours for at least 1 hour.

Note: 5 minutes corresponds to the sampling period.

In the SNS console, you can add ' subscribers ' to the theme. These can be email, HTTP (S) callbacks, ... This allows you to reach multiple people / machines.

Each time the scaling logic starts, you will need to use the API to automatically update alarms using this formula.

+7
source

Source: https://habr.com/ru/post/1435226/


All Articles