replaced my cached thread pool dispatcher with `<h...
# coroutines
e
replaced my cached thread pool dispatcher with
<http://Dispatchers.IO|Dispatchers.IO>
, now it cuts unused threads instant, but consumes more cpu
e
Can you add more details on your workload and observations please
e
~100 requests per minute, every request wrapped by interceptor to run with Dispatchers.IO context (just for migration period). ktor 0.9.4, netty engine. inside jdbc, okhttp i’ll try to reproduce it in the sandbox, but not sure if it’s an issue
w
100/minute is pretty slow. I was doing some load testing with Vegeta and
<http://Dispatchers.IO|Dispatchers.IO>
. At about 2500 requests/second I only lost somewhere around 11% of requests. The packet loss was only because I hit the thread limit (about 90 on my machine).
e
it was not load testing, it’s regular production load for our inner service. just noticed changes on metrics after deploy
v
@enleur thanks for the report. Could you please clarify: 1) Is this problem critical for you? 2) Could it be the case when load is increased because system has more load after 11::30? As a workaround, you can increase
kotlinx.coroutines.scheduler.keep.alive.sec
system property and see if that helps
increasing
kotlinx.coroutines.scheduler.resolution.ns
may help as well, but is less recommended
e
Thanks for help
1) Is this problem critical for you?
No, It is not an issue. It was critical when it hanged and consumed all 4 cores 🙂 but that was fixed in 0.26
2) Could it be the case when load is increased because system has more load after 11::30?
Load was stable and I think you’re right, it uses more cpu because of thread utilisation