elasticDynamoDb 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +6 -0
- data/LICENSE +1 -1
- data/README.md +69 -20
- data/lib/elasticDynamoDb.rb +1 -1
- data/lib/elasticDynamoDb/cli.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8baeb9d2c175b91ff32718de888e86608a0be7d6
|
4
|
+
data.tar.gz: 83d8e6ef64b4d19cc8e9774f900d15f557123d42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 024bc5ce5897b77f65087d55b29ec61490ae3ff11fbbb861c72d8934267f3f471ff7eace9ad9dffe474992afc3134050036f679250705ff17cf038050e0ec4d5
|
7
|
+
data.tar.gz: 090c15bfd2b9b4e000bbbf7b9e1f4dc99616d327c2e977d52f3bac4ed38de74821c62e38f82e40128235cc666f3d141cd753604f1f78821f1775e22c206c327d
|
data/CHANGES.md
CHANGED
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,39 +1,88 @@
|
|
1
1
|
## Elastic DynamoDb [![Gem Version](https://badge.fury.io/rb/elasticDynamoDb.svg)](http://badge.fury.io/rb/elasticDynamoDb)
|
2
2
|
|
3
|
-
|
3
|
+
a wrapper tool to help with large planned traffic spike in combination with [dynamic-dynamodb](https://github.com/sebdah/dynamic-dynamodb)
|
4
4
|
|
5
|
-
[dynamic-dynamodb](https://github.com/sebdah/dynamic-dynamodb) tool is great for autoscaling but it has a few limitation:
|
6
5
|
|
7
|
-
|
6
|
+
[dynamic-dynamodb](https://github.com/sebdah/dynamic-dynamodb) tool is great for autoscaling but it has a few limitation:
|
8
7
|
|
9
8
|
* it does not accomodate for anticipated traffic spike that can last X hours
|
10
9
|
|
10
|
+
* it does not scale down at once to a certain value:
|
11
|
+
becasue of the settings you gave it in the config file dynamic-dynamodb will decrease in percentages and you might get stuck with the AWS limit of no more than 4 decreases per 24 hours)
|
11
12
|
|
12
|
-
ElasticDynamoDb is intended to extend the functionality of dynamic-dynamodb, allowing you to scale by a factor (up/down) and elastically return to the original values it had before
|
13
13
|
|
14
|
-
|
14
|
+
## Real example:
|
15
15
|
|
16
|
-
|
17
|
-
|
16
|
+
It's 10PM you know there's a planned marketing campaign of 4x the normal traffic that will start at 3AM and will last until 5AM
|
17
|
+
|
18
|
+
You can launch elastic dynamodb as follow:
|
18
19
|
|
19
|
-
Usage:
|
20
20
|
````bash
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
21
|
+
elasticDynamoDb --factor 4 \
|
22
|
+
--config-file '../dynamic-dynamodb.conf' \
|
23
|
+
--stop-cmd 'stop dynamic-dyanmodb' \
|
24
|
+
--start-cmd 'start dynamic-dyanmodb' \
|
25
|
+
--start-timer 300 \
|
26
|
+
--schedule-restore 420
|
27
27
|
````
|
28
28
|
|
29
|
+
breakdown:
|
30
|
+
|
31
|
+
* factor
|
32
|
+
<br /> reads the current values off dyanmic-dynamodb.conf and scale the minimum for reads / writes by 4
|
33
|
+
|
34
|
+
* conifg-file <br /> is the location for the dynamic-dynamodb.conf file
|
35
|
+
|
36
|
+
* stop-cmd <br /> the command that will stop dynamic-dyanmodb process
|
37
|
+
|
38
|
+
* start-cmd <br /> the command that will start dynamic-dyanmodb process
|
39
|
+
|
40
|
+
* start-timer <br /> when to start the elasticDynamoDb operation (in 5 hours => 5 * 60 = 300 minutes)
|
41
|
+
* schedule-restore <br /> when to restore back to the original values before this scale (in 7 hours => 7 * 60 = 420 minutes)
|
42
|
+
|
43
|
+
##Notes:
|
44
|
+
|
45
|
+
--factor
|
46
|
+
can be decimal points for down scale - i.e 0.25 is 4x less the current values of the config file
|
47
|
+
|
48
|
+
--working-dir
|
49
|
+
the process logs the changes to the tables in a folder called ElasticDynamoDB in your home folder, if you need to change that location for that folder use --working-dir
|
50
|
+
|
51
|
+
this is also the place where the config file is backed up to
|
52
|
+
|
53
|
+
--local
|
54
|
+
enable testing on [DynamoDbLocal] (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tools.DynamoDBLocal.html#Tools.DynamoDBLocal.DownloadingAndRunning)
|
55
|
+
|
56
|
+
this changes the throuput of tables but:
|
57
|
+
>DynamoDB Local ignores provisioned throughput settings, even though the API requires them. For CreateTable, you can specify any numbers you want for provisioned read and write throughput, even though these numbers will not be used. You can call UpdateTable as many times as you like per day; however, any changes to provisioned throughput values are ignored.
|
58
|
+
|
59
|
+
--start-cmd / --stop-cmd [optional] stop and start dynamic-dyanmodb so that it doesn't intrrupt with the scale activity of ElasticDynamoDb
|
60
|
+
|
61
|
+
-- start-time / --schdeule-restore [optional] both or each separatly can be called
|
62
|
+
|
63
|
+
|
64
|
+
## Installation
|
65
|
+
$ gem install elasticDynamoDb
|
66
|
+
|
29
67
|
````text
|
68
|
+
Usage: elasticDynamoDb
|
69
|
+
|
70
|
+
Commands:
|
71
|
+
elasticDynamoDb # Ease autoscale by schedule or scale factor
|
72
|
+
elasticDynamoDb version # version
|
73
|
+
|
30
74
|
Options:
|
31
|
-
--
|
32
|
-
--
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
75
|
+
--factor scale factor can be decimal too 0.5 for instance
|
76
|
+
--config-file location of dynamic-dynamodb.conf
|
77
|
+
--working-dir location for backup config and change log # Default: User home folder (~)
|
78
|
+
|
79
|
+
--stop-cmd Bash stop command for dynamic-dynamodb service (must be wrapped in quotes)
|
80
|
+
--start-cmd bash start command for dynamic-dynamodb service (must be wrapped in quotes)
|
81
|
+
|
82
|
+
--start-timer when to start the upscale automatically! value in minutes
|
83
|
+
--schedule-restore number of minutes for ElasticDynamoDb to restore original values
|
84
|
+
|
85
|
+
--local, [--no-local] # run on DynamoDBLocal
|
37
86
|
````
|
38
87
|
|
39
88
|
## Contributing
|
data/lib/elasticDynamoDb.rb
CHANGED
data/lib/elasticDynamoDb/cli.rb
CHANGED
@@ -131,8 +131,8 @@ private
|
|
131
131
|
say("Current min-read from #{options[:config_file]}: #{min_reads}")
|
132
132
|
say("Current min-write from #{options[:config_file]}: #{min_writes}")
|
133
133
|
|
134
|
-
self.config[prefix]['min-provisioned-reads'] = (min_reads * scale_factor).
|
135
|
-
self.config[prefix]['min-provisioned-writes'] = (min_writes * scale_factor).
|
134
|
+
self.config[prefix]['min-provisioned-reads'] = (min_reads * scale_factor).ciel
|
135
|
+
self.config[prefix]['min-provisioned-writes'] = (min_writes * scale_factor).ciel
|
136
136
|
|
137
137
|
say("New min reads: #{self.config[prefix]['min-provisioned-reads']}", color=:yellow)
|
138
138
|
say("New min writes: #{self.config[prefix]['min-provisioned-writes']}", color=:yellow)
|