I'm using the basic vert.x example verticle running an HTTP server;
package io.vertx.starter;
import io.vertx.core.AbstractVerticle;
public class MainVerticle extends AbstractVerticle {
@Override
public void start() {
vertx.createHttpServer()
.requestHandler(req -> req.response().end("Hello Vert.x!"))
.listen(8080);
}
}
This starts up and responds, so I thought I'd give it a quick load test via ab -n 100000 -c 50 http://localhost:8080
Every run is relatively consistent, it times out right around 16,400 completed requests, give or take 10. I've tried playing with setWorkerPoolSize
and setEventLoopPoolSize
on the vertx options, but nothing seems to have an effect.
I also tried scaling the verticle via --instances 10
and confirmed it does deploy 10 verticles. Oddly, the same 16,400 is where it dies.
The logs show no errors or warnings, it just seems to die under load. If I hit it with a browser a few seconds later, it responds happily again. Has anyone come across this? I'm curious why this happens, and how I might fix it.