Tell me what are the performance indicators and the health of the database should be monitored in postgresql?
1 answer
- First of all, of course, you need to monitor the basic parameters of the OS. Download CPU, Memory, Swap, Disks. In the case of Linux, utilities will help (top, htop, iostat, free)
- Next, you need to look at what requests take the most CPU time, and of course try to optimize them. This will help pg_stat_statements, powa ( http://dalibo.imtqy.com/powa/ )
- Further, it is very important to monitor table statistics such as index_scan, sequential_scan, and locks (ideally should be less than seq_scan). This data can be removed from the pg_stat_user_tables, pg_locks tables.
- If you use connection polling, you need to monitor the number of connections.
Well and for good it is necessary to fasten monitoring framework for assembly and storage of statistics. I personally use sensu (http_s: //sensuapp.org/) already with ready-made community plugins (http_s: //github.com/sensuplugins/sensu-plugins-postgres). And of course powa. In case of problems, of course, there is still a lot to see, but these are the main parameters and they are mostly enough.
|