Thread

  1. Vacuum freeze

    Mike Blackwell <mike.blackwell@rrd.com> — 2014-12-04T17:02:01Z

    check_postgres.pl (--action=autovac_freeze) recently complained that we
    needed to run VACUUM FREEZE.  Doing so generated a boatload of WAL files -
    perhaps on the order of the of the database itself.
    
    Is VACUUM FREEZE something that is normally handled by autovac?  If so, how
    would we approach finding what caused it not to happen automatically?  Or
    if it's not, what's the normal approach to scheduling it manually to
    prevent this flood of WAL?
    
  2. Re: Vacuum freeze

    Vick Khera <vivek@khera.org> — 2014-12-04T17:26:38Z

    I don't think autovacuum can predict you will not update your table(s)
    anymore, so there's no way to know to run FREEZE on it.
    
    On Thu, Dec 4, 2014 at 12:02 PM, Mike Blackwell <mike.blackwell@rrd.com>
    wrote:
    
    > check_postgres.pl (--action=autovac_freeze) recently complained that we
    > needed to run VACUUM FREEZE.  Doing so generated a boatload of WAL files -
    > perhaps on the order of the of the database itself.
    >
    > Is VACUUM FREEZE something that is normally handled by autovac?  If so,
    > how would we approach finding what caused it not to happen automatically?
    > Or if it's not, what's the normal approach to scheduling it manually to
    > prevent this flood of WAL?
    >
    >
    >
    
  3. Re: Vacuum freeze

    Josh Kupershmidt <schmiddy@gmail.com> — 2014-12-04T18:48:54Z

    On Thu, Dec 4, 2014 at 12:02 PM, Mike Blackwell <mike.blackwell@rrd.com> wrote:
    > check_postgres.pl (--action=autovac_freeze) recently complained that we
    > needed to run VACUUM FREEZE.  Doing so generated a boatload of WAL files -
    > perhaps on the order of the of the database itself.
    >
    > Is VACUUM FREEZE something that is normally handled by autovac?  If so, how
    > would we approach finding what caused it not to happen automatically?  Or if
    > it's not, what's the normal approach to scheduling it manually to prevent
    > this flood of WAL?
    
    It is (supposed to be) handled by autovacuum: you can tune
    autovacuum_freeze_max_age:
    http://www.postgresql.org/docs/current/static/runtime-config-autovacuum.html
    
    And there are similar knobs for manual VACUUMs as well.
    
    Josh
    
    
    
  4. Re: Vacuum freeze

    Jeff Janes <jeff.janes@gmail.com> — 2014-12-04T20:13:16Z

    On Thu, Dec 4, 2014 at 9:02 AM, Mike Blackwell <mike.blackwell@rrd.com>
    wrote:
    
    > check_postgres.pl (--action=autovac_freeze) recently complained that we
    > needed to run VACUUM FREEZE.  Doing so generated a boatload of WAL files -
    > perhaps on the order of the of the database itself.
    >
    > Is VACUUM FREEZE something that is normally handled by autovac?  If so,
    > how would we approach finding what caused it not to happen automatically?
    > Or if it's not, what's the normal approach to scheduling it manually to
    > prevent this flood of WAL?
    >
    
    I think you are misinterpreting what is going on.
    
    check_postgres has no business telling you to run VACUUM FREEZE, and from
    what I can see in the documentation it doesn't try to do that.  What it is
    warning you about is that autovac is just about to kick in and do a full
    scan to prevent wraparound.
    
    Such a scan can cause intense activity (as you discovered) and so you might
    want to be warned that it is about to happen so you can control the process
    yourself if you want (for example, run it at night), rather than letting it
    happen automatically.
    
    
    Cheers,
    
    Jeff