This topic describes the performance changes of your database instances in scenarios with different parameter settings of the Performance Schema feature.

Testing scenario

  • In this example, an ApsaraDB RDS for MySQL instance and a PolarDB for MySQL cluster are used for testing. The following table describes the specifications of the instance and cluster.
    Database typeEditionInstance familyInstance typeNumber of CPU cores and memory capacityMaximum number of concurrent connectionsMaximum IOPS
    ApsaraDB RDS for MySQLHigh-availability EditionGeneral-purposemysql.n4.large.2c4 cores, 16 GB memory8,0002,800
    PolarDB for MySQLCluster EditionDedicatedpolar.mysql.x4.large4 cores, 16 GB memory8,00048,000
  • Number of test tables: 10.
  • Number of concurrent stress testing tasks that can be performed (concurrency level): 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, or 1,024.
  • Test tool: SysBench.
    Note SysBench is a modular, open source, cross-platform, and multi-threaded benchmark tool that can be used to evaluate the performance of a heavily loaded database system based on core metrics. For more information about SysBench, see SysBench documentation.

Test results

Various scenarios are created for testing based on the settings of the performance_schema parameter and the consumers and instrumentation configuration items of the performance_schema parameter. For more information, see the Scenarios with different parameter settings section of this topic.

The following tables list the average queries per second (QPS) of your instance or cluster at a concurrency level of 32 after the CPU utilization of your instance or cluster reaches 100% in various scenarios. The system delivers the optimal performance in the pfsoff scenario. For more information about the test data at different concurrency levels, see the Test data section of this topic.

Note In the pfson_conon_ins_sqlon scenario, the new version of the performance insight feature provided by Database Autonomy Service (DAS) is enabled.

ApsaraDB RDS for MySQL

ScenarioRead-onlyRead/writeWrite-only
pfsoff47,176Baseline value37,999Baseline value39,940Baseline value
pfson_conoff_insoff41,111Reduced by 12.86%33,170Reduced by 12.71%32,327Reduced by 19.06%
pfson_conon_insoff41,773Reduced by 11.45%33,568Reduced by 11.66%31,434Reduced by 21.30%
pfson_conon_ins_sqlon39,889Reduced by 15.44%33,056Reduced by 13.01%31,865Reduced by 20.22%
pfson_conoff_inson39,344Reduced by 16.61%32,698Reduced by 13.95%31,698Reduced by 20.64%
pfson_conon_inson39,168Reduced by 16.97%32,280Reduced by 15.05%30,834Reduced by 22.81%

PolarDB for MySQL

ScenarioRead-onlyRead/writeWrite-only
pfsoff36,768Baseline value38,876Baseline value39,550Baseline value
pfson_conoff_insoff31,981Reduced by 13.02%33,342Reduced by 14.24%34,182Reduced by 13.57%
pfson_conon_insoff31,187Reduced by 15.18%32,980Reduced by 15.17%31,768Reduced by 19.68%
pfson_conon_ins_sqlon30,976Reduced by 15.75%31,980Reduced by 17.77%31,101Reduced by 21.36%
pfson_conoff_inson31,025Reduced by 15.62%32,855Reduced by 15.49%31,750Reduced by 19.72%
pfson_conon_inson29,652Reduced by 19.35%30,656Reduced by 21.14%30,014Reduced by 24.11%

Scenarios with different parameter settings

Various scenarios are created based on the settings of the performance_schema parameter and the consumers and instrumentation configuration items of the performance_schema parameter. The following table describes the parameter settings in various scenarios.
Note For information about how to modify the performance_schema parameter, see Modify the parameters of an ApsaraDB RDS for MySQL instance.
ScenarioParameter settings
pfsoffThe Performance Schema feature is disabled.
pfson_conoff_insoff
  • The Performance Schema feature is enabled.
  • All options of the consumers configuration item are disabled.
    -- All options of the consumers configuration item are disabled.
    update performance_schema.setup_consumers set Enabled = 'NO' ;
  • All options of the instrumentation configuration item are disabled.
    -- All options of the instrumentation configuration item are disabled.
    update performance_schema.setup_instruments set Enabled = 'NO' ,timed = 'NO';
pfson_conon_insoff
  • The Performance Schema feature is enabled.
  • All options of the consumers configuration item are enabled.
    -- All options of the consumers configuration item are enabled.
    update performance_schema.setup_consumers set Enabled = 'YES' ;
  • All options of the instrumentation configuration item are disabled.
    -- All options of the instrumentation configuration item are disabled.
    update performance_schema.setup_instruments set Enabled = 'NO' ,timed = 'NO';
pfson_conon_ins_sqlon
  • The Performance Schema feature is enabled.
  • The global_instrumentation, thread_instrumentation, events_statements_current, events_statements_history, and statements_digest options of the consumers configuration item are enabled.
    -- The global_instrumentation, thread_instrumentation, events_statements_current, events_statements_history, and statements_digest options of the consumers configuration item are enabled.
    update performance_schema.setup_consumers set enabled = if(name in ('global_instrumentation','thread_instrumentation','events_statements_current','events_statements_history','statements_digest'),'YES', 'NO');
  • All options prefixed with statement of the instrumentation configuration item are enabled.
    -- All options prefixed with statement of the instrumentation configuration item are enabled.
    update performance_schema.setup_instruments set enabled = if(name like 'statement/%', 'YES', 'NO'), timed = enabled;
Note In the pfson_conon_ins_sqlon scenario, the performance insight feature is enabled.
pfson_conoff_inson
  • The Performance Schema feature is enabled.
  • All options of the consumers configuration item are disabled.
    -- All options of the consumers configuration item are disabled.
    update performance_schema.setup_consumers set Enabled = 'NO' ;
  • All options of the instrumentation configuration item are enabled.
    -- All options of the instrumentation configuration item are enabled.
    update performance_schema.setup_instruments set Enabled = 'YES' ,timed = 'YES';
pfson_conon_inson
  • The Performance Schema feature is enabled.
  • All options of the consumers configuration item are enabled.
    -- All options of the consumers configuration item are enabled.
    update performance_schema.setup_consumers set Enabled = 'YES' ;
  • All options of the instrumentation configuration item are enabled.
    -- All options of the instrumentation configuration item are enabled.
    update performance_schema.setup_instruments set Enabled = 'YES' ,timed = 'YES';

Test data

The following tables list the average QPS of your instance or cluster in read-only, write-only, and read/write scenarios after the CPU utilization of your instance or cluster reaches 100%.

ApsaraDB RDS for MySQL

Read-only scenario

Read-only scenario
Table 1. Test data in the read-only scenario
Concurrency levelpfsoffpfson_conoff_insoffpfson_conon_insoffpfson_conon_ins_sqlonpfson_conoff_insonpfson_conon_inson
13,4563,2093,2333,1793,2493,116
Baseline valueReduced by 7.16%Reduced by 6.45%Reduced by 8.02%Reduced by 5.98%Reduced by 9.84%
29,4328,6688,7018,5888,8548,313
Baseline valueReduced by 8.10%Reduced by 7.75%Reduced by 8.95%Reduced by 6.13%Reduced by 11.86%
416,48514,96515,12314,92614,94214,053
Baseline valueReduced by 9.22%Reduced by 8.26%Reduced by 9.46%Reduced by 9.36%Reduced by 14.75%
825,61423,02423,28622,78123,01721,659
Baseline valueReduced by 10.11%Reduced by 9.09%Reduced by 11.06%Reduced by 10.14%Reduced by 15.44%
1639,84635,86935,48334,16234,28833,387
Baseline valueReduced by 9.98%Reduced by 10.95%Reduced by 13.14%Reduced by 13.95%Reduced by 16.21%
3247,17641,11141,77339,88939,34439,168
Baseline valueReduced by 12.86%Reduced by 11.45%Reduced by 15.44%Reduced by 16.61%Reduced by 16.97%
6449,23042,18642,77641,79141,74738,877
Baseline valueReduced by 14.31%Reduced by 13.11%Reduced by 15.11%Reduced by 15.20%Reduced by 21.03%
12848,20141,45841,28040,79740,99036,532
Baseline valueReduced by 13.99%Reduced by 14.36%Reduced by 15.36%Reduced by 14.96%Reduced by 24.21%
25646,98240,09039,86939,55640,41434,602
Baseline valueReduced by 14.67%Reduced by 15.14%Reduced by 15.81%Reduced by 13.98%Reduced by 26.35%
51247,02641,27940,35339,48839,33734,023
Baseline valueReduced by 15.22%Reduced by 14.19%Reduced by 16.03%Reduced by 16.35%Reduced by 27.65%
1,02447,53340,10440,03239,50939,46233,696
Baseline valueReduced by 15.63%Reduced by 15.78%Reduced by 16.88%Reduced by 16.98%Reduced by 29.11%

Write-only scenario

Write-only scenario
Table 2. Test data in the write-only scenario
Concurrency levelpfsoffpfson_conoff_insoffpfson_conon_insoffpfson_conon_ins_sqlonpfson_conoff_insonpfson_conon_inson
13,6143,3053,2933,2693,3543,222
Baseline valueReduced by 8.56%Reduced by 8.88%Reduced by 9.56%Reduced by 7.19%Reduced by 10.86%
28,4527,6447,5477,6067,603 7,281
Baseline valueReduced by 9.56%Reduced by 10.71%Reduced by 10.01%Reduced by 10.04%Reduced by 13.86%
413,64812,23112,19312,10612,05711,676
Baseline valueReduced by 10.38%Reduced by 10.66%Reduced by 11.30%Reduced by 11.66%Reduced by 14.45%
825,64822,22722,82422,36022,53421,431
Baseline valueReduced by 13.34%Reduced by 11.01%Reduced by 12.82%Reduced by 12.14%Reduced by 16.44%
1632,15427,11927,66927,09327,34726,170
Baseline valueReduced by 15.66%Reduced by 13.95%Reduced by 15.74%Reduced by 14.95%Reduced by 18.61%
3239,94031,43431,43431,86531,69830,834
Baseline valueReduced by 21.30%Reduced by 19.06%Reduced by 20.22%Reduced by 20.64%Reduced by 22.81%
6439,12330,91531,22030,66130,67229,514
Baseline valueReduced by 20.98%Reduced by 20.20%Reduced by 21.63%Reduced by 21.06%Reduced by 24.56%
12841,32032,69232,61032,13532,18429,423
Baseline valueReduced by 20.88%Reduced by 21.08%Reduced by 22.23%Reduced by 22.11%Reduced by 28.79%
25642,00433,32233,12432,83832,81430,348
Baseline valueReduced by 20.67%Reduced by 21.14%Reduced by 21.82%Reduced by 21.88%Reduced by 27.75%
51243,15634,03333,59733,78333,19630,157
Baseline valueReduced by 21.14%Reduced by 22.15%Reduced by 21.72%Reduced by 23.08%Reduced by 30.12%
1,02447,56237,05636,23237,11336,72332,256
Baseline valueReduced by 22.09%Reduced by 23.82%Reduced by 21.97%Reduced by 22.79%Reduced by 32.18%

Read/write scenario

Read/write scenario
Table 3. Test data in the read/write scenario
Concurrency levelpfsoffpfson_conoff_insoffpfson_conon_insoffpfson_conon_ins_sqlonpfson_conoff_insonpfson_conon_inson
12,9972,7542,8442,7582,7412,672
Baseline valueReduced by 8.1%Reduced by 5.12%Reduced by 7.98%Reduced by 8.55%Reduced by 10.86%
28,1357,3047,6107,4207,4987,226
Baseline valueReduced by 10.22%Reduced by 6.45%Reduced by 8.79%Reduced by 7.83%Reduced by 11.17%
414,56813,03113,42713,17813,16412,754
Baseline valueReduced by 10.55%Reduced by 7.83%Reduced by 9.54%Reduced by 9.64%Reduced by 12.45%
824,65821,93322,66321,85422,13021,250
Baseline valueReduced by 11.05%Reduced by 8.09%Reduced by 11.37%Reduced by 10.25%Reduced by 13.82%
1631,56228,11928,44327,62927,93626,957
Baseline valueReduced by 10.91%Reduced by 9.88%Reduced by 12.46%Reduced by 11.49%Reduced by 14.61%
3237,99933,17033,56833,05632,69832,280
Baseline valueReduced by 12.71%Reduced by 11.66%Reduced by 13.01%Reduced by 13.95%Reduced by 15.05%
6439,12033,31133,94833,06833,65931,605
Baseline valueReduced by 14.85%Reduced by 13.22%Reduced by 15.47%Reduced by 13.96%Reduced by 19.21%
12841,68735,74235,33435,45135,48832,899
Baseline valueReduced by 14.26%Reduced by 15.24%Reduced by 14.96%Reduced by 14.87%Reduced by 21.08%
25642,65436,24333,57036,11535,94933,133
Baseline valueReduced by 15.03%Reduced by 16.14%Reduced by 15.33%Reduced by 15.72%Reduced by 22.32%
51243,15636,62636,08736,30236,28632,518
Baseline valueReduced by 15.13%Reduced by 16.38%Reduced by 15.88%Reduced by 15.92%Reduced by 24.65%
1,02443,65836,69936,62536,58536,75632,359
Baseline valueReduced by 15.94%Reduced by 16.11%Reduced by 16.20%Reduced by 15.81%Reduced by 25.88%

PolarDB for MySQL

Read-only scenario

Read-only scenario
Table 4. Test data in the read-only scenario
Concurrency levelpfsoffpfson_conoff_insoffpfson_conon_insoffpfson_conon_ins_sqlonpfson_conoff_insonpfson_conon_inson
13,3893,2963,2333,1793,2493,016
Baseline valueReduced by 2.74%Reduced by 4.62%Reduced by 2.56%Reduced by 4.13%Reduced by 11.04%
28,8688,6328,6018,5888,6548,213
Baseline valueReduced by 3.08%Reduced by 3.78%Reduced by 3.16%Reduced by 2.84%Reduced by 7.39%
416,96514,48515,12314,92614,94213,053
Baseline valueReduced by 14.62%Reduced by 10.86%Reduced by 12.02%Reduced by 11.92%Reduced by 23.06%
825,02422,61423,28622,78123,01721,659
Baseline valueReduced by 9.63%Reduced by 9.01%Reduced by 8.96%Reduced by 8.14%Reduced by 14.45%
1638,86935,84635,48334,16234,28832,387
Baseline valueReduced by 9.88%Reduced by 8.95%Reduced by 12.11%Reduced by 11.79%Reduced by 16.68%
3236,76831,98131,18730,97631,02529,652
Baseline valueReduced by 13.02%Reduced by 15.18%Reduced by 15.75%Reduced by 15.62%Reduced by 19.35%
6449,18642,23042,77641,79141,74739,877
Baseline valueReduced by 14.14%Reduced by 13.07%Reduced by 15.03%Reduced by 15.12%Reduced by 18.93%
12842,95839,20140,28039,79739,99037,532
Baseline valueReduced by 11.88%Reduced by 9.08%Reduced by 10.43%Reduced by 10.11%Reduced by 12.63%
25645,09041,02639,86939,55640,41435,602
Baseline valueReduced by 9.01%Reduced by 11.58%Reduced by 12.27%Reduced by 10.37%Reduced by 21.04%
51246,27941,00440,35339,48839,33734,023
Baseline valueReduced by 11.14%Reduced by 12.81%Reduced by 14.67%Reduced by 15.02%Reduced by 26.48%
1,02447,23141,53340,03239,50939,46233,696
Baseline valueReduced by 12.06%Reduced by 15.24%Reduced by 16.35%Reduced by 16.45%Reduced by 28.66%

Write-only scenario

Write-only scenario
Table 5. Test data in the write-only scenario
Concurrency levelpfsoffpfson_conoff_insoffpfson_conon_insoffpfson_conon_ins_sqlonpfson_conoff_insonpfson_conon_inson
13,5053,3643,3543,2693,2933,122
Baseline valueReduced by 4.07%Reduced by 5.41%Reduced by 6.73%Reduced by 6.05%Reduced by 10.93%
27,8447,4527,6037,6067,5477,281
Baseline valueReduced by 4.56%Reduced by 4.22%Reduced by 5.09%Reduced by 3.44%Reduced by 7.18%
413,23112,64812,05712,10612,19310,676
Baseline valueReduced by 4.38%Reduced by 8.87%Reduced by 8.30%Reduced by 7.85%Reduced by 19.31%
825,22722,64822,53422,36022,82420,431
Baseline valueReduced by 10.22%Reduced by 10.68%Reduced by 11.36%Reduced by 9.53%Reduced by 19.01%
1627,11926,15426,34725,09326,66922,170
Baseline valueReduced by 13.66%Reduced by 11.95%Reduced by 14.74%Reduced by 12.95%Reduced by 18.25%
3239,55034,18231,76831,10131,75030,014
Baseline valueReduced by 13.57%Reduced by 19.68%Reduced by 21.36%Reduced by 19.72%Reduced by 24.11%
6437,91531,22330,67230,66131,22029,514
Baseline valueReduced by 17.65%Reduced by 19.13%Reduced by 19.12%Reduced by 17.66%Reduced by 22.16%
12834,69231,32031,88432,13531,91029,423
Baseline valueReduced by 16.88%Reduced by 12.08%Reduced by 10.76%Reduced by 14.11%Reduced by 15.22%
25633,39031,70431,81432,01831,12429,348
Baseline valueReduced by 7.67%Reduced by 7.14%Reduced by 5.41%Reduced by 9.88%Reduced by 12.11%
51234,03331,15631,19631,78331,59730,157
Baseline valueReduced by 8.45%Reduced by 8.34%Reduced by 6.61%Reduced by 7.16%Reduced by 11.39%
1,02436,85533,86233,72333,61333,23232,956
Baseline valueReduced by 8.12%Reduced by 8.52%Reduced by 8.81%Reduced by 9.83%Reduced by 10.58%

Read/write scenario

Read/write scenario
Table 6. Test data in the read/write scenario
Concurrency levelpfsoffpfson_conoff_insoffpfson_conon_insoffpfson_conon_ins_sqlonpfson_conoff_insonpfson_conon_inson
13,3052,7542,8432,7582,7412,614
Baseline valueReduced by 16.67%Reduced by 13.98%Reduced by 16.55%Reduced by 17.07%Reduced by 20.91%
28,6687,3047,6107,4207,4987,182
Baseline valueReduced by 15.74%Reduced by 12.21%Reduced by 14.42%Reduced by 13.52%Reduced by 17.14%
414,96513,03113,42713,17813,16412,754
Baseline valueReduced by 12.92%Reduced by 10.28%Reduced by 11.94%Reduced by 12.03%Reduced by 14.77%
823,06821,93321,66321,35421,13020,250
Baseline valueReduced by 9.94%Reduced by 6.09%Reduced by 8.68%Reduced by 8.41%Reduced by 12.22%
1635,86928,11928,44328,62927,93626,957
Baseline valueReduced by 14.96%Reduced by 17.71%Reduced by 16.74%Reduced by 16.95%Reduced by 24.85%
3238,87633,34232,98031,98032,85530,656
Baseline valueReduced by 14.24%Reduced by 15.17%Reduced by 17.74%Reduced by 15.49%Reduced by 21.14%
6442,18633,31133,94833,06833,65931,305
Baseline valueReduced by 20.86%Reduced by 19.53%Reduced by 21.61%Reduced by 20.21%Reduced by 25.79%
12840,35935,74235,33435,45135,48832,899
Baseline valueReduced by 11.44%Reduced by 12.45%Reduced by 12.16%Reduced by 12.07%Reduced by 18.48%
25640,09036,24333,57036,11535,94933,125
Baseline valueReduced by 9.67%Reduced by 16.26%Reduced by 9.92%Reduced by 10.33%Reduced by 17.37%
51241,22036,62636,08736,30236,28632,451
Baseline valueReduced by 11.15%Reduced by 12.45%Reduced by 11.93%Reduced by 11.98%Reduced by 20.27%
1,02440,05536,69936,62536,58536,75632,860
Baseline valueReduced by 8.38%Reduced by 8.56%Reduced by 8.66%Reduced by 8.24%Reduced by 17.96%