Uploaded image for project: 'MINA'
  1. MINA
  2. DIRMINA-948

Performance recession when invoke session.write concurrent

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.7
    • Fix Version/s: 2.0.8
    • Component/s: Core
    • Labels:

      Description

      In org.apache.mina.core.filterchainDefaultIoFilterChain, code around line number 600,
      <code>if (writeRequestQueue.size() == 0 )</code>
      will raise performance problem in high concurrent situation, Mina default use ConcurrentLinkedQueue as writeRequestQueue, but size() of this queue is not a constant-time operation, suggest to use <code>if (writeRequestQueue.isEmpty(s))</code> instead of it.

        Activity

        Hide
        elecharny Emmanuel Lecharny added a comment -

        Fixed with http://git-wip-us.apache.org/repos/asf/mina/commit/f72467ad

        Many thanks for the proposed solution !

        Show
        elecharny Emmanuel Lecharny added a comment - Fixed with http://git-wip-us.apache.org/repos/asf/mina/commit/f72467ad Many thanks for the proposed solution !
        Hide
        xehonk Henning Rohlfs added a comment -

        Just wanted to comment that this is not just a theoretical problem. On our production systems we had CPU spikes (100% cpu over minutes or longer) several times a week. We identified Mina (and more specifically the size() method of ConcurrentLinkedQueue) as culprit. Changing the call to isEmpty() did eliminate these problems.

        Show
        xehonk Henning Rohlfs added a comment - Just wanted to comment that this is not just a theoretical problem. On our production systems we had CPU spikes (100% cpu over minutes or longer) several times a week. We identified Mina (and more specifically the size() method of ConcurrentLinkedQueue) as culprit. Changing the call to isEmpty() did eliminate these problems.
        Hide
        elecharny Emmanuel Lecharny added a comment -

        Good catch !!!

        Show
        elecharny Emmanuel Lecharny added a comment - Good catch !!!

          People

          • Assignee:
            Unassigned
            Reporter:
            g_mark Mark
          • Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development