Skip to content

feat: limit number for active requests #5107

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

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

Conversation

connoratrug
Copy link
Contributor

  • avoid locking up the service by flooding service with requets

What are the main changes you did

  • explain what you changed and essential considerations.

How to test

  • explain here what to do to test this (or point to unit tests)

Checklist

  • updated docs in case of new feature
  • added/updated tests
  • added/updated testplan to include a test for this fix, including ref to bug using # notation

- avoid locking up the service by flooding service with requets
@connoratrug connoratrug requested a review from mswertz June 5, 2025 08:43
@mswertz
Copy link
Member

mswertz commented Jun 5, 2025

can you please add why this change?

Copy link
Member

@mswertz mswertz left a comment

Choose a reason for hiding this comment

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

can you please explain why we gonna do this? The number is rather low

@connoratrug
Copy link
Contributor Author

can you please add why this change?
can you please explain why we gonna do this? The number is rather low

Many of our deployments are exposed to the open internet, with some—such as catalogues—actively promoting their services online as part of their core use case and business value.

However, being publicly accessible also means these services are susceptible to high volumes of incoming requests, which can overwhelm the system. This has occurred multiple times over recent days, months, and even years.

The current architecture and deployment configurations are optimized for a very small number of concurrent users. In reality, only a tiny fraction of internet-connected machines are legitimate users. To prevent overload from excessive traffic (e.g., DDoS attacks, aggressive web scraping, or automated bot requests), this PR introduces a mechanism to limit the number of concurrent upstream requests.

The limit is currently hard-coded but should ideally be configurable via environment or runtime settings. The goal is to select a threshold that maximizes resource usage during normal operations without degrading performance or risking system instability due to factors like garbage collection pauses, memory swapping, or excessive context switching.

Copy link

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