Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-970

Under heavy load, THttpClient may fail with "too many open files"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.2, 0.3, 0.4, 0.5
    • 0.6
    • Java - Library
    • None
    • All

    Description

      THttpClient uses URL.openConnection which returns a HttpUrlConnection instance for each message transmission.

      HttpUrlConnection supposedly pools connections to the server. While stress testing an application, we've noticed that after several thousands requests, THttpClient would fail with a "Too many open files" error thrown in java.net.Socket.createImpl called from THttpClient.flush.

      As the underlying connection to the server is internally handled by HttpUrlConnection and the JVM, there is unfortunately not much that can be done to remedy this problem while still using HttpUrlConnection.

      I propose a new implementation of THttpClient which uses Apache HttpClient from Http Components instead of HttpUrlConnection.

      Attachments

        1. THRIFT-970-2
          8 kB
          Mathias Herberts
        2. THRIFT-970-1
          8 kB
          Mathias Herberts

        Activity

          People

            herberts Mathias Herberts
            herberts Mathias Herberts
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: