Performance Diagnostic v9
The Performance Diagnostic dashboard analyzes the database performance for Postgres instances by monitoring the wait events. To display the diagnostic graphs, PEM uses the data collected by the EDB wait states module. For more information on EDB wait states, see EDB wait states.
To analyze the wait states data on multiple levels, narrow down the data you select. The data you select at the higher level of the graph populates the lower level.
Note
The Performance Diagnostic dashboard is available for all the Postgres variants and versions for which the EDB wait states module is available.
Prerequisites
Install the EDB wait states package:
- For PostgreSQL, see EDB repositories.
- For EDB Postgres Advanced Server, see EDB wait states.
After you install the EDB wait states module of EDB Postgres Advanced Server:
Configure the list of libraries in the
postgresql.conf
file:shared_preload_libraries = '$libdir/edb_wait_states'
Restart the database server.
Create the following extension in the maintenance database:
CREATE EXTENSION edb_wait_states;
If you want to access the Performance Diagnostic dashboard as a user without superuser privileges, specific roles must be granted to the user based on the server to which the user is connected or logged into:
Grant
pem_comp_performance_diagnostic
role to the user (test1
in this example), who is logged into the PEM server.GRANT pem_comp_performance_diagnostic TO test1;
Grant
pg_monitor
role andEXECUTE
privilege on all functions ofedb_wait_states
to the database user (test2
in this example). Thetest2
user is connected to the database server with EDB wait states.# Grant `pg_monitor` role GRANT pg_monitor TO test2; # Grant `Execute` privilege on all functions GRANT EXECUTE ON FUNCTION edb_wait_states_sessions TO test2; GRANT EXECUTE ON FUNCTION edb_wait_states_data TO test2; GRANT EXECUTE ON FUNCTION edb_wait_states_queries TO test2; GRANT EXECUTE ON FUNCTION edb_wait_states_samples TO test2; GRANT EXECUTE ON FUNCTION edb_wait_states_purge TO test2;
If the prerequisites aren't met, an error appears when you access the Performance Diagnostic dashboard.
Using the Performance Diagnostic dashboard
To open the Performance Diagnostic dashboard, on the PEM client select Tools > Server > Performance Diagnostic.
By default, the top Performance Diagnostic graph pulls the data of the last hour, starting from the current date and time. This graph shows the time series containing the number of active sessions. Each point of this time series represents the sum of wait events and CPU usage over the previous 15 seconds. These sessions might be waiting for a wait event or using the CPU at a particular point in time. This time series is generated based on the wait event samples collected by the EDB Wait States extension.
To open the Performance Diagnostic dashboard in a new browser tab, select Preferences > Open in New Browser Tab?.
Performance Diagnostic dashboard
The first graph displays the number of active sessions and wait event types for the selected duration. You can change the duration in the first graph to analyze the data for a specific time period.
By default, the duration selection in the first graph is 15 minutes. The duration can be extended up to one hour. To see the duration on a graph, select a duration from the Last list. To display the data for a specified date and time, select a date and time from the Until list.
The next section plots the following graphs based on the selected duration in the first graph:
- Donut graph — Shows total wait event types and CPU usage according to the duration selection in the first graph. This graph can provide a better understanding of how much time those sessions spent waiting for an event.
- Line graph