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
I rewrote my personal website recently. I bought ...
Table of contents Why use day.js Moment.js Day.js...
Table of contents Phenomenon Root Cause Analysis ...
Copy code The code is as follows: <html xmlns=...
The system environment is server2012 1. Download ...
When dynamically concatenating strings, we often ...
Original source: www.bamagazine.com There are nar...
1. Linux under VMware Workstation: 1. Update sour...
This article example shares the specific code of ...
After Ubuntu 20.04 is installed, there is no root...
Two cases: 1. With index 2. Without index Prerequ...
MouseEvent When the mouse performs a certain oper...
Preface I watched web.dev's 2020 three-day li...
In SQL, GROUP BY is used to group data in the res...
Sometimes we need to control whether HTML elements...