It seems that Tomcat's connectors by default start listening before the server is fully started.

The result is that in a HA setup some HTTP requests appear "hanging" for a considerable duration of time (30-60 seconds).

Is there a setting to delay binding to ports until after the web apps are started?


As described in the documentation, use the bindOnInit setting.

    <Connector ...  bindOnInit="false"  ...  />

Then the connectors will bind to the ports when the server is fully started and ready to server requests.

The downside is that if the bind fails, e.g. the port is already taken, the web apps will be started unnecessarily and then immediately stopped.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.