qos
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_qos | 1.0 | ADMIN | GPL-3.0 | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 5240 | qos | No | Yes | Yes | Yes | No | No | - |
| Related | prioritize pg_permissions pg_readonly pg_crash pg_cooldown pg_rewrite pg_repack pgfincore |
|---|
requires shared_preload_libraries = ‘qos’; official support PG15+
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.0 | 1817161514 | pg_qos | - |
| RPM | PIGSTY | 1.0.0 | 1817161514 | pg_qos_$v | - |
| DEB | PIGSTY | 1.0.0 | 1817161514 | postgresql-$v-qos | - |
| OS / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 1.0.0 el8.x86_64.pg18 : pg_qos_18 pg_qos_18-1.0.0-1PIGSTY.el8.x86_64.rpm
| PIGSTY 1.0.0 el8.x86_64.pg17 : pg_qos_17 pg_qos_17-1.0.0-1PIGSTY.el8.x86_64.rpm
| PIGSTY 1.0.0 el8.x86_64.pg16 : pg_qos_16 pg_qos_16-1.0.0-1PIGSTY.el8.x86_64.rpm
| PIGSTY 1.0.0 el8.x86_64.pg15 : pg_qos_15 pg_qos_15-1.0.0-1PIGSTY.el8.x86_64.rpm
| PIGSTY MISS |
| el8.aarch64 | PIGSTY 1.0.0 el8.aarch64.pg18 : pg_qos_18 pg_qos_18-1.0.0-1PIGSTY.el8.aarch64.rpm
| PIGSTY 1.0.0 el8.aarch64.pg17 : pg_qos_17 pg_qos_17-1.0.0-1PIGSTY.el8.aarch64.rpm
| PIGSTY 1.0.0 el8.aarch64.pg16 : pg_qos_16 pg_qos_16-1.0.0-1PIGSTY.el8.aarch64.rpm
| PIGSTY 1.0.0 el8.aarch64.pg15 : pg_qos_15 pg_qos_15-1.0.0-1PIGSTY.el8.aarch64.rpm
| PIGSTY MISS |
| el9.x86_64 | PIGSTY 1.0.0 el9.x86_64.pg18 : pg_qos_18 pg_qos_18-1.0.0-1PIGSTY.el9.x86_64.rpm
| PIGSTY 1.0.0 el9.x86_64.pg17 : pg_qos_17 pg_qos_17-1.0.0-1PIGSTY.el9.x86_64.rpm
| PIGSTY 1.0.0 el9.x86_64.pg16 : pg_qos_16 pg_qos_16-1.0.0-1PIGSTY.el9.x86_64.rpm
| PIGSTY 1.0.0 el9.x86_64.pg15 : pg_qos_15 pg_qos_15-1.0.0-1PIGSTY.el9.x86_64.rpm
| PIGSTY MISS |
| el9.aarch64 | PIGSTY 1.0.0 el9.aarch64.pg18 : pg_qos_18 pg_qos_18-1.0.0-1PIGSTY.el9.aarch64.rpm
| PIGSTY 1.0.0 el9.aarch64.pg17 : pg_qos_17 pg_qos_17-1.0.0-1PIGSTY.el9.aarch64.rpm
| PIGSTY 1.0.0 el9.aarch64.pg16 : pg_qos_16 pg_qos_16-1.0.0-1PIGSTY.el9.aarch64.rpm
| PIGSTY 1.0.0 el9.aarch64.pg15 : pg_qos_15 pg_qos_15-1.0.0-1PIGSTY.el9.aarch64.rpm
| PIGSTY MISS |
| el10.x86_64 | PIGSTY 1.0.0 el10.x86_64.pg18 : pg_qos_18 pg_qos_18-1.0.0-1PIGSTY.el10.x86_64.rpm
| PIGSTY 1.0.0 el10.x86_64.pg17 : pg_qos_17 pg_qos_17-1.0.0-1PIGSTY.el10.x86_64.rpm
| PIGSTY 1.0.0 el10.x86_64.pg16 : pg_qos_16 pg_qos_16-1.0.0-1PIGSTY.el10.x86_64.rpm
| PIGSTY 1.0.0 el10.x86_64.pg15 : pg_qos_15 pg_qos_15-1.0.0-1PIGSTY.el10.x86_64.rpm
| PIGSTY MISS |
| el10.aarch64 | PIGSTY 1.0.0 el10.aarch64.pg18 : pg_qos_18 pg_qos_18-1.0.0-1PIGSTY.el10.aarch64.rpm
| PIGSTY 1.0.0 el10.aarch64.pg17 : pg_qos_17 pg_qos_17-1.0.0-1PIGSTY.el10.aarch64.rpm
| PIGSTY 1.0.0 el10.aarch64.pg16 : pg_qos_16 pg_qos_16-1.0.0-1PIGSTY.el10.aarch64.rpm
| PIGSTY 1.0.0 el10.aarch64.pg15 : pg_qos_15 pg_qos_15-1.0.0-1PIGSTY.el10.aarch64.rpm
| PIGSTY MISS |
| d12.x86_64 | PIGSTY 1.0.0 d12.x86_64.pg18 : postgresql-18-qos postgresql-18-qos_1.0.0-1PIGSTY~bookworm_amd64.deb
| PIGSTY 1.0.0 d12.x86_64.pg17 : postgresql-17-qos postgresql-17-qos_1.0.0-1PIGSTY~bookworm_amd64.deb
| PIGSTY 1.0.0 d12.x86_64.pg16 : postgresql-16-qos postgresql-16-qos_1.0.0-1PIGSTY~bookworm_amd64.deb
| PIGSTY 1.0.0 d12.x86_64.pg15 : postgresql-15-qos postgresql-15-qos_1.0.0-1PIGSTY~bookworm_amd64.deb
| PIGSTY MISS |
| d12.aarch64 | PIGSTY 1.0.0 d12.aarch64.pg18 : postgresql-18-qos postgresql-18-qos_1.0.0-1PIGSTY~bookworm_arm64.deb
| PIGSTY 1.0.0 d12.aarch64.pg17 : postgresql-17-qos postgresql-17-qos_1.0.0-1PIGSTY~bookworm_arm64.deb
| PIGSTY 1.0.0 d12.aarch64.pg16 : postgresql-16-qos postgresql-16-qos_1.0.0-1PIGSTY~bookworm_arm64.deb
| PIGSTY 1.0.0 d12.aarch64.pg15 : postgresql-15-qos postgresql-15-qos_1.0.0-1PIGSTY~bookworm_arm64.deb
| PIGSTY MISS |
| d13.x86_64 | PIGSTY 1.0.0 d13.x86_64.pg18 : postgresql-18-qos postgresql-18-qos_1.0.0-1PIGSTY~trixie_amd64.deb
| PIGSTY 1.0.0 d13.x86_64.pg17 : postgresql-17-qos postgresql-17-qos_1.0.0-1PIGSTY~trixie_amd64.deb
| PIGSTY 1.0.0 d13.x86_64.pg16 : postgresql-16-qos postgresql-16-qos_1.0.0-1PIGSTY~trixie_amd64.deb
| PIGSTY 1.0.0 d13.x86_64.pg15 : postgresql-15-qos postgresql-15-qos_1.0.0-1PIGSTY~trixie_amd64.deb
| PIGSTY MISS |
| d13.aarch64 | PIGSTY 1.0.0 d13.aarch64.pg18 : postgresql-18-qos postgresql-18-qos_1.0.0-1PIGSTY~trixie_arm64.deb
| PIGSTY 1.0.0 d13.aarch64.pg17 : postgresql-17-qos postgresql-17-qos_1.0.0-1PIGSTY~trixie_arm64.deb
| PIGSTY 1.0.0 d13.aarch64.pg16 : postgresql-16-qos postgresql-16-qos_1.0.0-1PIGSTY~trixie_arm64.deb
| PIGSTY 1.0.0 d13.aarch64.pg15 : postgresql-15-qos postgresql-15-qos_1.0.0-1PIGSTY~trixie_arm64.deb
| PIGSTY MISS |
| u22.x86_64 | PIGSTY 1.0.0 u22.x86_64.pg18 : postgresql-18-qos postgresql-18-qos_1.0.0-1PIGSTY~jammy_amd64.deb
| PIGSTY 1.0.0 u22.x86_64.pg17 : postgresql-17-qos postgresql-17-qos_1.0.0-1PIGSTY~jammy_amd64.deb
| PIGSTY 1.0.0 u22.x86_64.pg16 : postgresql-16-qos postgresql-16-qos_1.0.0-1PIGSTY~jammy_amd64.deb
| PIGSTY 1.0.0 u22.x86_64.pg15 : postgresql-15-qos postgresql-15-qos_1.0.0-1PIGSTY~jammy_amd64.deb
| PIGSTY MISS |
| u22.aarch64 | PIGSTY 1.0.0 u22.aarch64.pg18 : postgresql-18-qos postgresql-18-qos_1.0.0-1PIGSTY~jammy_arm64.deb
| PIGSTY 1.0.0 u22.aarch64.pg17 : postgresql-17-qos postgresql-17-qos_1.0.0-1PIGSTY~jammy_arm64.deb
| PIGSTY 1.0.0 u22.aarch64.pg16 : postgresql-16-qos postgresql-16-qos_1.0.0-1PIGSTY~jammy_arm64.deb
| PIGSTY 1.0.0 u22.aarch64.pg15 : postgresql-15-qos postgresql-15-qos_1.0.0-1PIGSTY~jammy_arm64.deb
| PIGSTY MISS |
| u24.x86_64 | PIGSTY 1.0.0 u24.x86_64.pg18 : postgresql-18-qos postgresql-18-qos_1.0.0-1PIGSTY~noble_amd64.deb
| PIGSTY 1.0.0 u24.x86_64.pg17 : postgresql-17-qos postgresql-17-qos_1.0.0-1PIGSTY~noble_amd64.deb
| PIGSTY 1.0.0 u24.x86_64.pg16 : postgresql-16-qos postgresql-16-qos_1.0.0-1PIGSTY~noble_amd64.deb
| PIGSTY 1.0.0 u24.x86_64.pg15 : postgresql-15-qos postgresql-15-qos_1.0.0-1PIGSTY~noble_amd64.deb
| PIGSTY MISS |
| u24.aarch64 | PIGSTY 1.0.0 u24.aarch64.pg18 : postgresql-18-qos postgresql-18-qos_1.0.0-1PIGSTY~noble_arm64.deb
| PIGSTY 1.0.0 u24.aarch64.pg17 : postgresql-17-qos postgresql-17-qos_1.0.0-1PIGSTY~noble_arm64.deb
| PIGSTY 1.0.0 u24.aarch64.pg16 : postgresql-16-qos postgresql-16-qos_1.0.0-1PIGSTY~noble_arm64.deb
| PIGSTY 1.0.0 u24.aarch64.pg15 : postgresql-15-qos postgresql-15-qos_1.0.0-1PIGSTY~noble_arm64.deb
| PIGSTY MISS |
Build
You can build the RPM / DEB packages for pg_qos using pig build:
pig build pkg pg_qos # build RPM / DEB packages
Install
You can install pg_qos directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
pig repo add pgsql -u # Add repo and update cache
Install the extension using pig or apt/yum/dnf:
pig install pg_qos; # Install for current active PG version
pig ext install -y pg_qos -v 18 # PG 18
pig ext install -y pg_qos -v 17 # PG 17
pig ext install -y pg_qos -v 16 # PG 16
pig ext install -y pg_qos -v 15 # PG 15
dnf install -y pg_qos_18 # PG 18
dnf install -y pg_qos_17 # PG 17
dnf install -y pg_qos_16 # PG 16
dnf install -y pg_qos_15 # PG 15
apt install -y postgresql-18-qos # PG 18
apt install -y postgresql-17-qos # PG 17
apt install -y postgresql-16-qos # PG 16
apt install -y postgresql-15-qos # PG 15
Preload:
shared_preload_libraries = 'qos';
Create Extension:
CREATE EXTENSION qos;
Usage
qos: QoS resource governor extension for PostgreSQL sessions and queries
The qos extension provides Quality of Service resource governance for PostgreSQL, allowing administrators to set per-role and per-database limits on memory usage, CPU cores, and concurrent transactions/statements.
Configuration Parameters
| Parameter | Type | Description |
|---|---|---|
qos.work_mem_limit | bytes | Maximum effective work_mem per session |
qos.cpu_core_limit | integer | Maximum CPU cores available to a session |
qos.max_concurrent_tx | integer | Maximum concurrent transactions |
qos.max_concurrent_select | integer | Maximum concurrent SELECT statements |
qos.max_concurrent_update | integer | Maximum concurrent UPDATE statements |
qos.max_concurrent_delete | integer | Maximum concurrent DELETE statements |
qos.max_concurrent_insert | integer | Maximum concurrent INSERT statements |
Per-Role Limits
ALTER ROLE app_user SET qos.work_mem_limit = '32MB';
ALTER ROLE app_user SET qos.cpu_core_limit = '2';
ALTER ROLE app_user SET qos.max_concurrent_select = '100';
Per-Database Limits
ALTER DATABASE appdb SET qos.max_concurrent_tx = '200';
Combined Role + Database Limits
ALTER ROLE app_user IN DATABASE appdb SET qos.work_mem_limit = '4MB';
ALTER ROLE app_user IN DATABASE appdb SET qos.max_concurrent_update = '10';
Enforcement Behavior
- Work memory: Intercepts
SET work_memand rejects values exceeding configured limits - CPU limiting (Linux only): Binds backend to N CPU cores via CPU affinity; on non-Linux platforms, limits parallel workers instead
- Concurrency: Executor hooks track active transactions/statements by type; violations block execution
Observability
SET client_min_messages = 'debug1'; -- enable debug output for QoS events
The most restrictive combination of role-level and database-level settings takes effect. Requires shared_preload_libraries = 'qos' and PostgreSQL 15+.
Feedback
Was this page helpful?
Thanks for the feedback! Please let us know how we can improve.
Sorry to hear that. Please let us know how we can improve.