Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Limit the number of event loops

Tags:

vert.x

vertx3

In vertx docs they mentioned there is a possibility to limit the number of event loop threads per vertx instance:

Instead of a single event loop, each Vertx instance maintains several event loops. By default we choose the number based on the number of available cores on the machine, but this can be overridden.

Maybe someone knows how to do that? (I need it for debugging purpose)

like image 300
Shay Tsadok Avatar asked Jan 03 '16 14:01

Shay Tsadok


1 Answers

Vertx vertx = Vertx.vertx(new VertxOptions().setEventLoopPoolSize(1));

By default it's:

public static final int DEFAULT_EVENT_LOOP_POOL_SIZE = 2 * Runtime.getRuntime().availableProcessors();
like image 154
cy3er Avatar answered Nov 17 '22 20:11

cy3er