Script to monitor Vertica Database connection load balance

This script will create a report of the connection rate on your Vertica Database Cluster. If you have connection load balance enabled the report should be showing an even distribution of the connections across all nodes in your Cluster.

SELECT
    a.node_name,
    a.requests,
    ROUND((a.requests / b.total_requests) * 100, 2.0) AS percent
FROM
    (
        SELECT
            node_name,
            COUNT(*) AS requests
        FROM
            v_monitor.query_requests
        GROUP BY
            node_name) a
CROSS JOIN
    (
        SELECT
            COUNT(*) AS total_requests
        FROM
            v_monitor.query_requests) b
ORDER BY
    percent DESC;
Here is an example of the generated report:
node_name	requests	percent
v_node0001	68566    	35.84
v_node0002	61615	        32.2
v_node0003	61143    	31.96
  • we can see that we have an even connection rate across all nodes. is good to monitor this and make sure you dont let one node do more work than other.
Use this script with care !!!