Lets say we create a standard verticle and a worker verticle. Now we increase the instances to 2 each. So when lets say 10 users requests at a time what happened previously and what will happen now internally ?
Asked
Active
Viewed 202 times
1 Answers
1
When a request comes in, Vert.x will pick up in a round-robin manner one of the two event loop verticles, that, as the name suggests, will run on the event loop thread pool. The size of the event loop thread pool is x2 number of CPUs. In case there are more verticles than EventLoop threads, some or all threads will have to context-switch.
The same will happen with the worker verticles, but those are run on a different thread pool, which is not work-stealing.
Vert.x will work the same, but in case of a single instance, it won't have anything to pick from.
Worker instances and worker thread pool are separate. How many threads there are depends on the pool. By default, the number is 20.

Alexey Soshin
- 16,718
- 2
- 31
- 40
-
So if we create 10 instances of a worker verticle then 10 worker threads will be assigned to each of the instances ? – Utkal keshari Sahu Jan 19 '22 at 18:04
-
Lets say we have a 2 core processor. So 4 event loop threads will be there. But we deploy 8 normal verticles. Then one event loop thread will have two verticles assigned. Then in that case how that one thread will handle 2 verticles? – Utkal keshari Sahu Jan 19 '22 at 18:17
-
I've answered your question by editing the original answer. – Alexey Soshin Jan 20 '22 at 08:46