pg_shmem_allocations_numa
是一个 系统目录 视图,它显示服务器主共享内存段中的共享内存分配如何在 NUMA 节点之间分布。
pg_shmem_allocations_numa
在 PostgreSQL 18 中添加。
变更历史
- PostgreSQL 18
- 添加(提交 8cc139be)
示例
pg_shmem_allocations_numa
的基本用法示例
postgres=# SELECT * FROM pg_shmem_allocations_numa ORDER BY name LIMIT 10; name | numa_node | size ---------------------------------+-----------+--------- AioBackend | 0 | 102400 AioCtl | 0 | 4096 AioHandle | 0 | 2826240 AioHandleData | 0 | 2510848 AioHandleIOV | 0 | 5017600 Archiver Data | 0 | 4096 Async Queue Control | 0 | 12288 AutoVacuum Data | 0 | 12288 Backend Activity Buffer | 0 | 315392 Backend Application Name Buffer | 0 | 24576 (10 rows)
在没有 NUMA 支持的 PostgreSQL 实例上尝试查询 pg_shmem_allocations_numa
postgres=# SELECT * FROM pg_shmem_allocations_numa; ERROR: libnuma initialization failed or NUMA is not supported on this platform
参考资料
- PostgreSQL文档: pg_shmem_allocations_numa