Monitoring and managing sessions and queries in the Command Center
Greenplum® Command Center provides the following functionality:
- Viewing information about sessions and queries
- Viewing the resource consumption history for completed queries
- Aborting the current session
- Terminating the current query
Check how you can utilize the Command Center in these use cases.
For more information about the statistics available to you from the Command Center, see Greenplum® Command Center.
Note
The Command Center is available in clusters with Greenplum® version 6.25 or higher.
Viewing information about sessions and queries
You can view a list of sessions and queries with details on them. For each session, you can analyze its history and queries made within it. For each query, you can analyze its execution plan and a JSON file with details.
To view information about sessions and queries:
-
Go to the folder page
and select Managed Service for Greenplum. -
Click the cluster name and go to the
Command center tab. -
Select what you want to view and go to relevant tab:
- Current state for the current sessions and queries.
- State history for sessions or queries at a given point in the past.
-
Go to the Sessions or Queries section. In the State history tab, these are placed under the chart.
-
To filter the session or query list, click
Filters and select relevant parameters. -
To view the details of:
- Sessions: Click the session name.
- Queries: Click the key of the query you are running.
Viewing the resource consumption history for completed queries
The resource consumption history offers a number of system metrics. These show how a Managed Service for Greenplum® cluster was consuming resources to process queries at different points of time. You can also view a list of completed queries. Using this information, you can determine how to manage your cluster hosts' CPU and memory to process queries more effectively.
To view the resource consumption history for completed queries:
-
Go to the folder page
and select Managed Service for Greenplum. -
Click the cluster name and go to the
Command center → Usage history tab. -
Select the appropriate consumption metric:
- CPU Time: Time it took the CPU resources to process the queries, seconds.
- Peak memory: Maximum memory the cluster used to process a query during its lifetime.
- Disk R: Memory used for data reads, bytes.
- Disk W: Memory used for data writes to the DB, bytes.
- Spill: Additional memory used for query execution.
- Total time: Total memory used for query processing, bytes.
Once you select the consumption metric, you will see a chart with detailed information and the list of queries. The chart will show the metric value, the name of the user who ran the query, and query execution time.
-
To filter the results, click
Filters and select relevant parameters.
Aborting the current session
To free up resources for sessions, you can abort a session, for example, an Idle
one. To do this:
-
Go to the folder page
and select Managed Service for Greenplum. -
Click the cluster name and go to the
Command center tab. -
In Current state → Sessions, click
in the appropriate line and select Terminate session.If you see Terminate query, select it and stop the query.
-
Confirm stopping the session.
Terminating the current query
To free up resources for queries, you can terminate a query, for example, an Idle
query within an idle session. To do this:
- Go to the folder page
and select Managed Service for Greenplum. - Click the cluster name and go to the
Command center tab. - In Current state → Queries, click
in the appropriate line and select Terminate query. - Confirm terminating the query.
Examples
Identifying a current session that is consuming excessive resources
There might be cases when a user is no longer working with the database, but failed to terminate their session. In such cases, a session remains idle tying up cluster resources and degrading its performance. To identify and terminate such a session, do the following:
- Go to the folder page
and select Managed Service for Greenplum. - Click the cluster name and go to the
Command center → Current state tab. - Filter the sessions by their Start time.
- Find the session in the
Idle
status with the earliest start time. - Click the session number. You will see a page with the detailed information about this session.
- In the Query start time field of Session info, check the time of the latest query. If you see that no queries were run for a long time, this probably means the user is no longer working with the database, but did not close their session. You can terminate the session.
- In the top-right corner, click Terminate session.
- Confirm stopping the session.
Identifying CPU-intensive queries
At times you might observe unusual spikes in the CPU consumption. To determine which queries caused the spikes, do the following:
-
Find out when the spike occurred:
-
Go to the folder page
and select Managed Service for Greenplum. -
Click the cluster name and go to
Command center → State history. -
Set the CPU usage filter.
-
Use the graph to find out the peak CPU consumption time.
Hover over the highest point on the graph curve. You will see a pop-up displaying the cluster state information for the selected time. The time of the spike is indicated in that window.
-
-
Identify the CPU-intensive queries:
- Go to the Usage history tab.
- Set the time range based on the state history data.
- Group the queries by user, database, and query ID. This will group similar queries together.
- Filter the groups of queries by CPU time.
- Open the group with the highest CPU time value.
- Check the details of each query and adjust them if needed. You can also terminate a query that is still running.
Greenplum® and Greenplum Database® are registered trademarks or trademarks of VMware, Inc. in the United States and/or other countries.