-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ktor): scalability for server (#559)
* fix(ktor): scalability for server * noticed slow processing in ktor, when there is a high amount of load. The thread pool sizes (connectionGroupSize, workerGroupSize, and callGroupSize) dynamically calculated based on the available processors, ensuring optimal performance. This setup will be 16, 32, 32 instead of 8, 8, 16 -> This configuration assumes that application processing is more CPU-intensive than connection handling. Not true looking at metrics. checking the docs: If /token processing is delayed, we can increase callGroupSize gradually to handle more concurrent requests. consider: install(IdleTimeout) { requestTimeoutMillis = 15000 idleTimeoutMillis = 60000 } to handle connection not consuming use. * * fix(server): without setting limit for cpu, not overloading we devide by 2 * fix(server): more robust handling of scale, ensure that the callGroupSize never exceeds the database maxConnectionPool, that could start starvation or exceed the database `max_connection` limit. * set max_connections flag = 200 * increase the production pool size * 10 pods * 20 connections = 200 connections (matches a database with max_connections = 200) * fix(server): remove comment * update(build): update deps * update(metrics): max replicas is 12, so assure the number of concurrent connections for the database matches the replicas * pol_max
- Loading branch information
Showing
4 changed files
with
20 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters