we are using Flink's `AsyncIO` function with Futur...
# troubleshooting
s
we are using Flink's
AsyncIO
function with Futures to make external gRPC calls. Currently, we have set the async capacity to 1, and we are using a blocking stub to make those calls. For each event, we trigger 4 Futures (i.e., 4 gRPC calls per event). Does this mean that the
Executors.newFixedThreadPool()
needs to have at least 4 threads to avoid queue starvation? Also, if we increase the async capacity to 2, should we increase the thread pool size to 8 to keep up with the parallel calls?
r
Generally speaking -- yes. You'll need to ensure that your available thread pool has at least the number of potential concurrent blocking all that you might be making. At a high-level, you'd probably want to target a formula like:
Copy code
(capacity) * (calls per event)
The above formula would scale based on the capacity. So in your example case, you'd likely want a minimum of 4 threads and if you increased the capacity to 2, then you'd scale that up further to a minimum of 8 threads.
s
Thanks for the response @Rion Williams πŸ‘