运行如下语句可以查看分布式计划 RPC 执行数是否均衡:

    1. obclient>SELECT/*+ PARALLEL(15)*/t2.zone, t1.svr_ip, COUNT(*) AS RPC_COUNT,
    2. AVG(t1.elapsed_time),AVG(t1.queue_time)
    3. FROM oceanbase.gv$sql_audit t1, __all_server t2
    4. WHERE t1.svr_ip = t2.svr_ip AND IS_EXECUTOR_RPC = 1
    5. AND tenant_id = 1001
    6. AND request_time > (time_to_usec(now()) - 1000000)
    7. AND request_time < time_to_usec(now())
    8. GROUP BY t1.svr_ip ORDER BY t2.zone;
    9. +--------+----------------+-----------+----------------------+--------------------+
    10. | zone | svr_ip | RPC_COUNT | avg(t1.elapsed_time) | avg(t1.queue_time) |
    11. +--------+----------------+-----------+----------------------+--------------------+
    12. | ET2_1 | 10.103.224.119 | 2517 | 514.2241 | 13.5515 |
    13. | ET2_1 | 10.103.226.124 | 2786 | 1628.0948 | 13.2915 |
    14. | ET2_1 | 10.103.228.177 | 3068 | 1984.0238 | 12.9029 |
    15. | ET2_1 | 10.103.229.107 | 3216 | 538.7646 | 12.8629 |
    16. | ET2_1 | 10.103.229.94 | 2228 | 802.8577 | 13.4138 |
    17. | EU13_2 | 10.183.78.113 | 2000 | 805.0485 | 13.0610 |
    18. | EU13_2 | 10.183.78.86 | 3296 | 1115.0725 | 13.2700 |
    19. | EU13_2 | 10.183.79.56 | 2460 | 1129.4085 | 14.3293 |
    20. | EU13_2 | 10.183.85.152 | 2533 | 891.0683 | 13.8602 |
    21. | EU13_3 | 10.183.76.140 | 3045 | 677.6591 | 13.7209 |
    22. | EU13_3 | 10.183.78.165 | 2202 | 821.9496 | 12.8247 |
    23. | EU13_3 | 10.183.79.198 | 2825 | 1277.0375 | 13.3345 |
    24. | EU13_3 | 10.183.86.65 | 2142 | 746.0808 | 13.0121 |
    25. | EU13_3 | 11.180.113.7 | 2735 | 765.8731 | 12.4750 |
    26. +--------+----------------+-----------+----------------------+--------------------+