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