JBossWeb connectors start before application deployments and start up is complete on EAP 6

Solution Verified - Updated

Environment

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

Issue

  • JBossWeb connectors fully start and accept requests long before the server starts and applications fully deploy. This leads to unneeded 404s as JBoss starts accepting the incoming traffic before completing deployments.
  • With very heavy load starting to those early started connectors, the resulting activity in web request threads for these 404s can even impact performance of MSC threads at start up to delay a full start by several minutes.
  • When the jboss starts with errors in a node we do not want mod_cluster to send requests to that node. Is that possible? How can we do it?

Resolution

  • A feature request for this has been submitted, and an improvement has been added in EAP 6.2.0 and later. This introduces the org.apache.catalina.connector.WAIT_FOR_BEFORE_START system property. You can set this system property to a comma delimited list of application contexts, for example:

      -Dorg.apache.catalina.connector.WAIT_FOR_BEFORE_START=/yourapp1,/yourapp2
    

JBoss should then not start connectors until after /yourapp1 and /yourapp2 have been deployed.

  • As a workaround, start JBoss without the connector. Once your deployments/startup have completed, you can then add the connector through CLI to start it and allow traffic, for example:

      /profile=ha/subsystem=web/connector=http:add(socket-binding=http,protocol="HTTP/1.1",enabled=true,scheme="http")
    

    This workaround works for HTTP and AJP connectors, but it does not work for HTTPS unfortunately because the addition of the SSL configuration currently requires a restart.

  • Another workaround is to use an httpd mod_cluster proxy. mod_cluster will only proxy traffic through to a JBoss server after that JBoss server has deployed the relevant application.

Root Cause

  • JBossWeb connectors do not wait for notification of a completed server start up before they are enabled as was done in EAP 5 and earlier.
  • There is a bugzilla for this, This content is not included.BZ-918130
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.