Hello,
I am trying to figure out maximum TPS(transactions per second) that can be achieved from simple HttpServer with single vertx instance(one JVM) with two verticle instances running on 2 core server.
As you see in the code below, there is no blocking calls in the code, and this runs on two event loops, which is configured using JVM_OPTS.
public class HttpServer extends Verticle {
public void start() {
vertx.createHttpServer().requestHandler(new Handler<HttpServerRequest>() {
public void handle(HttpServerRequest req) {
req.response().headers().set("Content-Type", "text/plain; charset=UTF-8");
//req.response().headers().set("Content-Length","27");
req.response().setChunked(true);
req.response().write("<status>AUTHORIZED</status>", "UTF-8").end();
}
}).listen(8080);
}
}
I loaded this HttpServer with 1000 jmeter threads from a separate server machine and I could achieve 60,000 TPS. The jmeter request is a simple Http GET invocation and response contains only few bytes as you see in the code.
When this was happening, I separately observed the HttpServer performance using jvisualvm and I did CPU profiling to check the CPU utilization. CPU utilization was 100% at 60,000 TPS.
When I present these results, some argued that the CPU utilization cannot be 100% for this kind of simple application without much processing involved in the server side. Furthermore,they said that the TPS would be much less if the response contains few kilobytes or json body is used in a POST request, in turn, vertx would give poor performance in large applications.
Is this argument is correct?
If that is correct, in what ways I can further optimize the CPU utilization of vertx eventloop?
Regards,
Kushan