Using Ktor and Kotlin 1.5 to implement a REST service backed by Netty. A couple of things about this service:
- "Work" takes non-trivial amount of time to complete.
- A unique client endpoint sends multiple requests in parallel to this service.
- There are only a handful of unique client endpoints.
The service is not scaling as expected. We ran a load test with parallel requests coming from a single client and we noticed that we only have two threads on the server actually processing the requests. It's not a resource starvation problem - there is plenty of network, memory, CPU, etc. and it doesn't matter how many requests we fire up in parallel - it's always two threads keeping busy, while the others are sitting idle.
Is there a parameter we can configure to increase the number of threads available to process requests for specific endpoints?