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

Increase rate limit for ingredients check API from 150 to 350 requests per minute #543

Merged
merged 4 commits into from
Oct 7, 2024

Conversation

philipbrembeck
Copy link
Contributor

@philipbrembeck philipbrembeck commented Oct 7, 2024

Reason for change:
The ingredients check API was frequently hitting the rate limit even with normal usage patterns. Users entering only a few ingredients were reaching the limit within a minute, impacting the user experience and functionality of the feature.

Changes made:

  • Increased the rate limit from 150 to 350 requests per minute.

Performance considerations:

  • We've monitored the API usage patterns and determined that this increase should accommodate typical user behavior without significantly impacting our system's performance.
  • We will continue to monitor the API usage and system performance after this change to ensure it doesn't negatively impact our infrastructure.

Risk analysis:

  • The primary risk is potential increased load on our servers. However, based on our current infrastructure capacity and usage patterns, we believe this risk is minimal.
  • We have implemented additional monitoring to quickly identify any issues that may arise from this change.

Next steps:

  • Closely monitor API usage and system performance for the next week after deployment.
  • Consider implementing more granular rate limiting or user-specific limits if we observe any abuse of the increased limit.

Summary by Sourcery

Increase the rate limit for the ingredients check API to accommodate typical user behavior and reduce the frequency of hitting the rate limit, thereby enhancing the user experience.

Enhancements:

  • Increase the rate limit for the ingredients check API from 150 to 350 requests per minute to improve user experience.

dependabot bot and others added 4 commits October 7, 2024 03:58
Bumps [express-rate-limit](https://github.com/express-rate-limit/express-rate-limit) from 7.4.0 to 7.4.1.
- [Release notes](https://github.com/express-rate-limit/express-rate-limit/releases)
- [Commits](express-rate-limit/express-rate-limit@v7.4.0...v7.4.1)

---
updated-dependencies:
- dependency-name: express-rate-limit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
…express-rate-limit-7.4.1

build(deps): Bump express-rate-limit from 7.4.0 to 7.4.1
Copy link

stackblitz bot commented Oct 7, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

sourcery-ai bot commented Oct 7, 2024

Reviewer's Guide by Sourcery

This pull request increases the rate limit for the ingredients check API from 150 to 350 requests per minute. The change is implemented by modifying a single value in the rate limiter middleware configuration.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Increased rate limit in the rate limiter middleware
  • Changed the 'max' property of the rate limiter from 150 to 350
  • Kept the time window at 60 seconds (one minute)
src/rate-limiter.middleware.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @philipbrembeck - I've reviewed your changes - here's some feedback:

Overall Comments:

  • The PR title 'Release' is not descriptive. Please use a title that clearly explains the purpose of this rate limit increase.
  • Increasing the rate limit from 150 to 350 is a significant change. Please provide context for this decision, including any performance testing or risk analysis conducted.
  • Consider adding a comment in the code or updating the PR description to explain the reasoning behind this rate limit change for future reference.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@philipbrembeck philipbrembeck changed the title Release Increase rate limit for ingredients check API from 150 to 350 requests per minute Oct 7, 2024
@philipbrembeck
Copy link
Contributor Author

@sourcery-ai review

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @philipbrembeck - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@philipbrembeck philipbrembeck merged commit a2f0ab0 into main Oct 7, 2024
9 checks passed
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.

1 participant