Common configuration of Tomcat Connector elements (max connections, etc)

Source: Internet
Author: User

In Tomcat server. XML, there are similar:

<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" maxSpareThreads="750" maxThreads="1000" minSpareTHreads="50" acceptCount="1000"  maxProcessors="1000"   URIEncoding="gbk" useBodyEncodingForURI="true"/>

Configuration, where:

Acceptcount = "1000" Maximum number of accepted connections

Maxprocessors = "1000" Maximum number of active threads

Port = "8080" service port

Protocol = "HTTP/1.1" service protocol

Connectiontimeout = "20000" timeout time in MS

When the redirectport = "8443" redirection port requires secure communication, the customer request will be forwarded to the SSL redirectport

Maxthreads: the maximum number of threads that can be created by Tomcat. Each thread processes a request. maxthreads determines the maximum thread threshold value of Tomcat.

Minsparethreads: Minimum number of backup threads and number of initialization threads at Tomcat startup;

Maxsparethreads: Maximum number of standby threads. Once the created thread exceeds this value, Tomcat will close socket threads that are no longer needed;


Uriencoding = "GBK" sets the default transcoding format of Tomcat

View the instructions for $ tomcat_home/webapps/tomcat-docs/config/http.html, which are described as follows:
Uriencoding: This specifies the character encoding used to decode the URI bytes, after % XX decoding the URL. if not specified, ISO-8859-1 will be used. that is to say, if you do not set uriencoding, Tomcat by default is based on the ISO-8859-1 URL Decoding, ISO-8859-1 does not include Chinese characters, so the Chinese characters must not be correctly parsed.


How can I check the number of connections of current tomcat?

Assume that two Tomcat instances are enabled on the server, listening to ports 8040 and 8050 respectively.

Netstat-Na | grep estab | grep 8040 | WC-l

Netstat-Na | grep estab | grep 8050 | WC-l


The sum of the two is the number of connections to all Tomcat servers.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.