pauchan8
pauchan8

Reputation: 155

Netty open channels Benchmark fails

Here is some code:

public void channelReadComplete(ChannelHandlerContext ctx) {
        ctx.flush();
        //ctx.close();
    }

I'm trying to test my server with apache -ab command. When ctx.close() is uncommented apache benchmark command "ab -c100 -n1000" executes normally, but when channel remains opened benchmark shows 70007 Timeout Exception. How can i keep all my connections opened?

Upvotes: 1

Views: 204

Answers (1)

Norman Maurer
Norman Maurer

Reputation: 23567

You should close the Channel only if keep-alive header is not present and only once the response was full written. See the HttpHelloWorldServer example

https://github.com/netty/netty/blob/4.0/example/src/main/java/io/netty/example/http/helloworld/HttpHelloWorldServerHandler.java

Upvotes: 2

Related Questions