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

config: increment default rate limiting #323

Merged
merged 1 commit into from
Nov 23, 2020

Conversation

diegodelemos
Copy link
Member

@diegodelemos diegodelemos changed the base branch from master to maint-0.7 November 23, 2020 13:52
@codecov-io
Copy link

codecov-io commented Nov 23, 2020

Codecov Report

Merging #323 (106b88c) into maint-0.7 (28454b9) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           maint-0.7     #323   +/-   ##
==========================================
  Coverage      54.37%   54.37%           
==========================================
  Files             17       17           
  Lines           1337     1337           
==========================================
  Hits             727      727           
  Misses           610      610           

@@ -116,6 +116,10 @@ def _(x):
APP_DEFAULT_SECURE_HEADERS["content_security_policy"] = {}
APP_HEALTH_BLUEPRINT_ENABLED = False

# Rate limiting configuration
# ===========================
RATELIMIT_ENABLED = False
Copy link
Member Author

@diegodelemos diegodelemos Nov 23, 2020

Choose a reason for hiding this comment

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

Currently hardcoding this value.. but actually, it would be interesting to make it configurable in case someone wants to adjust it. Some thoughts about it:

Limiting with Invenio-App/Flask-limiter:

Limiting with Traefik rate limiter:

  • Less-flexibility: We would have less granularity as doing it inside the application.
  • Closer to prod setup: It would be more similar to what we do in prod with HAProxy.
  • More harmony: the approach of rate-limiting inside the app wouldn't work for Interactive sessions (and future entities like them), Traefik would.

Not providing any in-cluster option to limit requests. Advice to use external service (like we do with HAProxy).

@@ -116,6 +116,11 @@ def _(x):
APP_DEFAULT_SECURE_HEADERS["content_security_policy"] = {}
APP_HEALTH_BLUEPRINT_ENABLED = False

# Rate limiting configuration
# ===========================
RATELIMIT_AUTHENTICATED_USER = "20 per second"
Copy link
Member

Choose a reason for hiding this comment

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

Please amend CHANGES.rst and say something like:

  • Changes rate limiting defaults to allow up to 20 connections per second.

CHANGES.rst Outdated
@@ -8,6 +8,8 @@ Version 0.7.1 (2020-11-10)
- Fixes restarting of Yadage and CWL workflows.
- Fixes conflicting ``kombu`` installation requirements by requiring Celery version 4.
- Changes ``/api/you`` endpoint to include REANA server version information.
- Changes rate limiting defaults to allow up to 20 connections per second.
Copy link
Member

Choose a reason for hiding this comment

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

Must go into a new section:

Version 0.7.2 (UNRELEASED)
--------------------------

- Changes rate limiting defaults to allow up to 20 connections per second.

Copy link
Member

@tiborsimko tiborsimko left a comment

Choose a reason for hiding this comment

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

Tested locally. The situations where I simulated rate limitations before:

File /LICENSE was successfully uploaded.
File /LICENSE was successfully uploaded.
File /LICENSE was successfully uploaded.
Something went wrong while uploading .../LICENSE:
60 per 1 minute
Something went wrong while uploading .../LICENSE:
60 per 1 minute
Something went wrong while uploading .../LICENSE:
60 per 1 minute
File /LICENSE was successfully uploaded.
File /LICENSE was successfully uploaded.
File /LICENSE was successfully uploaded.

are now passing fine 👍

@tiborsimko tiborsimko changed the title config: disable rate-limiting by default config: increment default rate limiting Nov 23, 2020
@tiborsimko tiborsimko merged commit 106b88c into reanahub:maint-0.7 Nov 23, 2020
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.

3 participants