-
Notifications
You must be signed in to change notification settings - Fork 57
Control the thread pool's queue size #86
Comments
I don't think this is Jawampa issue, looks more like netty API problem. I mean, jawampa just use one of default Also, did you really hit OOM, or this is theoretical bug? As far as I know, Please correct me if I am wrong. |
Unfortunatly I think WAMP itself is not the best protocol for such considerations, because there is no application level flow control and due to some guarantees that WAMP implementations have to make (don't loose or reorder messages) the best thing we can do is queuing messages at several places. Things that could be monitored from my point of view is the size of the outgoing message queue (implemented in |
@the20login Yes, you right this is more question to Netty than jawampa. It wasn't a theoretical question, I actually was analysing the memory consumption of an app and found this. @Matthias247, @the20login I already use a separate thread pool for processing message before publishing to the broker, but since the jawampa's thread pool queue size is not fixed, I probably need to add additional queue with fixed size before it to control the memory consumption. @Matthias247 I also tried to override |
If we will look at the
NettyWampClientConnectorProvider.createScheduler
and will go deeper in the implementation, we will find that it usesSingleThreadEventExecutor
.SingleThreadEventExecutor
usesnew LinkedBlockingQueue<Runnable>();
as a queue for the tasks submitted to be executed.It means that the thread pool used to publish messages has an endless queue which means that if the client publishes too much message it may at some point in time due with the OutOfMemoryException.
I tried to override the
NettyWampClientConnectorProvider.createScheduler
method to use a thread pool with a fixed queue, but for unknown reason it wasn't able to even connect to the broker.Are there any recommendation how to fix the size of the queue?
The text was updated successfully, but these errors were encountered: