Helio
11/29/2023, 5:34 AM2.3.6 withe the CIO engine. We noticed that after ~5 days we start to see degradation in performance, such as latency increasing etc. We decided to extract the jmap and we noticed that the number of thread ids in the dispatchers are quite high, see screenshot for example.
We are thinking that the issue might be related to the performance of the connections, since despite the HttpRequestTimeouts we see a lot of ConnectionTimeoutExceptions . We were thinking that maybe by having a Connection Pool would help, but I could not find any information in the documentation about the best practice to handle these type of improvements... I did however, found in the channel that pipelining=true option should be able to help, but I don't have much context about what it does or know if this could improve somehow the performance of the application.
Do you have any recommendation for such scenarios like that to improve the performance of the client?
engine {
pipelining = true
endpoint {
maxConnectionsPerRoute = 500
}
}Helio
11/29/2023, 5:38 AMmaxConnectionPerRoute am I right to say that for the example below, this is going to be accountable for 2 different routes, which means the client could fire up 500 requests to $1 and $2 ? Or Ktor Client will go up to /users?
<https://domain.com/api/v1/users/$1>
<https://domain.com/api/v1/users/$2>andriyo
11/29/2023, 5:58 AMHelio
11/29/2023, 6:13 AMHelio
11/29/2023, 6:15 AMe5l
11/29/2023, 10:40 AMHelio
11/29/2023, 8:49 PMpipelining (which I'm not entirely confident on how this is used for since I could not find a lot in documentation)... maybe increasing the timeAlive of the connections, etc?
At the moment, I'm still trying to prove / investigate what could be happening with the service.e5l
11/29/2023, 8:51 PMkotlinx.coroutines.io.parallelism to values higher than 64?Helio
11/29/2023, 8:53 PMHelio
11/29/2023, 8:59 PMpipelining option is really a thing? or not?
Btw, thanks for trying to assist @e5lHelio
11/30/2023, 8:46 AMe5l
11/30/2023, 8:47 AMHelio
11/30/2023, 8:54 AMHelio
11/30/2023, 9:18 PMe5l
12/01/2023, 8:10 AMe5l
12/01/2023, 2:58 PMHelio
12/02/2023, 12:03 AMHelio
12/05/2023, 1:14 AMe5l
12/05/2023, 7:54 AMHelio
12/05/2023, 7:58 AMe5l
12/05/2023, 8:01 AMHelio
12/05/2023, 8:11 AMHelio
12/12/2023, 4:14 AMpipelining=true, we are still seeing a high number of threads.Helio
12/12/2023, 4:23 AMHelio
01/03/2024, 9:36 PMpipelining=true we are still seeing the latency increase from the HTTP Client.