Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

always-decrease-rw-together = true ignored #302

Open
doodoori2 opened this issue Jun 4, 2016 · 2 comments
Open

always-decrease-rw-together = true ignored #302

doodoori2 opened this issue Jun 4, 2016 · 2 comments

Comments

@doodoori2
Copy link

doodoori2 commented Jun 4, 2016

Hello
I'm using dynamic_dynamodb-2.2.1
always-decrease-rw-together = true ignored..
and it decrease read and write seperately.
consume decrease opportunity 2 times.

reads-lower-threshold: 40
decrease-reads-with: 25
decrease-reads-unit: percent
num-read-checks-before-scale-down = 10
num-read-checks-reset-percent = 80

writes-lower-threshold: 40
decrease-writes-with: 25
decrease-writes-unit: percent
num-write-checks-before-scale-down = 10
num-write-checks-reset-percent = 80

allow-scaling-down-reads-on-0-percent: false
allow-scaling-down-writes-on-0-percent: false
always-decrease-rw-together: true

more config (gist)

Changing provisioning to 3572 read units and 6500 write units
Updating provisioning to 3572 reads and 6500 writes

...

Consecutive read checks 9/10
Consecutive write checks 10/10
Changing provisioning to 3572 read units and 4875 write units
Updating provisioning to 3572 reads and 4875 writes

...

Consecutive read checks 10/10
Consecutive write checks 0/10
Changing provisioning to 2679 read units and 4875 write units
Updating provisioning to 2679 reads and 4875 writes

more log(gist)

@mnietz
Copy link

mnietz commented Jul 19, 2016

Same here.

@reidfaiv
Copy link

reidfaiv commented Sep 6, 2016

Quick look on code: https://github.com/sebdah/dynamic-dynamodb/blob/master/dynamic_dynamodb/core/table.py#L102

The following code seems to cause it:

def __calculate_always_decrease_rw_values( ... ):
...
    if read_units <= provisioned_reads and write_units <= provisioned_writes:
        return (read_units, write_units)

and it should be instead:

    if read_units < provisioned_reads and write_units < provisioned_writes:
        return (read_units, write_units)

It appears it was like this before, but was changed by following commit: b4b1bc1
Based on this commit comment, its intention was to fix the case when either one read or write was already on lower limit and couldn't be scaled down any further. Probably code should compare against min-provisioned-reads and min-provisioned-writes values instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants