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

Rate limits #113

Open
neSpecc opened this issue Jan 13, 2025 · 0 comments
Open

Rate limits #113

neSpecc opened this issue Jan 13, 2025 · 0 comments

Comments

@neSpecc
Copy link
Member

neSpecc commented Jan 13, 2025

Implement per-project rate limiter

Limitting

Max N events per T for Project 

N and T should be configurable. The best way is to include them to the Plans so each plan can have own values

Initially set these values:

N — 5000 events
T — 5 min

After T time passed, project should continue accept events.

Statistic

Collector should increment rate limited events counter of the project.

API should be able to get that data grouped by hour. We will use it to display them on the Project Events graph like this:

image

Questions:

  1. Where to store statistic? Mongo or Redis? Both Collector and Api should be able to access it
  2. How to store statistic? For example, we can store timestamp without minutes in Mongo — 1 record for 1 hour (workspace_id | project_id | timestamp-hourly | counter). Or key like rate-limited:workspaceId:<wid>:projectId:<pid>:<timestamp-hourly>. Or something other.
  3. Who should insert statistic? Collector itself or separate worker?
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

1 participant