Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are acceptCount, maxConnections and maxThreads in Tomcat HTTP connector configuration?

Tags:

tomcat7

This is the configuration I'm using

 <Connector port="8080" protocol="HTTP/1.1"
           connectionTimeout="20000"
           redirectPort="8443" acceptCount="1000" maxConnections="500" />

I have read the doc but can't able to understand, please explain with an example if possible, and what is relationship between them.

like image 967
Rohan Dodeja Avatar asked Sep 22 '16 16:09

Rohan Dodeja


People also ask

What is maxThreads in Tomcat?

By default, Tomcat sets maxThreads to 200, which represents the maximum number of threads allowed to run at any given time. You can also specify values for the following parameters: minSpareThreads : the minimum number of threads that should be running at all times.

What are two types of connectors used in Tomcat?

There are two basic Connector types available in Tomcat - HTTP and AJP. Here's some information about how they differ from one another, and situations in which you might use them.

What is the name of the connector component of Apache Tomcat?

The HTTP Connector element represents a Connector component that supports the HTTP/1.1 protocol. It enables Catalina to function as a stand-alone web server, in addition to its ability to execute servlets and JSP pages.

What is maxPostSize in Tomcat?

maxPostSize. The maximum size in bytes of the POST which will be handled by the container FORM URL parameter parsing. The limit can be disabled by setting this attribute to a value less than zero. If not specified, this attribute is set to 2097152 (2 megabytes).


1 Answers

acceptCount -- The maximum queue length for incoming connection requests when all possible request processing threads are in use. Any requests received when the queue is full will be refused. The default value is 100.

redirectPort -- if this Connector is supporting non-SSL requests, and a request is received for which a matching <security-constraint> requires SSL transport, Catalina will automatically redirect the request to the port number specified here.

MaxConnections -- The maximum number of connections that the server will accept and process at any given time. When this number has been reached, the server will accept, but not process, one further connection.

connectionTimeout -- The number of milliseconds this Connector will wait, after accepting a connection, for the request URI line to be presented

acceptCount is like the line waiting to get into a popular nightclub that is full. (maxConnections) when some people leave maxConnections goes down allowing more people to connect from the acceptCount waiting list. The connection timeout is simply how long it will wait for the request. So you can either make the line longer (acceptCount) or make the nightclub larger (maxConnections)

Redirect port is how/where it handles a redirect due to a security restraint.

like image 129
brad Avatar answered Sep 27 '22 15:09

brad