Andrew O'Hara
03/09/2026, 3:39 PMHttp4kChannelHandler blocks the Netty thread for the entire duration of the response. I think by default, Netty only opens a very small number of threads, based on the CPU count. And so if you're blocking on those threads, you're making it impossible to handle concurrent requests.
What I think SHOULD be done is to inject an executor into the handler, and offload the request to it. Once that returns, you get the netty executor and use it to submit the response to the outgoing channel.dave
03/09/2026, 4:33 PMAndrew O'Hara
03/09/2026, 5:07 PMdave
03/09/2026, 5:09 PMAndrew O'Hara
03/09/2026, 5:14 PMAndrew O'Hara
03/09/2026, 5:16 PMAndrew O'Hara
03/09/2026, 5:29 PMdave
03/09/2026, 5:32 PMAndrew O'Hara
03/10/2026, 4:22 PMwsConsumer has finished being invoked. This is made worse when offloading the wsConsumer invocation to an executor.
So I'm going to add a buffer that's used for this interim period.Andrew O'Hara
03/10/2026, 8:30 PMWsConsumer returns, draining the buffer would run in parallel to new frames being received
I have solutions for all of these, but all of this just goes to show why Netty is not a great out-of-the-box backend for higher level protocols.