运行如下语句可以查看集群 SQL 请求流量是否均衡:

    1. obclient>SELECT/*+ PARALLEL(15)*/t2.zone, t1.svr_ip, COUNT(*) AS QPS,
    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 = 0
    5. AND request_time > (time_to_usec(now()) - 1000000)
    6. AND request_time < time_to_usec(now())
    7. GROUP BY t1.svr_ip ORDER BY t2.zone;
    8. +--------+----------------+------+----------------------+--------------------+
    9. | zone | svr_ip | QPS | avg(t1.elapsed_time) | avg(t1.queue_time) |
    10. +--------+----------------+------+----------------------+--------------------+
    11. | ET2_1 | 10.103.224.119 | 379 | 5067.3034 | 33.7071 |
    12. | ET2_1 | 10.103.226.124 | 507 | 5784.1538 | 12.5878 |
    13. | ET2_1 | 10.103.228.177 | 370 | 5958.2162 | 10.9811 |
    14. | ET2_1 | 10.103.229.107 | 356 | 5730.9972 | 39.4185 |
    15. | ET2_1 | 10.103.229.94 | 369 | 5851.7886 | 64.9621 |
    16. | EU13_2 | 10.183.78.113 | 354 | 6182.6384 | 11.3107 |
    17. | EU13_2 | 10.183.78.86 | 349 | 5881.3209 | 10.7393 |
    18. | EU13_2 | 10.183.79.56 | 347 | 5936.0144 | 11.9049 |
    19. | EU13_2 | 10.183.85.152 | 390 | 5988.4846 | 12.0487 |
    20. | EU13_3 | 10.183.76.140 | 284 | 5657.2218 | 11.7993 |
    21. | EU13_3 | 10.183.78.165 | 372 | 5360.6989 | 11.6290 |
    22. | EU13_3 | 10.183.79.198 | 416 | 4154.2861 | 12.2524 |
    23. | EU13_3 | 10.183.86.65 | 446 | 6487.6009 | 24.5112 |
    24. | EU13_3 | 11.180.113.7 | 364 | 5444.4203 | 12.3462 |
    25. +--------+----------------+------+----------------------+--------------------+