Due to limited resources, TencentDB for MySQL imposes restrictions on data volume of all types of MySQL instances to isolate users from getting affected by others. The following discusses the technical impacts caused by large data volume when using single instance or single table in TencentDB for MySQL.
Instance with large data volume: the default storage engine for TencentDB for MySQL is InnoDB. When the cache/buffer of InnoDB is able to cache all the data and index pages in the MySQL instance, the instance supports a large number of concurrent access requests. If the instance contains too much data, the cache/buffer will swap data in/out frequently. In this case, the bottleneck of MySQL shifts to IO soon, leading to the decline of access throughput. For example, for a TencentDB instance supporting 8,000 access requests per second, when data volume is twice larger than the cache/buffer, the instance can only process 700 access requests per second.
Table with large data volume: when a table contains too much data, the cost for MySQL to manage the table resources (data, indexes, etc.) will change, which will affect the efficiency when handling the table. For example, when a transaction table (InnoDB) contains more than 5 GB data, the delay for update operations will increase significantly, affecting the response time for transactions. In this case, users have to solve this problem by migrating data to partitioned tables.
If the number of tables in a single instance exceeds one million, backup and upgrade may fail and database monitoring may be affected. Please make sure the number of tables in a single instance is no more than one million.
The maximum number of connections to a TencentDB for MySQL instance is specified with the MySQL system variable
max_connections. When the number of connections to a MySQL instance reaches
max_connections, no more connection can be established.
The default number of connections to a TencentDB for MySQL instance can be viewed on the parameter settings page in the MySQL 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, see MySQL's official documentation.
We recommend using the MySQL client and library supplied with the CVM instance to connect to TencentDB for MySQL instances.
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 or equal to 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.
The default character set of TencentDB for MySQL is UTF8.
Although TencentDB supports changing the default character set, we recommend that you explicitly specify the table encoding when creating a table and specify the connection encoding when establishing a connection for more portable application experience.
For more information on MySQL character set, please see MySQL's official documentation.
You can change the character set in the MySQL Console or by following the steps below:
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 synchronized to local file for persistence in about 10 minutes (the other 3 variables will not). The configured values remain unchanged upon migration or restart.
SET @@session.character_set_client = utf8; SET @@session.character_set_results = utf8; SET @@session.character_set_connection = utf8;
SET names utf8;
bool mysqli::set_charset(string charset);
bool mysqli_set_charset(mysqli link, string charset);
Please note that Chinese table names are not supported when creating tables. A Chinese table name may result in a failure of rollback, upgrade, etc.
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 .
We recommend using a VPC. In the VPC, you can define IP range segmentation, IP addresses, and routing policies as needed. Compared with the classic network, VPC is more suitable for scenarios where custom network configurations are required. For the comparison of VPC and classic network, please see Managing Classic Networks.