PostgreSQL Root Blockers Test
One common problem encountered with databases is blocking. Suppose that process A is modifying data that process B wants to use. Process B will be blocked until process A has completed what it is doing. This is only one type of blocking situation; others exist and are common. What matters to a database administrator is identifying when blocking is a problem and how to deal with it effectively. When blocking is bad enough, users will notice slowdowns and complain about it. With a large number of users, it is common for tens or hundreds of processes to be blocked when slowdowns are noticed. Killing these processes may or may not solve the problem because 10 processes may be blocked by process B, while process B itself is blocked by process A. Issuing 10 kill statements for the processes blocked by B probably will not help, as new processes will simply become blocked by B. Killing process B may or may not help, because then the next process that was blocked by B, which is given execution time, may get blocked by process A and become the process that is blocking the other 9 remaining processes. When you have lots of blocking that is not resolving in a reasonable amount of time you need to identify the root blocker, or the process at the top of the tree of blocked processes. Imagine again that you have 10 processes blocked by process B, and process B is blocked by process A. If A is not blocked by anything, but is itself responsible for lots of blocking (B and the 10 processes waiting on B), then A would be the root blocker. (Think of it as a traffic jam.Figure 1 will help) Killing A (via kill) is likely to unblock B, and once B completes, the 10 processes waiting on B are also likely to complete successfully.
The PostgreSQL Root Blockers Test reports the number of root blockers in a database. The detailed diagnosis of this test, provides the details of each of these root blockers. The count and details of sessions blocked by these root blockers are also reported. The maximum time for which the sessions were blocked, and the details of the processes that were blocking them are also revealed.
Figure 1 : The traffic jam analogy representing blocking
Target of the test : PostgreSQL server
Agent deploying the test: An internal/remote agent
Outputs of the test :One set of results for the target PostgreSQL server being monitored.
Parameter | Description |
---|---|
Test period |
How often should the test be executed |
Host |
The IP address of the host for which this test is to be configured. |
Port |
The port on which the server is listening. The default port is 5432. |
Password Profile |
This list box appears only if one or more password profiles are created for the target host. Typically, to protect the critical servers/services from malicious attacks by online predators, administrators of secured IT environments frequently change the access credentials for the critical servers and services. Once a password is changed, all tests that take that password as a parameter will stop working, until such time the administrator manually reconfigures each test and changes the password. To avoid such anomalies and save administrators the time and effort involved in manually changing the password of tests, eG Enterprise allows the creation of one/more password profiles. With the password profiles, administrators no longer need to manually configure the credentials; instead, they only need to select the Password Profile that contains the credentials to be passed to the test. This means that if a password changes/expires subsequently, it would suffice to change the corresponding Password Profile alone. All the tests configured with that Password Profile will automatically assume the new password. Once, you select a password profile from the Password Profile list box, the user credentials will be automatically populated in the corresponding text boxes that follow the Password profile list box. If you do not want to use the password profiles, then, you can ignore selecting the password profile from the list box and manually configure the user credentials. |
Username |
In order to monitor a PostgreSQL server, you need to manually create a special database user account in every PostgreSQL database instance that requires monitoring. To know how to create such a user based on where the target PostgreSQL server is installed (whether on-premises or hosted on Cloud), refer to How does eG Enterprise Monitor PostgreSQL Server?. |
Password |
The password associated with the above Username (can be ‘NULL’). Here, ‘NULL’ means that the user does not have any password. |
Confirm Password |
Confirm the Password (if any) by retyping it here. |
DB Name |
The name of the database to connect to. The default is “postgres”. |
SSL |
If the PostgreSQL server being monitored is an SSL-enabled server, then set the SSL flag to Yes. If not, then set the SSL flag to No. |
Verify CA |
If the eG agent is required to establish an encrypted connection with the target PostGreSQL Database server by authenticating the server's identity through verifying the server CA certificate, set Verify CA flag to Yes. By default, this flag is set to No. |
CA Cert File |
This parameter is applicable only if the target PostGreSQL Database is SSL-enabled.The certificate file is a public-key certificate following the x.509 standard. It contains information about the identity of the server, such as its name, geolocation, and public key. Each nodes of the target cluster can have individual certificate files or a single certificate can be used to access all the nodes in the cluster. Essentially, it’s a certificate that the server serves to the connecting users to prove that they are what they claim to be. Therefore, specify the full path to the server root certificate or certificate file that is signed by the CA in .crt file format for all/each node in the CA Cert File text box. For example, the location of this file may be: C:\app\eGurkha\JRE\lib\security\PostGreQL-test-ca.crt. By default, this parameter is set to none. This parameter specification differs according to the type of cluster and configuration: If the certificate file is available for each node of the PostGreSQL Cluster then, provide a comma-seperated list of full path to the certificates in CA Cert File text box: For example:C:\app\eGurkha\JRE\lib\security\postgresql-test-ca.crt,C:\app\eGurkha\JRE\lib\security\postgresql-test-ca2.crt,C:\app\eGurkha\JRE\lib\security\postgresql-test-ca3.crt Specify the full path to the certificate file of the target PostGreSQL Database if a single certificate is used to access all nodes. For example: C:\app\eGurkha\JRE\lib\security\postgresql-test-ca.crt |
Client Cert File |
This parameter is applicable only if the target PostGreSQL Database is SSL-enabled. In order to collect metrics from the target MongoDB cluster, the eG agent requires client certificate in .p12 format. Hence, specify the full path to the Client certificate file in .p12 format in the Client Cert File text box. For example, the location of this file may be: C:\app\eGurkha\JRE\lib\security\test-client.p12. |
Client Key File |
A client key file refers to a file containing the private key that corresponds to the public key used by a client. Provide full path of the file containing client key. |
Detailed Diagnosis |
To make diagnosis more efficient and accurate, the eG Enterprise embeds an optional detailed diagnostic capability. With this capability, the eG agents can be configured to run detailed, more elaborate tests as and when specific problems are detected. To enable the detailed diagnosis capability of this test for a particular server, choose the On option. To disable the capability, click on the Off option. The option to selectively enable/disable the detailed diagnosis capability will be available only if the following conditions are fulfilled:
|
Measurement | Description | Measurement Unit | Interpretation |
---|---|---|---|
Root blockers |
Indicates the number of root blockers. |
Number |
This measure counts those processes that are blocking the number of processes configured against the BLOCKED SESSION COUNT parameter, as root blockers. A non-zero value for this measure is a cause for concern, as it indicates one/more root blockers. The detailed diagnosis of this measure lists the Blocking PID, Blocking Username, Database name, Application name, Blocking client address, Wait event type, Blocking duration(in seconds), Blocking SQL test, Blocked ID, Blocked Username, Blocked Client address, and Blocked SQL text. |
Maximum waiting time |
Indicates the maximum time for which a process blocked one/more processes. |
Seconds |
eG Enterprise isolates processes that have been blocking other processes for a duration greater than the configured MAX waiting TIME. The blocking time of these processes is then compared and the maximum blocking time is identified and reported as the value of this measure. If this time is abnormally high, it indicates that a process been blocking resource access to other process(es) for a very long time. Prolonged blocking can significantly degrade database performance. Under such circumstances therefore, you can use the detailed diagnosis of the Blocked sessions measure to know which process was blocked for the maximum time and by which process. |
Blocked sessions |
Indicates the number of processes that are blocked. |
Number |
A high value of this measure indicates that a large number of processes are not allowed access to resources. Check the detailed diagnosis of this measure to know which processes were blocked for a duration greater than or equal to the MAX waiting TIME configuration, and which processes were blocking them. |