Forum OpenACS Q&A: Re: best Postgres vacuum to do automatically

Collapse
Posted by Jonathan Ellis on
carnageblender.com probably does more updates than most oacs sites, and vacuum full nightly would still be overkill.  Particularly since full still takes out table locks, you're nuts to do that nightly to a busy service with a large amount of data.  Allowing a "lazy" vacuum that doesn't exclusively lock was a HUGE win for 7.2.  The contention doing VACUUM FULL on my entire database caused was bad enough that back in the 7.1 days I added a filter to just serve up a "routine database maintenance" page to the users for the half hour vacuum took; it was just too frustrating for them otherwise.

With 7.2 what I do instead is besides vacuum analyzing, I nightly vacuum full (and reindex) a handful of tables at a time.  I get all the tables in the database over a 10 day period -- so maybe 3 minutes a day, I can live with that -- and things don't get too crufty in the meantime.  (For comparison, this is roughly 250k updates and deletes a day.) I can post the code if people are interested.