Problem description

After I execute the select * from performance_schema.threads statement on my RDS instance, an empty result is returned.

Causes

By default, performance_schema is set to OFF for your RDS instance. If the value is set to ON, the performance of your RDS instance is decreased.

Note In ApsaraDB RDS for MySQL, performance_schema is used to collect statistics on performance parameters of your RDS instance. performance_schema can be used to perform the following operations:
  • Provide details about processes that are queuing for resources, including information about locks, mutually exclusive variables, and files.
  • Store aggregated statistics on historical events to provide details for optimizing MySQL server performance.
  • Add or delete monitoring events and change the monitoring cycle of a MySQL server.
Query

Solutions

  • If your RDS instance runs MySQL 5.6 or MySQL 5.7, you can change the value of performance_schema in the ApsaraDB RDS console. For more information, see Modify the parameters of an ApsaraDB RDS for MySQL instance.
    Note After you change the value of performance_schema, you must restart your RDS instance for the change to take effect. Make sure that your workloads are not affected before you restart the RDS instance.
  • If your RDS instance runs MySQL 5.5, you cannot change the value of performance_schema.
  • If your RDS instance runs MySQL 8.0 and the value of performance_schema cannot be changed, check the parameter template that is used in the RDS instance. For more information about how to check the parameter template that is used in your RDS instance, see Use a parameter template to configure the parameters of ApsaraDB RDS for MySQL instances. The MySQL_8.0_High-availability_High-performance Parameter Template does not support the configuration of performance_schema. You can change the parameter template to the default parameter template and then change the value of performance_schema. You can perform the following operations to change the parameter template:
    1. Log on to the ApsaraDB RDS console and go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the instance ID.
    2. In the left-side navigation pane, click Parameters.
    3. On the Editable Parameters tab, click Apply Template.
    4. Select MySQL_8.0_High-availability_Default Parameter Template and click OK.
      Note The change of the parameter template triggers an instance restart.

Applicable scope

ApsaraDB RDS for MySQL