Tomcat error info: Maximum number of threads (200) created for connector with address null and port 8080

Source: Internet
Author: User

I. Problems Found

Info: Maximum number of threads (200) created for connector with address null and port 8080

The maximum number of threads is incorrect.
Solution: Use a thread pool to process more requests with fewer threads, which can improve Tomcat's ability to process requests.


Ii. Usage

Open/CONF/server. xml and add

<Executor name = "tomcatthreadpool" nameprefix = "Catalina-Exec -"

Maxthreads = "500" minsparethreads = "20" maxidletime = "60000"/>

The maximum number of threads is 500 (generally enough on the server), the minimum number of Idle threads is 20, and the maximum idle time of the thread is 60 seconds. Modify the <connector> node to add the executor attribute.

<Connector executor = "tomcatthreadpool"
Port = "80" protocol = "HTTP/1.1"
Connectiontimeout = "60000"
Keepalivetimeout = "15000"
Maxkeepaliverequests = "1"
Redirectport = "443" type = "regxph" text = "yourobjectname"/>


Iii. Viewing file operations in Linux

Java.net. socketexception: Too program open files. When the number of concurrent Tomcat users is large, a single JVM process may indeed open too many file handles. Use lsof-P 10001 | WC-L to view the file operations.

1. PS-Ef | grep Tomcat
View the Tomcat process ID and record the ID. Assume that the process ID is 10001.

2. lsof-P 10001 | WC-l
View the file operations with the current process ID 10001

3. ulimit-
View the maximum number of files that a user can open. The default value is 1024.

4. ulimit-N 65536
Adjust the maximum number of allowed files to 65536


Original post address: http://blog.csdn.net/ygd266/article/details/8255746

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.