tomcat默认线程池大小_tomcat线程池满应该如何处理

后端 (6) 2024-04-05 20:23

Hi,大家好,我是编程小6,很荣幸遇见你,我把这些年在开发过程中遇到的问题或想法写出来,今天说一说tomcat默认线程池大小_tomcat线程池满应该如何处理,希望能够帮助你!!!。
Tomcat线程池及性能优化(重点)

 

 

tomcat默认线程池大小_tomcat线程池满应该如何处理_https://bianchenghao6.com/blog_后端_第1张

tomcat默认线程池大小_tomcat线程池满应该如何处理_https://bianchenghao6.com/blog_后端_第2张

只需安装Tomcat

[root@localhost ~]# vim /usr/local/tomcat8/conf/server.xml

修改处如下:
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" maxThreads="1024" minSpareThreads="100" prestarminSpareThreads="true" />

[root@localhost ~]# netstat -anpt | grep :8080
tcp6 0 0 :::8080 :::* LISTEN 9109/java

[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# iptables -F

[root@localhost ~]# /usr/local/tomcat8/bin/shutdown.sh 

[root@localhost ~]# /usr/local/tomcat8/bin/startup.sh 

修改前

tomcat默认线程池大小_tomcat线程池满应该如何处理_https://bianchenghao6.com/blog_后端_第3张

修改后:

tomcat默认线程池大小_tomcat线程池满应该如何处理_https://bianchenghao6.com/blog_后端_第4张

=========================================================================================

优化关键词:

tomcat默认线程池大小_tomcat线程池满应该如何处理_https://bianchenghao6.com/blog_后端_第5张

tomcat默认线程池大小_tomcat线程池满应该如何处理_https://bianchenghao6.com/blog_后端_第6张

tomcat默认线程池大小_tomcat线程池满应该如何处理_https://bianchenghao6.com/blog_后端_第7张

tomcat默认线程池大小_tomcat线程池满应该如何处理_https://bianchenghao6.com/blog_后端_第8张

tomcat默认线程池大小_tomcat线程池满应该如何处理_https://bianchenghao6.com/blog_后端_第9张

tomcat默认线程池大小_tomcat线程池满应该如何处理_https://bianchenghao6.com/blog_后端_第10张

一般在生产中可以选择自行优化,优化如下:

[root@localhost ~]# vim /usr/local/tomcat8/conf/server.xml

tomcat默认线程池大小_tomcat线程池满应该如何处理_https://bianchenghao6.com/blog_后端_第11张

===============================================================================

禁用TomcatAJP连接器

tomcat默认线程池大小_tomcat线程池满应该如何处理_https://bianchenghao6.com/blog_后端_第12张

禁用掉端口:

[root@localhost ~]# vim /usr/local/tomcat8/conf/server.xml 

   <!-- <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />-->                            //注释掉这一段

 

今天的分享到此就结束了,感谢您的阅读,如果确实帮到您,您可以动动手指转发给其他人。