PostgreSQL User Connections Test

This test monitors the users who are currently connected to the server and reports the number and state of each user connection. Using the metrics reported by this test, administrators can promptly isolate idle and waiting connections, which are a drain on a server’s resources.

Target of the test : PostgreSQL server

Agent deploying the test: An internal/remote agent

Outputs of the test : One set of results for each user currently connected to the target PostgreSQL server

Configurable parameters for the test
  1. TEST PERIOD – How often should the test be executed.
  2. Host – The IP address of the server.
  3. Port – The port on which the server is listening. The default port is 5432.
  4. User – 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. When doing so, ensure that this user is vested with the superuser privileges. The sample script we recommend for user creation for eG monitoring is:

    CREATE ROLE eguser LOGIN

    ENCRYPTED PASSWORD {‘eguser password’}

    SUPERUSER NOINHERIT NOCREATEDB NOCREATEROLE;

    The name of this user has to be specified in the USERNAME text box.

  5. Password- The password associated with the above user name (can be ‘NULL’). Here, ‘NULL’ means that the user does not have any password.
  6. Confirm password – Confirm the password (if any) by retyping it here.
  7. dbname - The name of the database to connect to. The default is “postgres”.
  8. ssl - The name of this user has to be specified in the USERNAME text box.
  9. 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:

    • The eG manager license should allow the detailed diagnosis capability
    • Both the normal and abnormal frequencies configured for the detailed diagnosis measures should not be 0.
Measurements made by the test
Measurement Description Measurement Unit Interpretation

Total connections:

Indicates the total number of connections that are currently established by this user on the server.

Number

 

Idle connections:

Indicates the number of connections of this user that are currently idle on the server.

Number

Ideally, the value of this measure should be low. A high value is indicative of a large number of idle connections, which in turn causes unnecessary consumption of critical server resources. Idle connections also unnecessarily lock new connections from the connection pool, thereby denying other users access to the server for performing important tasks. Use the detailed diagnosis of this measure to view the details of the idle connections.

Active connections:

Indicates the number of connections of this user that are currently active.

Number

Use the detailed diagnosis of this measure to view the details of the active connections.

Waiting connections:

Indicates the number of connections of this user that are currently waiting for a resource/database object/ lock to be released.

Number

The value of this measure should be kept at a minimum, as waiting connections also cause a resource drain.

Use the detailed diagnosis of this measure to view the details of the waiting connections.