PostgreSQL temp bytes per second alert


The Temp Bytes Per Second alert notifies you when its configured condition is met on PostgreSQL instances so you can investigate and respond.

Screenshot pending: Mini DBA PostgreSQL Temp Bytes Per Second alert screenshot placeholder

Alert summary

  • Platform: PostgreSQL
  • Alert category: Query
  • Default enabled: true
  • Default evaluation frequency: Minute
  • Threshold label: MB/sec
  • Unit: MB/sec

What Mini DBA checks

Mini DBA describes this alert as: High temporary file write rate often indicates sorts or hashes spilling to disk. Review work_mem and expensive queries. Mini DBA evaluates this alert once a minute so changes are detected quickly. Because duration is used, Mini DBA can avoid treating a single short spike as a full incident when the condition clears quickly.

How this alert helps

This alert identifies a high PostgreSQL temporary-file write rate, commonly caused by sorts, hashes, reporting queries, or other operations spilling beyond available work memory.

When to enable it

Enable it once the instance has a normal workload baseline. It is especially useful on busy OLTP, reporting, and integration systems where resource pressure can quickly become user-visible.

Threshold guidance

Threshold meaning: MB/sec. Major threshold: 100 MB/sec. Minor threshold: 25 MB/sec. Comparison direction: over. Duration is used, so prefer requiring the condition to persist before paging people for transient spikes. For an over-threshold alert, decreasing a threshold makes that severity fire sooner; increasing it tolerates more load or pressure. Set the minor threshold as an early-warning level and the major threshold at the highest acceptable value for the service.

Remediation for an active alert

Find statements producing temporary files, review their plans and row estimates, and tune the query, indexes, or batching first. Adjust work_mem only with concurrency and total memory in mind, because it can be consumed by multiple operations in each session.

Investigation workflow

  1. Confirm the temporary-byte rate, duration, databases, and active statements in the alert window.
  2. Review plans for large sorts, hashes, materialization, and inaccurate row estimates.
  3. Compare work_mem and total concurrency with host memory headroom before changing settings.
  4. Validate both temporary-file use and query latency after remediation.

Avoiding alert noise

Use duration and a workload baseline to ignore isolated administrative spills while retaining visibility into sustained temporary I/O that affects query latency or storage throughput.

Related pages