Code Monkey home page Code Monkey logo

go-redisstore's Introduction

Hi there ๐Ÿ‘‹

I'm an engineer at Google. Previously I worked at HashiCorp, Chef Software, CustomInk, and some Pittsburgh-based startups.

  • ๐Ÿ’ฌ Ask me about: Go, Ruby
  • ๐Ÿ˜„ Pronouns: he/him
  • ๐ŸŒ Website

go-redisstore's People

Contributors

mehran-prs avatar sethvargo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

go-redisstore's Issues

Modifying rate limits "on the fly"

I noticed that if a key is getting constant Take requests, then the originally set rate limit for the key will never be overwritten, no matter a new Store was initialized with new limits. The original key should expire - not get traffic for 3 * original interval time - for the new limits to take effect. I'm wondering what's your take on this.

An example scenario:

  • Service is set to rate limit requests with a 100 req /sec rate limit.
  • There's a constant load on the service for key 'A'.
  • The team would like to increase it to 200 req /sec, related env vars are set, service is rebooted.
  • The change doesn't take effect for key 'A'.

I see there's a Set method that can be used to change the limits on the fly, but it feels like a bit of an overhead to call that for every request while we want to reset the limits only once.

I was wondering if we can make a rate limit check during Take and do a Set like action if they have been modified. This might have an unexpected side effect though if multiple versions of the service - having different rate limits - are live and constantly overwriting the rate limits during a rolling deployment.

Another idea was to expire the rate limit config (separately from the other data), so the new limits will take affect in e.g. in 3 * original interval time even if there's constant load. (For a rolling deployment it probably means 3 * original interval time after there's no old version of the service running.)

What do you think? Any other approaches you would suggest? I'm happy to contribute if there's a solution emerging.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.