0

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?

rustyx
  • 1,676
  • 3
  • 21
  • 30

1 Answers1

1

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.

rustyx
  • 1,676
  • 3
  • 21
  • 30