Postgresql – Which all system parameters to be considered for standard Vacuum process

postgresqlvacuum

We want to run standard vacuum process on our production database which is over 100 GB and have millions of dead tuples.

Can anyone suggest what system parameters we need to keep in mind for setting cost-based vacuum settings? I mean like CPU/IO/Memory/Disk.

We cannot run vacuum full as the database should be up and running continuously so we just want to attain most appropriate value without affecting the system much.

Best Answer

The default settings will probably be fine.

That will limit the IO write usage to about 4MB/sec, that is, 4kB/msec = (8KB * vacuum_cost_limit / vacuum_cost_page_dirty / autovacuum_vacuum_cost_delay)

And RAM usage to about 48 MB (autovacuum_max_workers * maintenance_work_mem)