Equivalent HTTP/HTTPS/AJP connector attributes mapping between JBoss EAP 5.x and JBoss EAP 6.x
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.xmlto specifymax-threadsvalue & other parameters. Here's a sample entry from jboss 5.1server.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-sizeparameter in JBoss EAP6? - If I'd like to change KeepAliveTimeout in JBoss EAP 6.0.1, should I change connectionTimeout too?
Resolution
-
The prior
maxThreadssettings is nowmax-connectionsand 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
executorparameter which sets all thread related setting by utilizing athreadsubsystem such asbounded-queue-thread-pool. In the example below thehttp-executorconfigures 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-executorthread pool, it follows the decision path below:- A new thread is created if the number of running threads is less than the
core-threadssize. This is an optional parameter which defaults to the size specified in themax-threadsattribute. - Else if there is room (determined from
queue-length) in the queue but number of running threads is higher than thecore-threadssize, 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-timeand if the number of threads in the pool are greater than the configuredcore-threads.
- A new thread is created if the number of running threads is less than the
-
There is no longer a
minSpareThreadsormaxSpareThreadsequivalent since there is little incentive to reclaim threads. The closest thing to this would be thecore-threadssize andkeepalive-timeparameters if you use anexecutorfor the connector instead of the defaultworkerthread pool. Please see the above explanation and refer to Creating & Monitoring Custom Executor for AJP/Http Connectors in EAP6 for details of configuring anexecutorfor 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. -
proxyNameandproxyPortare set through similar parametersproxy-nameandproxy-porton 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
MaxHttpHeaderSizeattribute needs to be set via system properties. The default for this is 8KB, but here is an example which setsMaxHttpHeaderSizeto 8KB:<system-properties> <property name="org.apache.coyote.http11.Http11Protocol.MAX_HEADER_SIZE" value="8192"/> </system-properties> -
The
maxKeepAliveRequestsis set via the following system property:<system-properties> <property name="org.apache.coyote.http11.Http11Protocol.MAX_KEEP_ALIVE_REQUESTS" value="1"/> </system-properties> -
The
connectionTimeoutattribute 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
keepAliveTimeoutand the timeout internally defaults toconnectionTimeoutas shown above. With This content is not included.BZ#1059511 fixed in EAP 6.4.0 onwards, you can tunekeepAliveTimeoutby the system propertyorg.apache.coyote.http11.DEFAULT_KEEP_ALIVE_TIMEOUT. -
There's no equivalent parameters to configurable setting for changing
disableUploadTimeoutandconnectionUploadTimeout.disableUploadTimeoutdefault totrueby default. And the socket timeout set byconnectionTimeoutis internally used instead ofconnectionUploadTimeout. This content is not included.BZ#1059557 was opened to makedisableUploadTimeoutandconnectionUploadTimeoutconfigurable. (From EAP 6.4.0, you can changedisableUploadTimeoutby the system propertyorg.apache.coyote.http11.DEFAULT_DISABLE_UPLOAD_TIMEOUTby a partial fix for This content is not included.BZ#1059557. ButconnectionTimeoutis still not configruable and default to300000.) -
The
packetSizeattribute needs to be set via system properties. For example, the following configurations set AJPpacketSizeto****:<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 whenContent-Typeisapplication/x-www-form-urlencoded. See also this article. -
The
compressionattribute can be set via the system propertyorg.apache.coyote.http11.Http11Protocol.COMPRESSION. See How to enable compression of server's http response in Jboss EAP 6? for details. -
The
tomcatAuthenticationparameter is now configured through a system property. Refer to How to configure tomcatAuthentication in JBoss EAP 6? for further details. -
The
useBodyEncodingForURIparameter is now configured through theorg.apache.catalina.connector.USE_BODY_ENCODING_FOR_QUERY_STRINGsystem property (defaulted to false). -
The
serverparamater is now configured through theorg.apache.coyote.http11.Http11Protocol.SERVERsystem property. The server header cannot be unset; it can only be changed. -
The
allowTraceparameter is now configured through theorg.apache.catalina.connector.ALLOW_TRACEsystem property. -
The
xpoweredbyparamater is now configured through theorg.apache.catalina.connector.X_POWERED_BYsystem property. -
For
-Dorg.apache.tomcat.util.net.WAITFORWORKER=truewhich can be used to enablebacklog(acceptCount), you can specify the system propertiesorg.apache.tomcat.util.net.WAIT_FOR_THREADinstead. However, there's no equivalent parameter to specifybacklog(acceptCount) and it defaults to100when 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
tcpNoDelayand it defaults totrueaccording to the source code of Content from grepcode.com is not included.org.apache.coyote.http11.Constants inJBoss Webcomponent.
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.