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

AMQP Gateway rate limit #353

Closed
fayak opened this issue Sep 14, 2019 · 4 comments
Closed

AMQP Gateway rate limit #353

fayak opened this issue Sep 14, 2019 · 4 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@fayak
Copy link

fayak commented Sep 14, 2019

Is your feature request related to a problem? Please describe.
In the project I'm using argo in, I often get a batch of ~800events sent by an application I can't easily modify. The problem is that our Kubernetes cluster isn't able to handle all of these events simultaneously, but the Argo AMQP Gateway doesn't have to logic to determine the maximum number of events it may grab. Therefore, it fetches all messages available on rabbitmq, and indirectly kills our cluster with heavy load.

I thought of limiting the number of pod in the cluster with Kubernetes, but all exceeding events leads to a failure.

Describe the solution you'd like
To this problem, I reckon 2 available solutions :

  • Have an option in Argo to limit the number of simultaneous running workflow, and therefore have the gateway to not pull events from rabbitmq if it overflows this limit
  • Have an option in the AMQP gateway to define a rate limit and enforce it. It may look like something as "max number of event pulled by x unit of time"

Describe alternatives you've considered
The options I've thought of were;

  • max number of pods -> it make all exceeding workflows fail
  • parallelism option -> It doesn't exist at the "namespace" level
  • rate limit through rabbit -> Rabbit doesn't seems to have rate limits on exchanges
  • rate limit in the sending application -> In our deployment it is really hard to add such feature
  • have a third service pulling from an exchange used by the sending app, and pushing them to a second exchange where argo pulls events -> lol

Additional context

/

@VaibhavPage
Copy link
Contributor

I may be wrong, but for option 1, you can take a look at parallelism level in Argo workflow. But I think it makes sense to have a rate limiter put in the gateway.

@VaibhavPage VaibhavPage self-assigned this Oct 5, 2019
@VaibhavPage VaibhavPage added the enhancement New feature or request label Oct 5, 2019
@VaibhavPage VaibhavPage added this to the v0.11 milestone Oct 5, 2019
@fayak
Copy link
Author

fayak commented Oct 6, 2019

@VaibhavPage yes I've looked at parallelism, but, correct me if I'm wrong, it doesn't prevent the maximum simultaneous execution of workflows, but only steps (pods?) within a workflow

@VaibhavPage
Copy link
Contributor

My bad, you are right.

dgrisonnet added a commit to dgrisonnet/argo-events that referenced this issue Oct 15, 2019
dgrisonnet added a commit to dgrisonnet/argo-events that referenced this issue Oct 15, 2019
dgrisonnet added a commit to dgrisonnet/argo-events that referenced this issue Oct 16, 2019
VaibhavPage pushed a commit that referenced this issue Oct 21, 2019
* Add rateLimit option to amqp gateway (#353)

Signed-off-by: Damien Grisonnet <[email protected]>

* Add ratePeriod option to amqp gateway

Signed-off-by: Damien Grisonnet <[email protected]>

* Fix period value

Signed-off-by: Damien Grisonnet <[email protected]>

* Fix errors import to keep the codebase consistent

Signed-off-by: Damien Grisonnet <[email protected]>
@fayak
Copy link
Author

fayak commented Oct 21, 2019

Closing it as #378 got merged

@fayak fayak closed this as completed Oct 21, 2019
juliev0 pushed a commit to juliev0/argo-events that referenced this issue Mar 29, 2022
* Add rateLimit option to amqp gateway (argoproj#353)

Signed-off-by: Damien Grisonnet <[email protected]>

* Add ratePeriod option to amqp gateway

Signed-off-by: Damien Grisonnet <[email protected]>

* Fix period value

Signed-off-by: Damien Grisonnet <[email protected]>

* Fix errors import to keep the codebase consistent

Signed-off-by: Damien Grisonnet <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants