Elevator Pitch
Discover how Linux’s PSI (Pressure Stall Information) can supercharge PostgreSQL observability. Using the pg_psi extension and system triggers, this talk shows how to detect slowdowns in real time - then react dynamically to adjust workload or boost autovacuum before it’s too late.
Description
Pressure Stall Information (PSI) has been present in Linux for numerous years, but even so, it’s not well known in the world of PostgreSQL.
In this talk, we’ll introduce PSI along with what it brings, how it works, and where it is used today (spoiler: Facebook did a lot in this area!).
Then, we will use the pg_psi extension to start “playing” with PSI and react to system events. To do this, we will define system triggers so we’re notified then the server is slowing down. This gives us the chance to adjust the workload before it’s too late, or give more resources to background tasks like autovacuum when it’s possible.
Notes
PSI has 2 main aspects:
-
It provides a reading of the current load, like loadavg, but more precise and per cgroup.
-
It allows you to be notified when one or all processes are stalled for io, cpu and/or memory (for longer than expected), with details per cgroup.
The latter is the most interesting part and is a key component of today’s resource control for demanding projects. pg_psi is a solution to note for
PostgreSQL and PostgreSQL client applications.