feature request: concurrency limit #1921
vikstrous2
started this conversation in
Ideas
Replies: 2 comments
-
We are facing a similar issue. Due to the full parallel execution of resolvers, it can cause connection pool issues at a container level. What is the recommendation here? |
Beta Was this translation helpful? Give feedback.
0 replies
-
In a custom solution you'd also need to account for context cancellation, so it won't be as trivial as mentioned above |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What happened?
We are running gqlgen with a large garphql and a mix of large and small queries. We want to achieve predictable performance for small queries and prevent them from being starved for resources from large queries.
What did you expect?
We expected to be able to set a parameter to limit the total number of concurrently executing resolvers per request.
Minimal graphql.schema and models to reproduce
n/a
versions
gqlgen version
? all versionsgo version
? n/aWe found the following way to implement a concurrency limit in a middleware:
I'm showing a limit of 1, but you'd normally use a semaphore, of course.
The down side of this approach is that it doesn't limit the number of goroutines created. I was hoping for a more built-in way to limit concurrency without having a large number of blocked goroutines.
Beta Was this translation helpful? Give feedback.
All reactions