DEV Community

[Comment from a deleted post]
Collapse
 
elmuerte profile image
Michiel Hendriks

Postgres' auto vacuum settings are good enough. At some point in time, when your database grows with plenty data you might want to look into the auto vacuum behavior of each individual table.
For each table to can override de default settings to more suitable values for the way that table is used. For example, a small table with a lot of writes you probably want to reduce the auto vacuum threshold so that it's not done every few seconds or minutes.
In some cases you might even want to disable auto vacuum and schedule a crib job to explicitly vacuum those tables outside of peek ours. Even though auto vacuum tries is non blocking and runs on a low priority, it will produce a lot of IO, which affects disc buffers, and if the storage is non-local also network traffic.

I can't really go into the details for tuning the auto vacuum settings, as I have not really done this. It's on my to-do list, but so far our production servers are running along nicely.

Tuning the auto vacuum settings is performance optimization. So the standard rules apply:

  1. Don't.
  2. Don't Yet (for experts only