Session load


Job details

Name: Session load
Platform: Postgres
Category: Performance
Performance
Description: Gathers session load statistics.
Long description: Task gathers session load statistics.
Version: 1.8
Default schedule: 0,10,20,30,40,50 * * *
Requires engine install: Yes
Compatibility tag: .[type=‘instance’ & databasetype=‘postgres’]/.[hasengine=‘YES’ & is_awsrds = ‘0′ & newer_than_ninefour = 1]

Parameters

Name Default value Description
keep data for 7 The number of days to keep the data for.
warning threshold 80 Warning threshold percentage of maximum number of concurrent connections to the database server (parameter: “max_connections”).
alarm threshold 95 Alarm threshold percentage of maximum number of concurrent connections to the database server (parameter: “max_connections”).

Job Summary

select count(*), state from pg_stat_activity group by state;

Implementation Overview

Key Components

Tables

Table Name Description
dbw_session_load_histr Stores individual session count data including timestamps.
dbw_session_load_aggr_histr Contains aggregated historical data such as average, max, and min session counts per time period.

Key Functions

Function Name Description
dbw_session_load Main procedure to execute the session monitoring logic, includes data aggregation and cleanup tasks.

Reports and Presentations

Dependencies and Cleanup

System and Version Compatibility

Conclusion

By continuously monitoring the session load, the dbWatch job “Session load” aids in maintaining optimal database performance and availability, thereby helping avoid potential overloads and facilitating better resource planning and management.