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

QoS #262

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

QoS #262

wants to merge 9 commits into from

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