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

Customize Bottleneck.Groups Limits #640

Open
shouyang opened this issue Nov 1, 2023 · 2 comments
Open

Customize Bottleneck.Groups Limits #640

shouyang opened this issue Nov 1, 2023 · 2 comments

Comments

@shouyang
Copy link

shouyang commented Nov 1, 2023

Motivation

I have a service that integrates localized resource files with repositories on GHE. I have a monorepo case where the octokit-write limit starts becoming onerous since I need to write about ~200 files per locale. At the current limits, this'll take a second per file, problematic since I'll be committing back 5 locales x ~200 files.

Ask

I'd like to expose some way to configure the bottlenecks created in createGroups.
For example:

type OctokitOptions = {
  ...
  throttle: {
    ...
    bottleneck: {
      globalMaxConcurrent: number

      search: {
        maxConcurrent: number
        minTime: number
      }

      write: {
        maxConcurrent: number
        minTime: number
      }

      notifications: {
        maxConcurrent: number
        minTime: number
      }
    }
  }
}
@shouyang shouyang changed the title Customize Bottleneck.Groups' Limits Customize Bottleneck.Groups Limits Nov 1, 2023
@gr2m
Copy link
Contributor

gr2m commented Nov 2, 2023

@octokit/maintainers I wouldn't mind exposing the detailed throttle settings. I'd probably make them independent of bottleneck as we might replace this implementation detail in future.

However I think doing more than 1 mutating request per second will trigger secondary rate limits very quick. I'm not sure if thresholds for secondary rate limit can be configured or if an actor can be exempt.

As an alternative, and to try it out before we implement any changes, you can create multiple octokit instances and rotate through them. Or disable throttling altogether and implement your own for this particular use case

@shouyang
Copy link
Author

shouyang commented Nov 6, 2023

Hey @gr2m,

Thanks for the quick response. Yeah happy to help make this more generic.

For the interim, I've disabled this plugin. I'm working on Github Enterprise where technically my service account has generous rate limits. I've tried tweaking the innate limits here while running my service locally.

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

2 participants