Equivalent HTTP/HTTPS/AJP connector attributes mapping between JBoss EAP 5.x and JBoss EAP 6.x

Solution Verified - Updated

Environment

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

Issue

  • In EAP 5.x JBossWeb had the following attributes in HTTP/HTTPS/AJP connector. These attributes are not there in EAP 6.x HTTP/HTTPS/AJP connector.

    • MaxHTTPHeaderSize
    • MaxThreads
    • MinSpareThreads
    • MaxSpareThreads
    • bufferSize
    • acceptCount
    • keepAliveTimeout
    • maxPostSize
    • ciphers
    • truststoreFile
    • packetSize
    • useBodyEncodingForURI
    • server
    • tcpNoDelay
      How can these attributes be configured in EAP 6.x?
  • How do I configure my HTTP/HTTPS/AJP web connectors on EAP 6 (pool size, timeouts, etc)?

  • What will be http/https attributes moving from jboss 5.2 to 6.3 ?

  • Migrating server.xml from EAP 5 to EAP 6

  • In Jboss 5.1, there was an option through server.xml to specify max-threads value & other parameters. Here's a sample entry from jboss 5.1 server.xml :

 <Connector protocol="AJP/1.3" port="8009" address="${jboss.bind.address}"
         redirectPort="8443" URIEncoding="UTF-8" emptySessionPath="true" enableLookups="false" maxThreads="300" connectionTimeout="42000" acceptCount="50"/>

How to specify similar values in jboss eap 6.2?

  • Please let us know how to set max-post-size parameter in JBoss EAP6?
  • If I'd like to change KeepAliveTimeout in JBoss EAP 6.0.1, should I change connectionTimeout too?

Resolution

  • The prior maxThreads settings is now max-connections and is set on the connnectors in the web subsystem. This sizes the JBossWeb level thread/connection pool (default is 512 per CPU core):

      <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http" enabled="true" max-connections="200" />
    
  • Attributes related to Thread can instead set as part of the executor parameter which sets all thread related setting by utilizing a thread subsystem such as bounded-queue-thread-pool. In the example below the http-executor configures the thread settings for the HTTP connector.

      <subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="false">
          <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http" enabled="true" executor="http-executor" max-connections="200" />
          <virtual-server name="default-host" enable-welcome-root="true">
              <alias name="localhost"/>
              <alias name="example.com"/>
          </virtual-server>
      </subsystem>
      <subsystem xmlns="urn:jboss:domain:threads:1.1">
          <bounded-queue-thread-pool name="http-executor">
             <core-threads count="40" />
             <queue-length count="40" />
             <max-threads count="200"  />
          </bounded-queue-thread-pool>
      </subsystem>
    

    When a new task is submitted to the http-executor thread pool, it follows the decision path below:

    • A new thread is created if the number of running threads is less than the core-threads size. This is an optional parameter which defaults to the size specified in the max-threads attribute.
    • Else if there is room (determined from queue-length) in the queue but number of running threads is higher than the core-threads size, then the task gets queued.
    • If the queue is full and the amount of threads is less than max-threads, then a new thread is created. Otherwise the caller blocks the task until another thread becomes available.
    • Once a thread goes idle, it will be removed from the pool if its been idle longer than the executor's keepalive-time and if the number of threads in the pool are greater than the configured core-threads.
  • There is no longer a minSpareThreads or maxSpareThreads equivalent since there is little incentive to reclaim threads. The closest thing to this would be the core-threads size and keepalive-time parameters if you use an executor for the connector instead of the default worker thread pool. Please see the above explanation and refer to Creating & Monitoring Custom Executor for AJP/Http Connectors in EAP6 for details of configuring an executor for this. Please also see Content from docs.jboss.org is not included.JbossWeb7 and Content from community.jboss.org is not included.thread pool configuration for further details.

  • proxyName and proxyPort are set through similar parameters proxy-name and proxy-port on the connector. For example:

      <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http" enabled="true" proxy-name="proxy.com" proxy-port="80"/>
    
  • The MaxHttpHeaderSize attribute needs to be set via system properties. The default for this is 8KB, but here is an example which sets MaxHttpHeaderSize to 8KB:

      <system-properties>
          <property name="org.apache.coyote.http11.Http11Protocol.MAX_HEADER_SIZE" value="8192"/>
      </system-properties>
    
  • The maxKeepAliveRequests is set via the following system property:

      <system-properties>
          <property name="org.apache.coyote.http11.Http11Protocol.MAX_KEEP_ALIVE_REQUESTS" value="1"/>
      </system-properties>
    
  • The connectionTimeout attribute needs to be set via system properties, "org.apache.coyote.ajp.DEFAULT_CONNECTION_TIMEOUT" for AJP connector and "org.apache.coyote.http11.DEFAULT_CONNECTION_TIMEOUT" for HTTP connector. Please also refer to How to set web connector timeout (connectionTimeout) in EAP 6 for details.

  • Until EAP 6.4.0, there's no equivalent parameter to configurable setting for changing keepAliveTimeout and the timeout internally defaults to connectionTimeout as shown above. With This content is not included.BZ#1059511 fixed in EAP 6.4.0 onwards, you can tune keepAliveTimeout by the system property org.apache.coyote.http11.DEFAULT_KEEP_ALIVE_TIMEOUT.

  • There's no equivalent parameters to configurable setting for changing disableUploadTimeout and connectionUploadTimeout. disableUploadTimeout default to true by default. And the socket timeout set by connectionTimeout is internally used instead of connectionUploadTimeout. This content is not included.BZ#1059557 was opened to make disableUploadTimeout and connectionUploadTimeout configurable. (From EAP 6.4.0, you can change disableUploadTimeout by the system property org.apache.coyote.http11.DEFAULT_DISABLE_UPLOAD_TIMEOUT by a partial fix for This content is not included.BZ#1059557. But connectionTimeout is still not configruable and default to 300000.)

  • The packetSize attribute needs to be set via system properties. For example, the following configurations set AJP packetSize to ****:

      <system-properties>
          <property name="org.apache.coyote.ajp.MAX_PACKET_SIZE" value="8192"/>
      </system-properties>
    
  • For "ciphers" you can use "cipher-suite"

  • For the truststore file path you can use "ca-certificate-file"

  • For "maxPostSize" you can use "max-post-size" and for "maxSavePostSize" you can use "max-save-post-size" . Setting it to 0 means unlimited. Note that this parameter can limit data size only when Content-Type is application/x-www-form-urlencoded. See also this article.

  • The compression attribute can be set via the system property org.apache.coyote.http11.Http11Protocol.COMPRESSION. See How to enable compression of server's http response in Jboss EAP 6? for details.

  • The tomcatAuthentication parameter is now configured through a system property. Refer to How to configure tomcatAuthentication in JBoss EAP 6? for further details.

  • The useBodyEncodingForURI parameter is now configured through the org.apache.catalina.connector.USE_BODY_ENCODING_FOR_QUERY_STRING system property (defaulted to false).

  • The server paramater is now configured through the org.apache.coyote.http11.Http11Protocol.SERVER system property. The server header cannot be unset; it can only be changed.

  • The allowTrace parameter is now configured through the org.apache.catalina.connector.ALLOW_TRACE system property.

  • The xpoweredby paramater is now configured through the org.apache.catalina.connector.X_POWERED_BY system property.

  • For -Dorg.apache.tomcat.util.net.WAITFORWORKER=true which can be used to enable backlog (acceptCount), you can specify the system properties org.apache.tomcat.util.net.WAIT_FOR_THREAD instead. However, there's no equivalent parameter to specify backlog (acceptCount) and it defaults to 100 when backlog is enabled. If you want an adjustable amount of backlog connections, you'd need to use an executor pool for your web connector.

  • There's no equivalent parameters to configure tcpNoDelay and it defaults to true according to the source code of Content from grepcode.com is not included.org.apache.coyote.http11.Constants in JBoss Web component.

Components
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.