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

IoServiceStatistics introduces huge latencies

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.1.4, 2.1.5
    • 2.0.23, 2.2.0, 2.1.6
    • Core
    • None

    Description

      Current implementation of IoServiceStatistics is blocking - it blocks on throughputCalculationLock for almost all operations

      However, IoServiceStatistics is used by all threads which writes to IoSession and by all NioProcessor threads.

      Blocking IoServiceStatistics dramatically decreases performance in case of multithreaded writing to IoSession.

      Please, refer to my benchmark to ensure that it is so. The measurements are taken between the time the message was written to IoSession by client and the time when it was actually sent to the server by NioProcessor. Latency percentiles are calculated for all messages except the first 20% - consider it as a warmup. You can read about benchmark details in the README file.

       

      My benchmark results:

      # non-blocking IoServiceStatistics vs blocking IoServiceStatistics:
      
      p50: 85mcs vs 140mcs
      p75: 150mcs vs 400mcs
      p90: 239mcs vs 905mcs
      p95: 319mcs vs 1418mcs
      p99: 1311mcs vs 11485mcs 

       

      As a simple workaround solution, I would suggest to add an option to disable IoServiceStatistics or replace it with custom implementation.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dnovikov95 Dmitrii Novikov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 20m
                  1h 20m