[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Limiting the MINA write queue

timfox do-not-reply at jboss.com
Mon May 19 10:17:37 EDT 2008


One of the issues I have been struggling with the last few days is how to limit the MINA write queue.

Currently MINA provides an unbounded write queue, so if you write to the session fast enough this can eventually cause RAM to be exhausted, and also increase latency to a unnacceptable level due to the large back log.

To get around this I added code in MinaHandler to limit the max number of scheduled bytes in the session by blocking when it reached an upper limit, and unblocking when it reached a lower limit.

The problem with this technique is that if the lower limit is set to zero, then it never unlocks since it appears the scheduled bytes count is not decremented until after the handler method is called.



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4151778#4151778

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4151778



More information about the jboss-dev-forums mailing list