Configuring worker verticles

29 views
Skip to first unread message

Abhishek Srinath

unread,
Sep 25, 2016, 12:32:30 AM9/25/16
to vert.x
Hi All,
I am trying to scale an application which does a blocking call to an external application to fetch some data (Request and response order does not matter)

Since, its a blocking call as described in the vertx docs I am using worker verticle with worker pool set to 5 and I have deployed 5 instances of the worker verticle

When I submit multiple queries(when I tested I just fired 3 queries) even though my verticle is defined as worker with multiple instances with sufficient worker threads my requests are not handled concurrently looks like they are handled sequentially

I also tried to create one master verticle and 4 worker verticles(Handles blocking call) where the initial request from the client is received on the master verticle, master sends the request to worker via event bus and it responds back but even this way I see the same behavior as explained above 

Please suggest if I misunderstood something and if I am trying to achieve concurrency in an incorrect way. If so please suggest what the best way to achieve concurrency for this case

ad...@cs.miami.edu

unread,
Sep 25, 2016, 2:15:26 PM9/25/16
to vert.x
 Hi,

As far as I know, you have the correct understanding of how it should work, but there are more accomplished vertx ninjas here who would be able to better verify that.

In your worker verticles, you may want to print out the name of the "current thread" to see if it is trying to use different threads (it would need to if it were to be in parrallel).  You could also print out all the thread names at the start of the operation to see if there are in-fact the desired number of worker threads.  If there are not the desired number, then you likely have a config issue.

Best,
-Adam

Abhishek Srinath

unread,
Sep 25, 2016, 8:20:52 PM9/25/16
to vert.x
Sure thanks 
I think I spoke a bit too early - I just wrote a small client which sends multiple async requests and they are handled in parallel. 

I was using a browser for testing my PoC and sending multiple requests from different tabs did not get addressed in parallel and this side tracked me

ad...@cs.miami.edu

unread,
Sep 25, 2016, 10:33:09 PM9/25/16
to vert.x
Glad you got it working.  But you may want to look at "why" it is was not working in the browser (I think it should).  A browser should be able to fire a few requests to the same serer without doing it in serial, I would think.  Vertx will not care if it is a browser or another client, so I don't know why it would not work in a browser.
Reply all
Reply to author
Forward
0 new messages