How to set web connector timeout (connectionTimeout) in EAP 6

Solution Verified - Updated

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x

Issue

  • How do we configure the web connector timeout (connectionTimeout) in EAP 6?
  • Our clients send keepAlive requests (without timeout) – which raises the number of connections in pool until we rich jboss’ max-threads. In the previous version there was a security mechanism to prevent that from happening so we could control the HTTP KEEP ALIVE TIMEOUT. How do we configure connection timeout in EAP 6 ?
  • Please suggest parameter similar for connection timeout for ajp?
  • Where can we find Connection time out setting for https traffic in JBOSS EAP Configuration

Resolution

For EAP 6, you can configure the web connector timeout (connectionTimeout) by using the following system properties:

  • org.apache.coyote.ajp.DEFAULT_CONNECTION_TIMEOUT for AJP connecor. If not specfied, default value is "-1" (no timeout)
  • org.apache.coyote.http11.DEFAULT_CONNECTION_TIMEOUT for HTTP(s) connector. If not specfied, default value is "60000" milli-seconds (= 60 seconds)

For example, if you want to set AJP connectionTimeout to 600000 (600000 millseconds = 600 seconds = 10 minutes) and HTTP connectionTimeout to 120000 (120000 millseconds = 120 seconds = 2 minutes), add the following JAVA_OPTS to standalone.conf:

    JAVA_OPTS="$JAVA_OPTS -Dorg.apache.coyote.ajp.DEFAULT_CONNECTION_TIMEOUT=600000"
    JAVA_OPTS="$JAVA_OPTS -Dorg.apache.coyote.http11.DEFAULT_CONNECTION_TIMEOUT=120000"

Those options can also be set straight on the command line at startup in standalone mode, for example:

./standalone.sh -Dorg.apache.coyote.http11.DEFAULT_CONNECTION_TIMEOUT=120000

Or add the followings to standalone.xml/domain.xml between the extensions and management sections:

    <system-properties>
        <!-- connectionTimeout for AJP connector. Default value is "-1" (no timeout). -->
        <property name="org.apache.coyote.ajp.DEFAULT_CONNECTION_TIMEOUT" value="600000"/>
        <!-- connectionTimeout for HTTP connector. Default value is "60000". -->
        <property name="org.apache.coyote.http11.DEFAULT_CONNECTION_TIMEOUT" value="120000"/>
    </system-properties>

You can add the above system-property setting by the following CLI:

    /system-property=org.apache.coyote.ajp.DEFAULT_CONNECTION_TIMEOUT:add(value=600000)
    /system-property=org.apache.coyote.http11.DEFAULT_CONNECTION_TIMEOUT:add(value=120000)

Then you need to restart server to get system-properties applied.


You can use the following method to verify/check the settings after restart JBoss

  • Administration console (http://<hostname>:9990):
  1. Go to Server --> Server Status --> Platform --> Environment --> Environment Properties
  2. You can see all applied system properties. If your settings are applied successfully, they will be found in the list:
org.apache.coyote.ajp.DEFAULT_CONNECTION_TIMEOUT	<value1>
org.apache.coyote.http11.DEFAULT_CONNECTION_TIMEOUT	<value2>
  • JBoss CLI:

    You can see all applied system properties by the following CLI command:

    • standalone mode:
[standalone@IP_ADDRESS:9999 /] /core-service=platform-mbean/type=runtime:read-attribute(name=system-properties)  
  • domain mode:
[domain@IP_ADDRESS:9999 /] /host=master/server=server-one/core-service=platform-mbean/type=runtime:read-attribute(name=system-properties)  
  • jinfo command:

    You can see all applied system properties by the following CLI command:

    jinfo <JAVA_PID>
    

    You can see the above properties specifically by the following CLI command:

    jinfo <JAVA_PID> | grep DEFAULT_CONNECTION_TIMEOUT
    
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.