Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ThreadingModel.VirtualThread significant performance drop. #5245

Open
sanIncredible opened this issue Jun 30, 2024 · 5 comments
Open

ThreadingModel.VirtualThread significant performance drop. #5245

sanIncredible opened this issue Jun 30, 2024 · 5 comments
Labels

Comments

@sanIncredible
Copy link

Questions

Version

4.5.8

Context

while running existing application with ThreadingModel.VirtualThread , application performance dropped significantly.

Do you have a reproducer?

Yes

Steps to reproduce

  1. deploy a verticle containing HTTP server , responding every request wuth 200-OK
  2. first execute with ThreadinModel.EventLoop
  3. execute with ThreadingModel.VirtualThread
  4. run http load test.

EventLoop model results : 31000 request per second
Virtual Thread model results : 811 request per second.

CPU utilization is very less in VT model ,

image

Extra

  • Anything that can be relevant such as OS version, JVM version

openJdk 21

@vietj
Copy link
Member

vietj commented Jul 1, 2024

can you share your entire benchmark @sanIncredible without it, those numbers don't mean a lot

@sanIncredible
Copy link
Author

not sure if these would help , cant upload whole JFR due to organization policy.

image
image
image

@vietj
Copy link
Member

vietj commented Jul 1, 2024

that does not help a lot, can you provide a small project that reproduces it ? like a minimalistic HTTP server with vertx and a client

@sanIncredible
Copy link
Author

`

public class BootStrapp{

public static Vertx getVertx(){

}

private static Vertx vertx;

public static void main(String [] args){
vertx = Vertx.vertx();
DepolymentOptions options = new DeploymentOptions().
setThreadingModel(ThreadingModel.VIRTUAL_THREAD;
//setThreadingModel(ThreadingModel.EVENT_LOOP;

vertx.deployVerticle(MainVerticle.class.getName(),options,res->{
if(res.failed()){
}
else{

}

});

}
}


public class MainVerticle extends AbstractVerticle{
@OverRide
public void start(Promise startPromise) throws Exception {

Vertx vertx = BootStrapp.getVertx();
Router router = Router.router(vertx);

router.route().handler(BodyHandler.create());

router.get("/getDemo/").handler(this::getHandler);

vertx.createHttpServer().requestHandler(event->router.handle(event)).listen(8890,"127.0.0.1",result->{
if(result.succeeded()){
startPromise.tryComplete();
}
else{
startPromise.fail(result.cause());
}
});

}

private void getHandler(RoutingContext context)
context.response().setStatusCode(201).end();
}

`

Client used :: https://nghttp2,org/documentation/h2load-howto.html

@sanIncredible
Copy link
Author

sanIncredible commented Jul 4, 2024

image

This call sequence is not there in Eventloop model. is this causing performance issue ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants