Use a separate workerGroup to run the final handler? >From https://netty.io/4.0/api/io/netty/channel/ChannelPipeline.html:
ChannelPipeline <https://netty.io/4.0/api/io/netty/channel/ChannelPipeline.html> pipeline = ch.pipeline(); pipeline.addLast("decoder", new MyProtocolDecoder()); pipeline.addLast("encoder", new MyProtocolEncoder()); // Tell the pipeline to run MyBusinessLogicHandler's event handler methods // in a different thread than an I/O thread so that the I/O thread is not blocked by // a time-consuming task. // If your business logic is fully asynchronous or finished very quickly, you don't // need to specify a group. pipeline.addLast(group, "handler", new MyBusinessLogicHandler()); Rogan On Fri, Sep 1, 2017 at 8:09 AM Johnson Li <[email protected]> wrote: > Hi, > > I have used Netty as an HTTP/2 server for a period of time and found that > it did not take full advantage of HTTP/2 multiplexing. What I mean is that > Netty handles all HTTP/2 streams in one thread if they come from the same > TCP connection. But that is not expected because HTTP/2 merges multiple TCP > connections into one, and let the HTTP/2 to handle the concurrency. So the > application handler should run concurrently to handle concurrent HTTP/2 > streams. > > One simple phenomenon is that if I set up an HTTP/2 client and an HTTP/2 > server, letting the client sends requests quickly. But the CPU usage of the > server will never exceed 100%, which means it only uses one CPU core. That > will cause performance issues if the server is busy with making responses. > > Any thoughts? > > Johnson > > -- > You received this message because you are subscribed to the Google Groups > "Netty discussions" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/netty/9a11955a-b0cf-4998-9b9f-d6f1335d3965%40googlegroups.com > <https://groups.google.com/d/msgid/netty/9a11955a-b0cf-4998-9b9f-d6f1335d3965%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Netty discussions" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/netty/CAOYdKdhkcawVpXMOkSkemS%3DU1-0J7FH80mOsb19RNHATohzTjw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
