暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

PostgreSQL 监控插件 bg_mon - 内置 WEB 服务

digoal 2020-05-27
581

作者

digoal

日期

2020-05-27

标签

PostgreSQL , bg_mon , 监控


背景

https://github.com/CyberDem0n/bg_mon

bg_mon is a contrib module compatible with PostgreSQL starting from version 9.3 It collects per-process statistics combined with pg_stat_activity for the processes that have the rows there, global system stats, per-partition information and the memory stats.

List of available GUC variables

```
bg_mon.listen_address = '0.0.0.0' # listen on all available interfaces (default value: 127.0.0.1)

bg_mon.port = 8888 # listen on port 8888 (default value: 8080)

bg_mon.naptime = 10 # collect statistics every 10 seconds (default value: 1)

bg_mon.history_buckets = 60 # keep one-minute aggregated statistics in memory for 60 minutes (default value: 20)
```

How to run it:

```
Add shared_preload_libraries = 'bg_mon' to your postgresql.conf
If you want to change default values of bg_mon.listen_address, bg_mon.port, bg_mon.naptime, or bg_mon.history_buckets - just add them to the postgresql.conf
restart postgresql
If you did everything right, go to you browser and type following URLs to see results:

http://:/ -- expose collected statistics in a JSON format.

http://:/X -- get aggregated statistics from the bucket X, where X is between 0 and history_buckets. The array with the current bucket might be not yet closed.

http://:/ui -- simple web page which fetches statistics from server every second and renders it in a simple html format.
```

PostgreSQL 许愿链接

您的愿望将传达给PG kernel hacker、数据库厂商等, 帮助提高数据库产品质量和功能, 说不定下一个PG版本就有您提出的功能点. 针对非常好的提议,奖励限量版PG文化衫、纪念品、贴纸、PG热门书籍等,奖品丰富,快来许愿。开不开森.

9.9元购买3个月阿里云RDS PostgreSQL实例

PostgreSQL 解决方案集合

德哥 / digoal's github - 公益是一辈子的事.

digoal's wechat

文章转载自digoal,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论