A quick and dirty experiment running Dropwizard on an early-access build of Project Loom.
This is incomplete and not a representative test at present.
Key points:
- Dropwizard, as a framework built atop Jetty, can be trivially made to use Fibers instead of Threads for servicing requests. See FiberServerFactory and FiberBackedThreadPool. The latter is almost entirely lifted from this mailing list post.
- Fibers seem to give significant performance improvements (especially tail latency).
- As expected, Loom is early access and some crashes have been observed.
Build inside a Docker image that includes the Loom variant of JDK14:
$ docker build -t dropwizard-loom .$ docker run -p 8080:8080 dropwizard-loomWhether or not we're using Fibers or Threads depends upon configuration. To switch, edit config.yml.
Set server.type to default to use Threads, or fiber to use Fibers.
After changing configuration, the image should be rebuilt.
Use slow-cooker to generate load, e.g.:
$ docker run --net host -it buoyantio/slow_cooker -qps 10 -concurrency 100 http://localhost:8080/Slow cooker does not ramp up traffic slowly, so it is advised not to start with high (e.g. 1000+) concurrency and instead increase concurrency in steps.
- Switch away from using
gradle runto run the service, as this is not a realistic way to run a service - Set up repeatable test harness for running performance trials and measuring JVM stats
- Set up more representative tests than just current ping-pong endpoint
- Write up observed behaviour - including performance improvements and crashes