Recently, several of the servers in the online PostgreSQL database have been updated very slowly, and have been detected and compared due to autovacuum not being started.
1. Use table Pg_stat_all_tables to view autovacuum execution record
Select Schemaname,relname,last_autovacuum,last_autoanalyze from Pg_stat_all_tables;
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/47/61/wKioL1P5_8qwmN2gAAEZ9Q0KloA474.jpg "title=" 3.png " alt= "Wkiol1p5_8qwmn2gaaez9q0kloa474.jpg"/> For example, found that all objects corresponding to the analyze and vacuum execution records are empty.
2. Using Ps-ef | grep postgres found postgres corresponding analyze and vacuum processes were not started
3. View the postgres.conf file and show all view autovacuum option set OK
Autovacuum = On
4. The three conditions for viewing the document Autovacuum startup are as follows:
a) set autovacuum = on
b) set track_counts = on
c) set /etc/hosts # to ping through localhost ( Not satisfied before the condition )
It turns out that this is the cause, the first time because of the project special reason in the/etc/hosts file for setting localhost.
Adding localhosts later did not restart PostgreSQL, causing track_counts to default to off without setting localhosts, and analyze and vacuum could not be started. The statistical information and vacuum of the database corresponding table were not executed successfully.
5. After the reason is found, the database is returned to normal after the maintenance time is restarted.
This article is from the "composer" blog, make sure to keep this source http://zuoqujia.blog.51cto.com/9151800/1544236
PostgreSQL database autovacuum process failed to start