4 Replies Latest reply on May 20, 2008 3:43 AM by Trustin Lee

    Limiting the MINA write queue

    Tim Fox Master

      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.