To verify the load ratio of each read weight, you can run the select @@server_id; command for 10,000 times using persistent connections and collect the number of each server_id in the output.

Alternatively, you can verify whether the load ratio of read weight is consistent with the distributed ratio using the following methods:

Verify the load ratio based on monitoring data on the console

  1. Log on to the RDS console.
  2. Select the region where the target instance is located.
  3. Click the target instance ID to enter the Basic Information page.
  4. Click Monitoring and Alarms in the left-side navigation pane to enter the Monitoring and Alarms page.
  5. Select the monitoring type Engine Monitoring on the Monitoring tab page.
  6. Query the number of read and write operations on each database (master database and read-only databases involving read/write splitting) based on Transaction Per Second (TPS) and Query Per Second (QPS).
    Note
    Refreshing TPS/QPS performance data takes about five minutes.
  7. Compare the QPS/TPS of each database to verify whether the load ratio is correct.

Verify the SQL load by directly connecting to each database

You can view the number of SQL statements executed by each instance by connecting to the master database and read-only databases involving read/write splitting.

Note
To verify this, the connection addresses of the master database and read-only databases instead of the read/write splitting address are needed.

Run either of the following commands to verify the SQL load:

select * from information_schema.global_status where VARIABLE_NAME = 'COM_SELECT';
select * from information_schema.global_status where VARIABLE_NAME = 'COM_INSERT;