sc: tune thread pool size and number
stub
- as of !562 (merged) we have 4 dispatchers, each backed by a cached (ie: elastic) thread pool executor withe a small-ish core pool size
- we likely want only one cached thread pool executor with a very large (~1k) core thread pool size
- in this MR, we will implement such a setup and run some load tests to ensure:
- it avoids deadlock due to thread starvation under load (as witnessed with
Dispacthers.IO
or fixed thread pools) - it is not drastically slower than other configurations
- it does not use an unacceptably high amount of memory
- it avoids deadlock due to thread starvation under load (as witnessed with
- we'll also try to leverage the fact that we only have one dispatcher to encapsulate the dispacther within
app.coroutineContext
Edited by aguestuser