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