How do I configure Apache Tomcat to support more connections in Ubuntu 18.04 LTS

Linode Staff

I am trying to configure my Apache Tomcat service and am getting 503 Service Unavailable Errors.

Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

Apache/2.4.29 (Ubuntu) Server at xxx.xxx.xxx.xxx Port 80

How do I fix this problem?

1 Reply

A guide to installing Apache Tomcat on an earlier version of Ubuntu can be found here:

It is hard to know what is going on here without knowing more. At first glance the error message being reported is coming from a stand alone Apache2 server. Are you trying to integrate Apache with Apache Tomcat?

(see Why should I integrate Apache HTTP Server with Apache Tomcat? (or not))

It would be helpful if you could provide more information about which configuration options you are using and the results you are trying to achieve.

According to the documentation for Apache Tomcat,

Each incoming request requires a thread for the duration of that request. If more simultaneous requests are received than can be handled by the currently available request processing threads, additional threads will be created up to the configured maximum (the value of the maxThreads attribute). If still more simultaneous requests are received, they are stacked up inside the server socket created by the Connector, up to the configured maximum (the value of the acceptCount attribute). Any further simultaneous requests will receive "connection refused" errors, until resources are available to process them.

The following article suggests increasing the maxThreads value in your Tomcat server.xml file: https://stackoverflow.com/questions/8825618/tomcat-responding-http-503

Further information may be helpful to troubleshooting this issue. If you could explain what changes were being made at the time the problem occurred it may be helpful in narrowing down the cause.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct