Skip to content

QoS#262

Open
cannium wants to merge 9 commits intomasterfrom
qos
Open

QoS#262
cannium wants to merge 9 commits intomasterfrom
qos

Conversation

@cannium
Copy link
Contributor

@cannium cannium commented Mar 23, 2020

Throttle QPS and bandwidth by user.

  • "by user" means "overall operations to buckets owned by the user"
  • Added a table for per-user QoS configurations, "qos"
  • Cache user QoS configurations and bucket-user mappings in memory
  • Based on github.com/go-redis/redis_rate, prefix rate: should be reserved in Redis
  • For QPS limit, a middleware is added, return HTTP 429 if denied
  • For bandwidth limit, another reader/writer wrapper is added, block for some amount of time if throttled

@cannium cannium changed the title [WIP] QoS QoS Apr 2, 2020
}
}

// I believe it's OK to load all data into memory when user count < 10k, so...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

emmm...

Tons of useless output generated
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

Successfully merging this pull request may close these issues.

2 participants