This topic analyzes how enabling Transparent Data Encryption (TDE) on ApsaraDB RDS for MySQL instances affects performance, including CPU and memory usage. Use this report to evaluate if TDE is suitable for your workload.
Summary of results
Enabling TDE introduces measurable performance overhead and increases CPU utilization on ApsaraDB RDS for MySQL instances.
At low concurrency, the performance overhead is greater, reaching up to 20%. At high concurrency, the overhead decreases to less than 5% due to factors such as I/O consolidation.
On a 4-core, 16 GB instance, enabling TDE increases CPU utilization by 0.06% to 4.22% when accessing encrypted tables. On an 8-core, 32 GB instance, the increase is 0.12% to 2.86%.
Overall, the performance impact is most noticeable in write-intensive workloads, such as the
oltp_write_onlyandoltp_update_indextest scenarios.
Test environment
Parameter | Test scenario 1 | Test scenario 2 |
Region and zone | China (Hangzhou) | |
Network type | Virtual Private Cloud (VPC) | |
Hardware architecture | x86-64 | |
Storage type | local SSD | |
CPU | 4-core | 8-core |
Memory | 16 GB | 32 GB |
buffer pool size | 12 GB | 24 GB |
Maximum IOPS | 7000 | 12000 |
Database engine version | mysql80_8.0.28_20230610 | |
Test dataset size | 41 GB | |
Benchmark tool
sysbench is an open-source, modular, cross-platform, and multi-threaded benchmark tool for evaluating system performance under high database loads. For more information, see the sysbench documentation.
Key metrics
transactions per second (TPS): The number of transactions a database commits per second.
average latency: The average time to execute a single transaction, measured in milliseconds (ms).
Test table schema
The default table schema used by sysbench is as follows:
CREATE TABLE `sbtest8` (
`id` int NOT NULL AUTO_INCREMENT,
`k` int NOT NULL DEFAULT '0',
`c` char(120) NOT NULL DEFAULT '',
`pad` char(60) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `k_8` (`k`)
) ENGINE=InnoDB AUTO_INCREMENT=100001 DEFAULT CHARSET=utf8mb3Procedure
Create an ApsaraDB RDS for MySQL instance. For more information, see Create an ApsaraDB RDS for MySQL instance.
Create a database and an account. For more information, see Create a database and an account.
Install a MySQL client on your Linux-based ECS instance.
For CentOS, run
sudo yum install mysql.For Ubuntu, run
sudo apt-get updateand thensudo apt install mysql-server.
Connect to your ApsaraDB RDS for MySQL instance from the command line:
mysql -h<endpoint> -u<username> -P<port> -p<password>NoteTo find the endpoint and port for your instance, see View and manage instance endpoints and ports.
Exit the database and use sysbench to prepare and load the test data.
NoteIn this test, sysbench loads 128 tables, each with 100,000 rows. The following script uses the
oltp_read_writetest model.The sample code sets the thread count to 16. Adjust the --threads parameter to your desired value, such as 1, 8, 16, 32, 64, 128, or 256.
sysbench --db-driver=mysql --mysql-host=[database server host] --mysql-port=[database server port] --mysql-user=[database user name] --mysql-password=[database user password] --mysql-db=testdb --table_size=1000000 --tables=128 --threads=16 --time=60 oltp_read_write prepareRun the benchmark test.
sysbench --db-driver=mysql --mysql-host=[database server host] --mysql-port=[database server port] --mysql-user=[database user name] --mysql-password=[database user password] --mysql-db=testdb --table_size=1000000 --tables=128 --threads=16 --time=60 oltp_read_write runClean up the test data.
sysbench --db-driver=mysql --mysql-host=[database server host] --mysql-port=[database server port] --mysql-user=[database user name] --mysql-password=[database user password] --mysql-db=testdb --table_size=1000000 --tables=128 --threads=16 --time=60 oltp_read_write cleanup
Test scenario 1: 4-core, 16 GB instance
Test data
Performance by workload model


CPU utilization

Performance data summary



rds_ssd_4c16g_tde_off[3]: A 4-core, 16 GB ApsaraDB RDS for MySQL instance with TDE disabled.
rds_ssd_4c16g_tde_on[2]: A 4-core, 16 GB ApsaraDB RDS for MySQL instance with TDE enabled.
Test scenario 2: 8-core, 32 GB instance
Test data
Performance by workload model



Performance data summary



rds_ssd_8c32g_tde_off[11]: An 8-core, 32 GB ApsaraDB RDS for MySQL instance with TDE disabled.
rds_ssd_8c32g_tde_on[12]: An 8-core, 32 GB ApsaraDB RDS for MySQL instance with TDE enabled.