Tomcat Big concurrency error Maximum number of threads ($) created for connector with address null and port 8080

Source: Internet
Author: User

1, info:maximum number of threads ($) created for connector with address null and port 8091

Description: The maximum number of threads is wrong

Solution:

Using a thread pool to handle more access with fewer threads can improve the ability of Tomcat to process requests. How to use:

First of all. Open/conf/server.xml, add

    1. <Executor name="Tomcatthreadpool" nameprefix="catalina-exec- "
    2. maxthreads= "minsparethreads=" maxidletime= " 60000" />
<executor name= "Tomcatthreadpool" nameprefix= "catalina-exec-" maxthreads= "$            " minsparethreads= "20" Maxidletime= "60000"/>  

Maximum thread 500 (general server sufficient), minimum number of idle threads 20, maximum thread idle time 60 seconds.

Then, modify the <connector ...> node to add executor properties, such as:

  1. <Connector executor="Tomcatthreadpool"
  2. port= "protocol=" http/1.1 "
  3. connectiontimeout="60000"
  4. keepalivetimeout="15000"
  5. maxkeepaliverequests="1"
  6. redirectport="443"
  7. ...... />
<connector executor= "Tomcatthreadpool"                   port= "                 " protocol= "http/1.1" connectiontimeout= "60000" keepalivetimeout= "15000"                 maxkeepaliverequests= "1"                 redirectport= "443"                 ....../>  

2. Java.net.SocketException:Too Many open files

When Tomcat has a large concurrent user volume, a single JVM process may indeed open too many file handles.

Use #lsof-P 10001|wc-l to view file operands

Do the following:

    1. (1). Ps-ef |grep Tomcat View Tomcat's process ID, record ID number, assuming process ID is 10001
    2. (2). lsof-p 10001|wc-l View the current number of file operands with process ID 10001
    3. (3). Use the command: Ulimit-a to see the maximum number of files allowed to open per user
    4. The default is 1024.
    5. (4). Then execute: ulimit-n 65536 to adjust the maximum allowable number of files to 65536

Tomcat Big concurrency error Maximum number of threads ($) created for connector with address null and port 8080

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.