Helio
01/04/2024, 1:53 AMjmap
and analysed the heap of the application and we can see that we have a lot of Dispatchers in runnable
mode, and just a few in waiting
. When we compare a fresh new deployment of the application, we can see the opposite, a lot of Dispatchers in waiting
mode, and usually just a few in runnable
mode. It is worth mentioning as well that we see a high number of thread tid
.
We suspect that the latency starts to increase because when the requests are being fired asynchronously, only a hand of dispatchers are available, for example, 8 out of 160.
Is there anything obvious you think we might be missing in our workflow? Any help is greatly appreciated.
Note: The snippet is not executable, it is just shared in a way to understand the flow.mitch
01/08/2024, 1:33 PMCoroutinesScope
, capturing the children, and regularly firing gauge metric on how many childrens in active state / completed / cancelled state..? the theory is there should be a healthy amount of jobs in the active bucket and it should not grow indefinitelymitch
01/08/2024, 1:38 PMsuspend fun main() {
coroutineScope {
val foo = async { doStuff() }
foo.await() // this does not resolve
}
}
suspend fun doStuff(): Unit {
delay(100000) // simulate hanging job
}
Helio
01/08/2024, 10:01 PM