slru-infrastructure

Provide technical guidance for PostgreSQL SLRU implementation, debugging, and performance tuning.

Updated Jun 1, 2026
One-click install
npx skills add https://github.com/matejformanek/postgres-claude --skill slru-infrastructure
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: slru-infrastructure
Source: https://github.com/matejformanek/postgres-claude/tree/main/.claude/skills/slru-infrastructure
Command: npx skills add https://github.com/matejformanek/postgres-claude --skill slru-infrastructure

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the complexity of managing and debugging PostgreSQL's Simple LRU (SLRU) subsystem, which is critical for high-performance transaction tracking and metadata caching.

Core Features & Use Cases

  • Subsystem Guidance: Provides authoritative technical context on CLOG, MultiXact, Subtrans, CommitTs, and Notify machinery.
  • Performance Tuning: Offers actionable advice for configuring per-SLRU GUCs and diagnosing cache pressure or bank-lock contention.
  • Development Support: Assists in implementing new SLRU consumers, defining PagePrecedes logic, and ensuring correct WAL/crash-recovery behavior.

Quick Start

Use the slru-infrastructure skill to analyze the current SLRU buffer configuration and suggest optimal tuning parameters for high-transaction workloads.

Frequently Asked Questions about slru-infrastructure

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I tune PostgreSQL SLRU buffers for high-transaction workloads?

Tune PostgreSQL SLRU buffers by configuring per-consumer GUC parameters to diagnose cache pressure and bank-lock contention. This optimization ensures high-performance transaction tracking and metadata caching for heavy workloads.

What is the PostgreSQL SLRU subsystem used for?

The PostgreSQL SLRU subsystem is a Simple LRU mechanism used for critical transaction tracking and metadata caching. It manages core machinery including CLOG, MultiXact, Subtrans, CommitTs, and Notify components to maintain high-performance database operations.

How do I implement a new SLRU consumer in PostgreSQL?

Implementing a new PostgreSQL SLRU consumer requires defining PagePrecedes logic and ensuring correct WAL and crash-recovery behavior. The development process leverages the bank-locked LRU design and on-disk segment management specific to PG 17+.

Why does PostgreSQL SLRU bank-lock contention happen and how to fix it?

PostgreSQL SLRU bank-lock contention happens due to high concurrency pressure on shared cache buffers. Resolve it by analyzing the current SLRU buffer configuration and adjusting per-consumer GUC settings to optimize the distribution of locks across the subsystem.

Does PostgreSQL 17 introduce per-consumer GUC configuration for SLRU?

Yes, PostgreSQL 17 introduces per-consumer GUC configuration for SLRU, allowing granular tuning of the Simple LRU subsystem. This enables developers and database administrators to independently manage buffer sizes and resolve wraparound pressure for specific consumers.

When do I need to manage PostgreSQL SLRU on-disk segment files?

You need to manage PostgreSQL SLRU on-disk segment files when developing new SLRU consumers or experiencing wraparound pressure. Proper segment management ensures correct WAL logging and crash-recovery behavior for transaction tracking components like CLOG and MultiXact.