Last updated: 2020-05-15 16:37:18PDF
Limits on Data Volume
Given the limited resources, TencentDB for MySQL imposes certain limits on data volume of all types of MySQL instances for the purpose of performance issue isolation. This document describes from a technical perspective what impact a single instance or table with a high data volume will have on MySQL:
Instance with a high data volume: the default storage engine for TencentDB is InnoDB. If the cache buffer can cache all data and index pages in the MySQL instance, the instance can support a large number of concurrent access requests. If the instance contains too much data, the cache and buffer will swap data in/out frequently; in this case, the performance bottleneck of MySQL will soon spread to IO, which will reduce the throughput. For example, a TencentDB instance designed to sustain up to 8,000 access requests per second can merely support 700 ones per second if the data volume is twice the size of the cache and buffer.
Table with a high data volume: if a table contains too much data, the cost for MySQL to manage table resources (data, indices, etc.) will change, which will affect the table processing efficiency. For example, if the size of a transaction table (InnoDB) exceeds 5 GB, the latency in update operations will soar, increasing the response time for transactions. In this case, the problem can only be solved through sharding and migration.
If the number of tables in a single instance exceeds 1 million, table backup, monitoring, and upgrade may fail, and database-level monitoring may be affected. Please control this value appropriately and make sure that it is below 1 million.
Limits on Number of Connections
The maximum number of connections to a MySQL instance is specified with the MySQL system variable
max_connections. When the actual number exceeds
max_connections, no more connections can be established.
The default number of connections to TencentDB can be viewed on the parameter settings page in the console, which can be adjusted if necessary. However, more connections mean that more system resources will be consumed; if the number of connections goes beyond what the actual system load capacity permits, the system service quality will be definitely undermined.
For more information on
max_connections, please see MySQL's official documentation.
Limits on MySQL Client Version
It is recommended to use the MySQL client and library that come with CVM to connect to TencentDB instances.
Notes on slow queries
- For Linux CVM instances, you can use TencentDB's export tool to get slow query logs. For more information, please see Downloading Backup Files and Logs.
- For Windows CVM instances, slow query logs cannot be obtained directly at present. If you need them, please submit a ticket for assistance.
Notes on TencentDB binlog retention duration
TencentDB for MySQL binlogs can be retained for 7 (default value) to 732 days (customizable in automatic backup settings). The number of days set for log backup retention must be smaller than that for data backup retention.
If binlogs are retained for a prolonged period of time or increase too fast, more space will be needed for backup. If the space exceeds the free tier of backup capacity, fees will be incurred.
Notes on character set
Just as MySQL, the default character set in TencentDB is LATIN1 (ISO-8859-1).
Even though TencentDB supports changing the default character set, you are recommended to explicitly specify the table encoding format when creating it and specify the connection encoding during connection establishment. In this way, your application will be more portable.
For more information on the resources of MySQL character set, please see MySQL's official documentation.
The steps to change the TencentDB character set are as follows:
- Run the following statements to change the default character set encoding for TencentDB instances:
After the statements are executed,
SET @@global.character_set_client = utf8; SET @@global.character_set_results = utf8; SET @@global.character_set_connection = utf8; SET @@global.character_set_server = utf8;
@@global.character_set_serverwill be automatically synced to a local file for persistence in approximately 10 minutes, while the other 3 variables will not. The configured value will stay unchanged even after migration or restart.
- Run the following statements to change the character set encoding for the current connection:
SET @@session.character_set_client = utf8; SET @@session.character_set_results = utf8; SET @@session.character_set_connection = utf8;
SET names utf8;
- For PHP programs, you can configure the character set encoding for the current connection by using the following function:
bool mysqli::set_charset(string charset);
bool mysqli_set_charset(mysqli link, string charset);
- For Java programs, you can configure the character set encoding for the current connection as shown below:
Limits on operations
- Do not modify the information and permissions of the existing accounts for a MySQL instance; otherwise, some cluster services may become unavailable.
- InnoDB is recommended for creating databases and tables, so that the instances can better support a large number of concurrent access requests.
- Do not modify or terminate the master-slave relationship; otherwise, hot backup may fail.
Limits on table name
Please note that Chinese table names are not supported because they may result in failures of processes such as rollback and upgrade.
Database account permission
TencentDB for MySQL no longer provides the super user permission. To modify parameters that require this permission, you can use the parameter configuration feature in the console or submit a ticket for assistance.
You are recommended to use a VPC. In the VPC, you can freely define IP range segmentation, IP addresses, and routing policies. Compared with the basic network, VPC is more suitable for scenarios where custom network configurations are required. For the comparison of VPC and basic network, please see Managing Network.