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

AVAIL_PROCS is auto-configured based on core count

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.4.9
    • Fix Version/s: 4.4.10, 5.0-beta3
    • Component/s: HttpCore NIO
    • Labels:
      None

      Description

      In [IOReactorConfig:39|

      https://github.com/apache/httpcomponents-core/blob/92c4c6ff64a9a4a0b0677338c03ebd24bfe1b219/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/IOReactorConfig.java#L39

      ], the default value for thread count is based on the detected cores on the system. This is usually acceptable. However, if the library is being run within a container where the reported number of CPUs does not match the actual amount of CPU available, you will see too many threads created in the pool leading to performance degradation.

      Of course a direct user of this library will be able to set this value to a sensible number. However, you will typically see httpcore-nio 4-5 steps down the dependency graph and it is being used by other open source components which in turn are being used by other components.

      I would suggest that we optionally read a system parameter for the value of AVAIL_PROCS. If that system parameter is not available, then we use the value of Runtime.getRuntime().availableProcessors();

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              elijah Elijah Zupancic
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: