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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 339c4f206bd73da9fdd595f61aa53fbfe8e52064
4
- data.tar.gz: ee1a49ee9881e9df6a8e03ae11ea1649fe371602
3
+ metadata.gz: 8baeb9d2c175b91ff32718de888e86608a0be7d6
4
+ data.tar.gz: 83d8e6ef64b4d19cc8e9774f900d15f557123d42
5
5
  SHA512:
6
- metadata.gz: 39f710fe5cf67fb2ba37a68defa3e495e8783f14b3a36738a9088856eafa0df7bc94545385db4b11d1e75277546efda7a7e0287eaaa88fe5fc3203ec5bf9125c
7
- data.tar.gz: 4d4be8515e9846d0a8e2ed2eff0daabc5f34dedce73ded5c23821f16d683bad5d7e79700192ebc6456ad636cc0f959edc163615e927c7641f35476e411b75baf
6
+ metadata.gz: 024bc5ce5897b77f65087d55b29ec61490ae3ff11fbbb861c72d8934267f3f471ff7eace9ad9dffe474992afc3134050036f679250705ff17cf038050e0ec4d5
7
+ data.tar.gz: 090c15bfd2b9b4e000bbbf7b9e1f4dc99616d327c2e977d52f3bac4ed38de74821c62e38f82e40128235cc666f3d141cd753604f1f78821f1775e22c206c327d
data/CHANGES.md CHANGED
@@ -1,3 +1,9 @@
1
+ 1.4.1
2
+ -----
3
+ fix issue of scaling incorrectly when using decimals for example
4
+ scale factor of 0.3 on a provisioned throuput of 1 would become 1 (using ciel)
5
+
6
+
1
7
  1.4.0
2
8
  -----
3
9
 
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2014 Glide Talk, LTD.
3
+ Copyright (c) 2014-2015 Glide Talk, LTD.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
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
- an OnDemand tool to help with auto scaling of [dynamic-dynamodb](https://github.com/sebdah/dynamic-dynamodb)
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
- * it does not scale down at once to a certain value
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
- it's possible to automate the start and stop of the dynamic-dyanmodb service by passing a bash command (wrapped in quotes) to the --start_cmd / --stop_cmd options
14
+ ## Real example:
15
15
 
16
- ## Installation
17
- $ gem install elasticDynamoDb
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
- elasticDynamoDb onDemand \
22
- --config-file /etc/dynamic-dynamodb.conf \
23
- --factor 2 \
24
- --schedule-restore 120
25
- --start_cmd "sudo start dynamic-dynamodb" \
26
- --stop_cmd "sudo stop dynamic-dynamodb"
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 />&nbsp;&nbsp;&nbsp;reads the current values off dyanmic-dynamodb.conf and scale the minimum for reads / writes by 4
33
+
34
+ * conifg-file <br />&nbsp;&nbsp;&nbsp; is the location for the dynamic-dynamodb.conf file
35
+
36
+ * stop-cmd <br />&nbsp;&nbsp;&nbsp;the command that will stop dynamic-dyanmodb process
37
+
38
+ * start-cmd <br />&nbsp;&nbsp;&nbsp;the command that will start dynamic-dyanmodb process
39
+
40
+ * start-timer <br />&nbsp;&nbsp;&nbsp;when to start the elasticDynamoDb operation (in 5 hours => 5 * 60 = 300 minutes)
41
+ * schedule-restore <br />&nbsp;&nbsp;&nbsp;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
- --config-file = Location of dynamic-dynamodb.conf
32
- --factor = Scale factor can be decimal too 0.5 for instance
33
- [--schedule-restore = Number of minutes for ElasticDynamoDb to restore original values] # Default: 0 (No restore)
34
- [--working-dir = Location for backup config and change log [default current dir]]
35
- [--stop-cmd = Bash stop command for dynamic-dynamodb service] (must be wrapped in quotes)
36
- [--start-cmd = Bash start command for dynamic-dynamodb service] (must be wrapped in quotes)
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
@@ -1,5 +1,5 @@
1
1
  module ElasticDynamoDb
2
- VERSION = "1.4.0"
2
+ VERSION = "1.4.1"
3
3
  ABOUT = "ElasticDynamoDb v#{VERSION} (c) #{Time.now.strftime("2014-%Y")} @innovia"
4
4
 
5
5
  autoload :Cli, 'elasticDynamoDb/cli'
@@ -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).to_i
135
- self.config[prefix]['min-provisioned-writes'] = (min_writes * scale_factor).to_i
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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elasticDynamoDb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ami Mahloof