TencentDB for MySQL imposes data volume restrictions on all types of MySQL instances to isolate performance issues due to limited resources. This document describes the technical impact of a single instance or table with a large data volume 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, indexes, etc.) will change, which will affect the table processing efficiency. For example, if the size of a transaction table (InnoDB) exceeds 10 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.
Note:If the number of tables in a single instance exceeds one million, backup, monitoring, and upgrade may fail and database monitoring may be affected. Make sure that the number of tables in a single instance is below one million.
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 by clicking the instance ID to enter the Database Management > Parameter Settings page in the TencentDB for 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 allows, the system service quality will be definitely undermined.
For more information on max_connections
, see MySQL's official documentation.
We recommend you to use the MySQL client and library that come with CVM to connect to TencentDB instances.
TencentDB for MySQL binlogs can be retained for 7 (default value) to 1830 days (customizable by clicking the instance ID to enter the Backup and Restoration > Auto-Backup Settings page).
If binlogs are retained for an extended period of time or grow too fast, additional space will be required for backup, and fees will be incurred if the space exceeds the free tier of backup capacity.
TencentDB for MySQL uses the UTF8 character set by default.
Even though TencentDB supports changing the default character set, we recommend you 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, see MySQL's official documentation.
You can modify the character set through SQL or in the TencentDB for MySQL console.
SET @@global.character_set_client = utf8;
SET @@global.character_set_results = utf8;
SET @@global.character_set_connection = utf8;
SET @@global.character_set_server = utf8;
After the statements are executed, @@global.character_set_server
will 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.SET @@session.character_set_client = utf8;
SET @@session.character_set_results = utf8;
SET @@session.character_set_connection = utf8;
OrSET names utf8;
bool mysqli::set_charset(string charset);
Orbool mysqli_set_charset(mysqli link, string charset);
jdbc:mysql://localhost:3306/dbname?useUnicode=true&characterEncoding=UTF-8
Chinese table names are not supported because they may result in failures of processes such as rollback and upgrade.
TencentDB for MySQL no longer provides the super user permission. To modify parameters that require this permission, log in to the TencentDB for MySQL console, click the instance ID to enter the Database Management > Parameter Settings page, and modify them.
We recommend you use a VPC. In the VPC, you can freely define IP range segmentation, IP addresses, and routing policies. 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, see Managing Network.
Was this page helpful?