Tomcat thread pool Configuration

Source: Internet
Author: User

1: Configure the Executor property

Open the/conf/server.xml file and configure a thread pool before connector:

<executor name= "Tomcatthreadpool"         nameprefix= "tomcatthreadpool-"         maxthreads= "1000"          maxidletime= "300000"        minsparethreads= "$"/>

Important Parameter Description:

Name: The names of the shared thread pools. This is connector in order to share the name of the thread pool to be referenced, the name must be unique. Default value: None;

Nameprefix: On the JVM, each running thread can have a name string. This property sets a prefix for the name string for each thread in the thread pool, and Tomcat appends the thread number to the prefix. Default value: tomcat-exec-;

maxthreads: The maximum number of threads that the thread pool can hold. Default value: 200;

maxidletime: The time, in milliseconds, that the idle thread is allowed to persist before Tomcat shuts down an idle thread. Idle threads are closed only if the current number of active threads is greater than the value of Minsparethread. Default value: 60000 (one minute).

minsparethreads: The minimum number of inactive threads that Tomcat should always open. Default value: 25.

2: Configure connector

<connector executor= "Tomcatthreadpool"           port= "8080" protocol= " Org.apache.coyote.http11.Http11NioProtocol "           connectiontimeout=" 20000 "           redirectport=" 8443 "            minprocessors=" 5 "           maxprocessors="           acceptcount= ""/> "

Important Parameter Description:
Executor: Represents the thread pool corresponding to the value of this parameter;

Minprocessors: The number of threads that are created at server startup to process requests;

Maxprocessors: The maximum number of threads that can be created to process requests;

Acceptcount: Specifies the number of requests that can be placed in the processing queue when all the threads that can be used to process the request are used, and requests that exceed this number will not be processed.

Tomcat thread pool Configuration

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.