com.sun.net.httpserver update

Kasper Nielsen kasperni at gmail.com
Sun Sep 20 11:46:03 UTC 2020


Hi Alan,

I did some local runs using vegeta as a simple loading testing tool.
Using Executors.newVirtualThreadExecutor() as the dispatching
mechanism. Which worked beautifully. I was easily spawning a couple
of hundred thousand virtual threads a second on an old laptop.

But only because I spun of 1000 extra threads per request. Otherwise
I had all kinds of issues with networking subsystem/jdk.httpserver.

I think my conclusion is, that if you want to try and stress Loom with a
thread-per-request web-server. You will need a pretty well-tuned
test setup.

/Kasper


  Kasper


On Sat, 19 Sep 2020 at 09:03, Alan Bateman <Alan.Bateman at oracle.com> wrote:
>
> On 19/09/2020 05:41, Kasper Nielsen wrote:
> > Hi,
> >
> > I was wondering if there are any plans to provide an implementation in
> > jdk.httpserver that uses virtual threads?
> >
> I'm not aware of anyone doing anything on this. The main motivation for
> this HTTP server was to support JAX-WS "callbacks" and I don't know if
> got much usage beyond that. The default implementation is limited and
> doesn't support HTTP/2 and several features. That said, it could
> interesting to explore and play with. It has an SPI so you can deploy
> other implementations so that would be one thing to try out. Another
> thing to try is using HttpServer.setExecutor to set an executor that
> creates a virtual thread per request. Is this something you would be
> interested to trying out and report back?
>
> -Alan


More information about the loom-dev mailing list