To resolve this issue, assign Postgres service more resources:
- Secure Shell into the virtual appliance
- Edit /storage/db/pgdata/postgresql.conf file:
- Find the following lines, uncomment them if necessary, and edit the values to match the below
shared_buffers = 2GB
maintenance_work_mem = 512MB
min_wal_size = 512MB
max_wal_size = 2GB
checkpoint_completion_target = .8
Note: An empiric test must be performed to find the suitable values. These are good starting values, but may need to be adjusted if issues are still seen with autovacuum processes.
Workaround:
If providing additional resources does not fully resolve the issue, continue with the workaround below.
- Manually VACUUM FULL the table
VACUUM (FULL, VERBOSE, ANALYZE) vmo_workflowtokencontent;
INFO: vacuuming "public.vmo_workflowtokencontent"
INFO: "vmo_workflowtokencontent": found 0 removable, 17 nonremovable row versions in 2 pages
DETAIL: 0 dead row versions cannot be removed yet.
CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s.
INFO: analyzing "public.vmo_workflowtokencontent"
INFO: "vmo_workflowtokencontent": scanned 2 of 2 pages, containing 17 live rows and 0 dead rows; 17 rows in sample, 17 estimated total rows
VACUUM
- Update the auto-vacuum configuration to allow more frequent vacuum attempts:
alter table vmo_workflowtokencontent set (autovacuum_vacuum_scale_factor = 0.05);
alter table vmo_workflowtokencontent set (autovacuum_vacuum_threshold = 25);
alter table vmo_workflowtokencontent set (autovacuum_vacuum_cost_delay = 10);
alter table vmo_workflowtokencontent set (autovacuum_analyze_threshold = 25);
alter table vmo_workflowtokencontent set (toast.autovacuum_vacuum_scale_factor = 0.05);
alter table vmo_workflowtokencontent set (toast.autovacuum_vacuum_threshold = 25);
alter table vmo_workflowtokencontent set (toast.autovacuum_vacuum_cost_delay = 10);
- Validate the new auto-vacuum scale factor settings
SELECT relname, pg_options_to_table(reloptions) AS reloption
FROM pg_class
WHERE reloptions IS NOT NULL
AND relnamespace = 'public'::regnamespace
ORDER BY relname, reloption;
- Verify that manual vacuum full command reduced the vmo_workflowtokencontent table size.