Bug 1095000 - EAP 6 WebConnectorComponent computes an incorrect default max-connections property value
Summary: EAP 6 WebConnectorComponent computes an incorrect default max-connections pro...
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: Plugin -- JBoss EAP 6
Version: JON 3.2
Hardware: Unspecified
OS: Unspecified
Target Milestone: DR01
: JON 3.3.0
Assignee: RHQ Project Maintainer
QA Contact: Armine Hovsepyan
Depends On:
Blocks: 1091235 1119863
TreeView+ depends on / blocked
Reported: 2014-05-06 22:15 UTC by Larry O'Leary
Modified: 2018-12-09 17:49 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
The JBossWeb Connector resource component attempted to determine the value for "Max Connections" if the underlying JBoss EAP server indicated the value was undefined. This caused an incorrect value to be set for the property if the underlying connector implementation was not the default JIO connector type. The JBossWeb Connector resource no longer sets a calculated "Max Connections" value, and defers to JBoss EAP and its connector subsystem to determine the default based on the connector implementation. When "Max Connections" is "unset", it no longer overrides the connector's default implementation for maximum connections.
Clone Of:
: 1119863 (view as bug list)
Last Closed: 2014-12-11 14:02:54 UTC
Type: Bug

Attachments (Terms of Use)

Description Larry O'Leary 2014-05-06 22:15:26 UTC
Description of problem:
The configuration for a web connector reports incorrect "Max Connections" if the default is used. For example, when using an APR connector, the default should be 32 * <cpu-cores>. In an 8 core system the value should then be 256, however, JBoss ON is reporting it as 4096.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Install EAP 6.2 and configure it to use APR (native) connectors.
2. Install JBoss ON 3.2 system.
3. Import EAP 6 into inventory.
4. Configure the EAP resource's connection settings.
5. Navigate to the EAP resources _Web / Connectors / ajp_ resource's configuration page.

Actual results:
Max Connections value is (512 * <num-cpu-cores>)

Expected results:
Max Connections value is (32 * <num-cpu-cores>)

Additional info:

As seen in [1], if the max-connection property is null--in other words, undefined--a call is made to computeMaxConnections[2]. It is there in which this artificial default value is calculated. This calculation appears to be way off. 

In computeMaxConnections the schema is being used to determine the calculation. However, default values are based on the JIO connector and APR connectors (native) and have nothing to do with the schema.

This has also been reported as a bug in the "description" of the "Max Connections" as seen in bug 1091235. 

[1]: https://github.com/rhq-project/rhq/blob/master/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/WebConnectorComponent.java#L80
        if (maxConnProp.getStringValue() == null) {

[2]: https://github.com/rhq-project/rhq/blob/master/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/WebConnectorComponent.java#L102

        op = new ReadAttribute(getAddress(), "scheme");
        res = getASConnection().execute(op);
        if (res.isSuccess()) {
            scheme = (String) res.getResult();

        if ("http".equals(scheme))
            val = cores * 512;
        else if ("https".equals(scheme)) {
            val = cores * 512;
        } else if ("ajp".equals(scheme))
            val = 32 * cores;
        return val;

Comment 2 James Livingston 2014-05-07 05:47:55 UTC
The exact logic is:

Normally, JIO is used (http://anonsvn.jboss.org/repos/jbossweb/branches/7.4.x/src/main/java/org/apache/tomcat/util/net/JIoEndpoint.java):
maxThreads = (org.apache.tomcat.util.Constants.LOW_MEMORY) ? 64 : ((Constants.MAX_THREADS == -1) ? 512 * Runtime.getRuntime().availableProcessors() : Constants.MAX_THREADS);

APR (native) http://anonsvn.jboss.org/repos/jbossweb/branches/7.4.x/src/main/java/org/apache/tomcat/util/net/AprEndpoint.java
maxThreads = (org.apache.tomcat.util.Constants.LOW_MEMORY) ? 32 : ((Constants.MAX_THREADS == -1) ? 32 * Runtime.getRuntime().availableProcessors() : Constants.MAX_THREADS);

NIO (unsupported I think) - http://anonsvn.jboss.org/repos/jbossweb/branches/7.4.x/src/main/java/org/apache/tomcat/util/net/NioEndpoint.java, http://anonsvn.jboss.org/repos/jbossweb/branches/7.4.x/src/main/java/org/apache/tomcat/util/net/AbstractEndpoint.java)
maxThreads = (org.apache.tomcat.util.Constants.LOW_MEMORY) ? 32 : ((Constants.MAX_THREADS == -1) ? 32 * Runtime.getRuntime().availableProcessors() : Constants.MAX_THREADS);

So usually 32 * cpus for native and 512 * cpus otherwise as Larry says.

Comment 4 Lukas Krejci 2014-07-21 20:05:24 UTC
in master

commit ff200f352243cae35993485062844c0d3a17e09c
Author: Lukas Krejci <lkrejci@redhat.com>
Date:   Mon Jul 21 22:00:59 2014 +0200

    [BZ 1095000] Don't try to guess web connector's max connections.

Comment 5 Lukas Krejci 2014-07-22 14:23:38 UTC
commit 735365ddbf20409003e7ede9f47d4489a0f6c41a
Author: Lukas Krejci <lkrejci@redhat.com>
Date:   Tue Jul 22 16:22:13 2014 +0200

    [BZ 1095000] Fix test failures.

Comment 6 Simeon Pinder 2014-07-31 15:52:07 UTC
Moving to ON_QA as available to test with brew build of DR01: https://brewweb.devel.redhat.com//buildinfo?buildID=373993

Comment 7 Jan Bednarik 2014-08-15 13:51:18 UTC
moving to VERIFIED

All test cases as discussed with Larry passed when tested on both http and ajp connector:

- the value Max Connections is unset by default
  -> ok, EAP CLI shows 'undefined' if connector resource is read

- changing unrelated configuration does not break configuration update
  -> ok, changing value of 'Max Save Post Size' succeeds, change can be seen also using EAP CLI

- changing 'Max Connections' to some seemingly valid value
  -> ok, chaning value to 512 succeeds, change can be seen also using EAP CLI

- re-check the unset checkbox again
  -> ok, configuration change suceeds, EAP CLI shows 'undefined' again

Build Number:6468454:dda0a47

Comment 9 Jared MORGAN 2014-10-29 01:42:18 UTC
Hey Armine, can you please help me out with some release note text for this issue. I'm drawing blanks when I try to create a succinct explanation for the fix and result.

Note You need to log in before you can comment on or make changes to this bug.