sil*_*lis 7 postgresql performance statistics cache
我正在管理一个运行使用 PostgreSQL 的工具的服务器。该工具自行处理大多数 PostgreSQL 配置,但我观察到一些性能问题。我可以在操作系统级别确认正在发生大量 I/O,因此我怀疑正在发生大量缓存未命中。
如果您在互联网上寻找“缓存未命中”或“缓存未命中 postgresql”或类似的搜索,您会发现很多对“ cache_miss 统计信息”的引用。但是没有任何地方解释如何获得它们!我有点理解,该值必须从 fetches 中减去命中来计算。但由于我不是经验丰富的数据库管理员,我真的不明白价值观的意思:-S
我找到了PostgreSQL - Monitoring Database Activity文档,但我不确定以下公式是否是我所需要的:
cache_miss = "result_of" pg_stat_get_db_blocks_fetched(oid) - "result_of" pg_stat_get_db_blocks_hit(oid)
Run Code Online (Sandbox Code Playgroud)
对假人的解释将不胜感激。
先感谢您!
小智 1
PostgreSql的文档中有一段话:(这里)
Note: pg_stat_get_blocks_fetched minus pg_stat_get_blocks_hit gives the number of kernel read() calls issued for the table, index, or database; the number of actual physical reads is usually lower due to kernel-level buffering. The *_blks_read statistics columns use this subtraction, i.e., fetched minus hit.
这或许可以解释你的疑惑。
归档时间: |
|
查看次数: |
3137 次 |
最近记录: |