Uploaded image for project: 'HttpComponents HttpCore'
  1. HttpComponents HttpCore
  2. HTTPCORE-390

Lock-less connection pools

    XMLWordPrintableJSON

    Details

      Description

      AbstractNIOConnPool use a ReentrantLock for lease and release connection.
      We have noticed important contention when we try to use hundreds of connexions to the same host, the lock is to vast.

      I managed to rework a part of the code so there is no more use of a ReentrantLock, but use of ConcurrentHashMap and so on.

      The unit tests are ok and the load tests we have made on the patch version are about 40 % faster under heavy load

      Please find attached patch file againt http-nio 4.3.2 and the modified sources files of http-nio 4.3.2

        Attachments

        1. AbstractNIOConnPool.java
          29 kB
          Stephane Routhiau
        2. ConcurrentLinkedQueue.java
          31 kB
          Stephane Routhiau
        3. contention on lease and release.png
          315 kB
          Stephane Routhiau
        4. DefaultConnectingIOReactor.java
          11 kB
          Stephane Routhiau
        5. patch-performance nio pool.patch
          40 kB
          Stephane Routhiau
        6. RouteSpecificPool.java
          7 kB
          Stephane Routhiau
        7. SessionRequestCallback.java
          2 kB
          Stephane Routhiau

          Issue Links

            Activity

              People

              • Assignee:
                olegk Oleg Kalnichevski
                Reporter:
                srouthiau Stephane Routhiau
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: