You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
v4, graphql api, uses POST for all operations, including read
RateLimitTransport sleeps for 1s between each POST/PATCH/PUT/DELETE operation
Say you have 100 repos with 3 branch protection rules each, the provider will spend 5 minutes sleeping
Reacted by Rui Dos Santos Magalhães, Sıddık AÇIL, Trevor Morris, mog, Mason Malone, Ty Martin, Lucas Zamboulis, Dion Gionet Mallet, Ben Fielden, Tyler Nguyen and 2 more
I think its important to keep the RateLimitTransport for any v3 api interactions for larger organizations where we need to rely on this to get through plans in our largest states. In the graphql api I agree we need to think about rate limits very differently.
What I think we want to do is create a generic rate limit transport and then let each rest and gql apis use the appropriate transport based on the calls.
The latest release contains a possible fix for your use case. Can you take a look at the new write_delay_ms configuration parameter and let us know if this can be closed?
@jcudit thanks for that
set write_delay_ms to 200, which has on average sped up our plan times 2x
Lowering this value further yields marginal gains (100ms = ~6m30s)
However, while the PR that introduces write_delay_ms option helps this problem, I think long term it's not the correct solution for it. I think the provider should have separate transports for v4 and v3 api's, keeping the rate limit logic as is on the v3 api, but modifying the v4 api transport to only invoke this write delay on mutations, rather than queries
I would have to agree that while #907 certainly helps (and is very much appreciated) it's not the solution.
As @lijok mentions It would be good to differentiate between the API's and have appropriate logic between them, this is only going to become more of a problem as more things move to the newer API.
I think its important to keep the RateLimitTransport for any v3 api interactions for larger organizations where we need to rely on this to get through plans in our largest states. In the graphql api I agree we need to think about rate limits very differently.
What I think we want to do is create a generic rate limit transport and then let each rest and gql apis use the appropriate transport based on the calls.
If we go this route we can start with adding a no-op rate limit transport for GQL apis and use the existing rate limiter for REST.
👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!
This isn't stale, at a bare minimum the provider should allow different configuration for the different GH API versions. Maybe something similar to #849 (comment) but focusing on the API version.
provider"github" {
owner="example-org"write_delay_ms=500# default to 500msv3_write_delay_ms=500# sleep for 500ms in between requests to the GitHub REST APIv4_write_delay_ms=50# sleep for 50ms in between GraphQL requests
}
👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!
Activity
ayk33 commentedon Jul 27, 2021
Anything that can be done about this?
lijok commentedon Jul 28, 2021
the provider needs to either not use v4 api, which is probably not wise long-term
or, rethink the RateLimitTransport
majormoses commentedon Sep 28, 2021
I think its important to keep the
RateLimitTransportfor anyv3api interactions for larger organizations where we need to rely on this to get through plans in our largest states. In the graphql api I agree we need to think about rate limits very differently.Here is the docs from Github: https://docs.github.com/en/graphql/overview/resource-limitations#rate-limit
What I think we want to do is create a generic rate limit transport and then let each rest and gql apis use the appropriate transport based on the calls.
jcudit commentedon Oct 5, 2021
The latest release contains a possible fix for your use case. Can you take a look at the new
write_delay_msconfiguration parameter and let us know if this can be closed?lijok commentedon Oct 5, 2021
@jcudit thanks for that

set
write_delay_msto 200, which has on average sped up our plan times 2xLowering this value further yields marginal gains (100ms = ~6m30s)
However, while the PR that introduces
write_delay_msoption helps this problem, I think long term it's not the correct solution for it. I think the provider should have separate transports for v4 and v3 api's, keeping the rate limit logic as is on the v3 api, but modifying the v4 api transport to only invoke this write delay on mutations, rather than queriesAny thoughts?
shoddyguard commentedon Oct 6, 2021
I would have to agree that while #907 certainly helps (and is very much appreciated) it's not the solution.
As @lijok mentions It would be good to differentiate between the API's and have appropriate logic between them, this is only going to become more of a problem as more things move to the newer API.
majormoses commentedon Oct 7, 2021
If we go this route we can start with adding a
no-oprate limit transport for GQL apis and use the existing rate limiter for REST.github-actions commentedon Nov 30, 2022
👋 Hey Friends, this issue has been automatically marked as
stalebecause it has no recent activity. It will be closed if no further activity occurs. Please add theStatus: Pinnedlabel if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!shoddyguard commentedon Nov 30, 2022
This definitely still needs addressing
12 remaining items
stevehipwell commentedon Oct 21, 2024
This isn't stale, at a bare minimum the provider should allow different configuration for the different GH API versions. Maybe something similar to #849 (comment) but focusing on the API version.
github-actions commentedon Jul 19, 2025
👋 Hey Friends, this issue has been automatically marked as
stalebecause it has no recent activity. It will be closed if no further activity occurs. Please add theStatus: Pinnedlabel if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!mogopz commentedon Jul 19, 2025
This isn't stale, definitely still needed.
feat: add modern rate limiter option using go-github-ratelimit