Hi,

With direct connect having been hacked in (err, I mean, "implemented"), it
is (a lot) easier to do meaningful performance tests. h2load is a drop in
replacement of ab that uses HTTP/2, and it allowed doing some easy
profiling.

The good news is that the code seems to be well optimized already with few
visible problems. The only issue is a very heavy sync contention on the
socket wrapper object in Http2UpgradeHandler.writeHeaders and
Http2UpgradeHandler.writeBody.

The reason for that is when you do:
h2load -c 1 -n 100 http://127.0.0.1:8080/tomcat.gif
It ends up being translated in Tomcat into: process one hundred concurrent
streams over one connection. Although h2load is not real world use, that's
something that would need to be solved as a client can use of a lot of
threads.

There are two main issues in HTTP/2 that could be improved:
1) Ideally, there should be a way to limit stream concurrency to some
extent and queue. But then there's a risk to stall a useful stream (that's
where stream priority comes in of course). Not easy.
2) All reads/writes are blocking mid frame. It's not too bad in practice,
but it's a useless risk, that's where async IO can provide an "easy"
solution using a dedicated NIO2 implementation.

Comments ?

Rémy

Reply via email to