Adjust the number of concurrent databases in the production environment and the number of concurrent databases in the environment

Source: Internet
Author: User

Adjust the number of concurrent databases in the production environment and the number of concurrent databases in the environment
During development and testing, we often do not care much about the concurrency configuration related to the database, because the system concurrency is not large during development and testing. Therefore, setting these parameters correctly does not affect the result. However, after the production environment is installed, the concurrency of the system is greatly increased, if you do not pay attention to the concurrency configuration of the database, the database will become the final concurrency bottleneck of the system. Based on my concurrent tests in the actual project for a period of time, I found that the number of database concurrency needs to be configured in a few places, I hope to share with you, can take less detoursConcurrent Database Configuration 

  • View the maximum number of connections of the mysql database server
Show variables like 'max _ connections '; (view the current maximum number of connections) show global status like 'max _ used_connections'; (view the maximum number of connections in the database history)
  • Modify mysql configuration file my. cnf
Max_connections = 3000 keep Max_used_connections/max_connections = around 85%
  • Modify the configuration of the data source in the program. (This is very important. I forgot to modify the configuration here and only changed the database. As a result, the historical concurrency of the database has been increasing.
No) <property name = "maxActive" value = "500"/> <property name = "maxIdle" value = "10"/> <property name = "initialSize" value = "10" />

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.