Xiaobai asked the question of tomcat performance optimization, and the stress test results before and after optimization were the same.

tomcat8 default configuration:

ab4001000
ab
1

2

tomcat8:
catalina.shjvmserver.xml

tomcat8nio

ab
ab
1

2

(only some simple parameters are modified here, but they should be the most direct and effective, not even the simple ones, not to mention the advanced parameters. The java program tested is a normal business code for querying data from multiple tables. At first, it was thought that it was a database problem, but it was found that connection pooling had been enabled. Xiaobai just graduated and asked for advice from online bigwigs. )

Jun.28,2021

you modified the number of memory and threads, but did not improve performance because of the changes in these parameters, indicating that memory was abundant and the number of threads was not a bottleneck.
the first thing to do is measure . Without measurement optimization, there is no goal. You need to measure the time spent in each phase of the system. The database aspect is usually the most time-consuming part. Connection pooling solves the problem of shortening the time it takes to establish a connection. The number of connections is generally only 2030 by default (you do not provide the corresponding information, it is not clear what your setting is), your 400 concurrency may not be enough connection pooling. Even if sufficient, the query time will not be reduced. The most effective way to optimize database queries is usually appropriate caching.


the test results are the same before and after optimization, indicating that it is not optimized to the bottleneck, indicating that the bottleneck of the system is not the configuration of tomcat.
I do not know what the response time of the system is without so much pressure. If it is still so slow, first optimize the database query and so on

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bf7f6b-3190f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bf7f6b-3190f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?