1.Tomcat Optimization Configuration (1) Change Tomcat's catalina.bat Change Java to server mode, increase the memory of jvm, and add setJAVA_OPTS=-server -Xms1024m -Xmx2048m -Xss512K -XX:PermSize=128m -XX:MaxPermSize=256m setCATALINA_OPTS=-server -Xms512m -Xmx512m As shown below: Xms: Initial memory Xmx: Maximum memory (2) Change Tomcat's Server.xml Add the following configuration in <Servicename="Catalina"> (tested, 2000 concurrent connections within 10 seconds are no problem). <Executorname="tomcatThreadPool" namePrefix="catalina-exec-" maxThreads="800"minSpareThreads="25" maxIdleTime="60000"/> <Connectorexecutor="tomcatThreadPool" port="80"protocol="HTTP/1.1" connectionTimeout="60000" keepAliveTimeout="15" maxKeepAliveRequests="200" disableUploadTimeout="false" enableLookups="false" redirectPort="8443"/> Note that the maxThreads number should not be adjusted too large, which may easily cause the following errors: 2. Optimize MySQL configuration (1) Change MySql's my.ini (windows) or my.cnf (linux) max_connections=12000 //The maximum number of connections is generally between 0 and 15000, try not to exceed 15000 max_user_connections=0 // Maximum number of user connections, 0 means no limit interactive_timeout=31536000 // Timeout, set to one year to avoid the following error in the connection pool wait_timeout=31536000 query_cache_size=512m //Query cache, try to set it larger to avoid the following error key_buffer_size=1024m query_cache_type = 1 max_allowed_packet=600m Summarize The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. If you want to learn more about this, please check out the following links You may also be interested in:
|
<<: Vue3+TypeScript encapsulates axios and implements request calls
>>: Solution to 1449 and 1045 exceptions when connecting to MySQL
This article example shares the specific code of ...
Table of contents 1. Modify the my.cnf file of se...
Compared with vue2, vue3 has an additional concep...
<br />In the past, creating a printer-friend...
Record some of the places where you spent time on...
Today, when I logged into the company's inter...
1. If MySQL is not started successfully, check th...
Request logic Front-end --> Request nginx via ...
MySQL 8.0 service cannot be started Recently enco...
Table of contents Preface Global Lock Full databa...
Table of contents 1 Create mount directories and ...
Preface This article uses the new features of MyS...
Nginx uses regular expressions to automatically m...
What is the reason for the Last_IO_Errno:1236 err...
Preface The file system is responsible for organi...