Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of Tomcat+Mysql High concurrency configuration Optimization

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the example analysis of Tomcat+Mysql high concurrency configuration optimization, which is very detailed and has certain reference value. Friends who are interested must finish it!

Optimized configuration of 1.Tomcat

(1) change the catalina.bat of Tomcat

Change java to server mode, increase the memory of jvm, and increase at the beginning of the file.

SetJAVA_OPTS=-server-Xms1024m-Xmx2048m-Xss512K-XX:PermSize=128m-XX:MaxPermSize=256msetCATALINA_OPTS=-server-Xms512m-Xmx512m

As shown below:

Xms: initial memory

Xmx: maximum memory

(2) change the Server.xml of Tomcat

Add the following configuration in (no problem with 2000 concurrency in 10 seconds).

Note that the number of maxThreads should not be adjusted too large, which can easily lead to the following errors:

2the optimized configuration of Mysql

(1) change the my.ini (windows) or my.cnf (linux) of MySql

The maximum number of max_connections=12000// connections is generally between 015000, which should not exceed the maximum number of 15000max_user_connections=0// user connections. 0 means that there is no limit to the interactive_timeout=31536000// timeout period, and it is set to one year to avoid the error wait_timeout=31536000 in the connection pool shown below.

Query_cache_size=512m / / query cache, set it as large as possible to avoid errors in the following image

Key_buffer_size=1024mquery_cache_type= 1max_allowed_packet=600m above is all the content of the article "sample Analysis of Tomcat+Mysql High concurrency configuration Optimization". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report