naimul64
naimul64

Reputation: 143

How can I generate a 503 error by configuring tomcat?

I want to configure my Apache Tomcat/8.5.37 by setting configuration attributes like maxThreads, maxConnections, acceptCount etc. in such a way, I can get 503 error in reply to a REST call by sending some concurrent requests (like 100 requests at a time). How can to do that?

Edit: I am getting 'connection refused' response in some cases. How can I get status 503 instead of 'connection refused'?

Upvotes: 1

Views: 721

Answers (1)

Emdadul Sawon
Emdadul Sawon

Reputation: 6077

In server.xml file add following section

<Connector port="8080" protocol="HTTP/1.1"
           maxThreads="10"
           maxConnections="10"
           connectionTimeout="20000"
           redirectPort="8443"
           maxPostSize="209715200" />

For more information read this. This answer also may help

Upvotes: 1

Related Questions