We had good success by putting an nginx in front of ktor many years ago. Havent had an issue since.
o
Oliver.O
04/12/2024, 7:31 AM
Good to hear that you had success that way. However, this doesn't necessarily solve all cases discussed here. Also, throwing more moving parts at a problem increases complexity. Mileage varies.
In this case, there is an immediate solution to the problem at hand in Ktor. As the ticket status shows, it is being worked on just now.
The underlying cause, of course, is blocking I/O (including network I/O and all sorts of databases). With a true coroutines-based I/O solution, there would be no need to fire up an excessive number of threads, which are consuming resources, but mostly sleeping. So once you have that option, it would be the ideal way to scale up easily and efficiently.
s
spand
04/12/2024, 7:38 AM
Sure. I just mentioned it as a workaround. We just found it to be a critical component of running a top1000 website since ktor will never be as hardened as nginx
o
Oliver.O
04/12/2024, 7:46 AM
I appreciate sharing solutions here, that's where we all benefit from each other. The hard part in selecting one is just context. We might take something for granted that just does not apply to others.
I don't see evidence supporting the hypothesis that Nginx might be any more "hardened" than Ktor already is. I actually have seen solid data that Ktor is absolutely robust at scale (unfortunately, I can't share details for confidentiality reasons).