-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
vertx don't instant sends messages while processing handlers! #1607
Comments
Hi, with a worker it happens because Hazelcast uses an executeBlocking method that cannot be executed until the current task (the worker) has been finished (as it uses ordering). can you rather open this issue in vertx-hazelcast project ? |
Done, opened. |
In a standard verticle you must never block, that's the rule. |
Is 50ms processing time considered a block? |
if you block a task, other tasks on the same event loop cannot execute, among these tasks some will send the message through the socket, no matter how long it blocks, they simply cannot execute. when you send a message in event bus, tasks are scheduled on the same thread to write the message in the connection |
Thank you @vietj, but it's not clear too me who is the responsibility of sending the messages to the
The documentation it answers in -some- way the questions 2) and 3): If you have a single event loop, and you want to handle 10000 http requests per second, then it’s clear that each request can’t take more than 0.1 ms to process, so you can’t block for any more time than that. |
It seems that
vertx
only sends cluster messages when is idle (nothing to process).That means while a
vertx
is very busy/active there is no messages dispatched toeventBus
until thevertx
becomes completely idle, that could be a big limitation if there is a need to send instant messages.What is the solution to force vertx to instant send a message without waiting the need to be
idle
?In order to demonstrate this issue, I have created two very simple verticles:
Scenarios: (cluster mode)
verticle
:verticle
:For these tests ping verticle is a worker verticle ([w-##] means vert.x-worker-thread-##), however it's not revenant if it's a standard verticle because both configurations are similar. Both ping and pong suffers from the reported issue and therefore the messages were stuck on
eventBus
untilidle
(nothing to process).Note that If the ping used a multithread worker then the 1 second extra stuff wasn't noticed and the entire process was 1 second quicker (see ping code), however the pong continues suffering from the reported issue.
ping verticle code:
pong verticle code:
verticle
:verticle
and pong is a multithread workerverticle
:What is the solution to force vertx to instant send a message without waiting the need to be
idle
?The text was updated successfully, but these errors were encountered: