This topic describes the performance test on an ApsaraDB RDS instance that runs MySQL 5.6 and uses a general-purpose instance type and local disks.
To better simulate the production environment, the QPS metric within 20 minutes is used for the stress testing.
The performance test results are for reference only. For more information about how to use an ApsaraDB RDS instance that runs MySQL 5.6, see Troubleshoot slow SQL statements on an ApsaraDB RDS for MySQL instance.
Test environment
In the stress testing, sysbench is used to test the performance of five RDS instances that use local disks. The RDS instances use different instance types.
Instance types: rds.mysql.s1.small, rds.mysql.s2.large, rds.mysql.m1.medium, rds.mysql.c1.xlarge, and rds.mysql.c2.xlarge
Instance family: general-purpose instance family
RDS edition: RDS High-availability Edition
Storage type: local disk
Configurations
The performance is significantly affected by the data volume, stress testing duration, and parameter settings. The following configurations are used for the stress testing:
Data volume: The data volume and the number of tables on each RDS instance that you want to test are different. Therefore, the test results for some of the five RDS instances may be similar.
Stress testing duration: The stress testing duration is 20 minutes for all RDS instances.
Parameter settings:
sync_binlog=1
andinnodb_flush_log_at_trx_commit=1
: ensure that the data submitted each time is completely written to disks.rpl_semi_sync_master_enabled=ON
: enables the semi-synchronous mode for an RDS instance to ensure data consistency between the primary and secondary RDS instances.Performance_schema=OFF
: automatically enables Performance Schema for an RDS instance that uses an instance type with a memory capacity greater than or equal to 64 GB.NoteThese parameter settings are contained in the standard parameter template for ApsaraDB RDS for MySQL. If the standard parameter template is applied to all the RDS instances, data consistency is maximized, and the test environment is more similar to the production environment.
Test results
Two types of queries are used to perform stress testing. You can determine the type of stress testing based on your data volume.
Stress testing for cache-based queries: This type of stress testing is suitable for scenarios in which a small amount of data is involved. You can store all data in the InnoDB buffer pool for access. For more information about how to change the size of the InnoDB buffer pool, see Change the size of the InnoDB buffer pool for an ApsaraDB RDS for MySQL instance.
Stress testing for disk I/O-based queries: This type of stress testing is suitable for scenarios in which a large amount of data is involved. You can store only the most frequently used data in the InnoDB buffer pool for access. During the stress testing, data is read from or written to disks, and the InnoDB buffer pool is updated.
Type 1: Stress testing for cache-based queries
Instance type | Data volume in a single table | Number of tables | Maximum number of connections | IOPS | Number of sysbench threads | QPS | TPS |
1 core, 2 GB (rds.mysql.s1.small) | 3,000,000 | 1 | 600 | 1,000 | 16 | 12,761 | 638 |
2 cores, 4 GB (rds.mysql.s2.large) | 3,000,000 | 2 | 1200 | 2,000 | 16 | 27,521 | 1,306 |
4 cores, 16 GB (rds.mysql.m1.medium) | 6,000,000 | 4 | 4,000 | 7,000 | 32 | 59,185 | 2,959 |
8 cores, 32 GB (rds.mysql.c1.xlarge) | 6,000,000 | 8 | 8,000 | 12,000 | 32 | 91,941 | 4,597 |
16 cores, 64 GB (rds.mysql.c2.xlarge) | 6,000,000 | 16 | 16,000 | 14,000 | 64 | 129,953 | 6,498 |
Type 2: Stress testing for disk I/O-based queries
Instance type | Data volume in a single table | Number of tables | Maximum number of connections | IOPS | Number of sysbench threads | QPS | TPS |
1 core, 2 GB (rds.mysql.s1.small) | 16,000,000 | 1 | 600 | 1,000 | 16 | 1,087 | 54 |
2 cores, 4 GB (rds.mysql.s2.large) | 16,000,000 | 2 | 1,200 | 2,000 | 16 | 2,382 | 119 |
4 cores, 16 GB (rds.mysql.m1.medium) | 32,000,000 | 4 | 4,000 | 7,000 | 32 | 8,814 | 441 |
8 cores, 32 GB (rds.mysql.c1.xlarge) | 32,000,000 | 8 | 8,000 | 12,000 | 32 | 15,195 | 760 |
16 cores, 64 GB (rds.mysql.c2.xlarge) | 32,000,000 | 16 | 16,000 | 14,000 | 32 | 17,764 | 888 |