Tuning the maximum connections in the database


The following PATROL for PostgreSQL KM metrics generate events that will help you decide to adjust the number of connections in the PostgreSQL database environment.

These KM metrics generate events that indicate the number of:

  • connections to the database
  • database elements waiting to get a lock
  • locked database elements

You can use the events generated by these metrics to determine whether it is necessary to increase, or decrease, the maximum number of connections (max_connections) parameter in the PostgreSQL database environment.

Note

The default amount of connections is typically set to 100. Increasing this parameter might cause PostgreSQL to request more System V shared memory or semaphores than your operating system's default configuration allows.

This page includes information about the following PATROL for PostgreSQL KM attributes:

Number of connections

Set the threshold on this attribute to get notified about the number of connections to the PostgreSQL database. By default, this attribute will not generate an alarm or warning event. For more information about this attribute, see Number of Connections attribute page.

For more information about setting an alarm or warning event for this attribute, or changing the default attribute range, see Defining-a-monitoring-policy.

Number of connections graph

Number of connections_graph.png

Event generated by the KM

You can see the event in the TrueSight console in Monitoring > Events.

Number of connections_event.png

Suggested action

The KM event indicates that you might want to increase the number of maximum connections in the PostgreSQL database.

Number of elements waiting to get a lock

Set the threshold on this attribute to get notified about the number of database elements waiting to get a lock. By default, this attribute will not generate an alarm or warning event. For more information about this attribute, see Number of elements waiting to get a Lock attribute page.

For more information about setting an alarm or warning event for this attribute, or changing the default attribute range, see Defining-a-monitoring-policy.

Number of elements waiting to get a lock graph

Number of elements waiting to get a lock_graph.png

Event generated by the KM

You can see the event in the TrueSight console in Monitoring > Events.

Number of elements waiting to get a lock_event.png

Suggested action

The KM event indicates that you might want to increase the maximum connections in the PostgreSQL database so fewer elements (connections) are waiting for a lock.

Number of locked database elements

Set the threshold on this attribute to get notified  about the number of locked database elements. By default, this attribute will not generate an alarm or warning event. For more information about this attribute, see Number of locked elements attribute page.

For more information about setting an alarm or warning event for this attribute, or changing the default attribute range, see Defining-a-monitoring-policy.

Number of elements that acquire locks graph

Number of elements that acquire locks_graph.png

Event generated by the KM

You can see the event in the TrueSight console in Monitoring > Events.

Suggested action

The KM event indicates that you might want to increase the number of maximum connections in the PostgreSQL database so more elements (connections) are locked.