Problem when logrotate runs on Varnish

Lane, Richard rlane at ahbelo.com
Tue May 19 15:30:16 CEST 2015


Raymond,

We found that using the option 'delaycompress' helps ensure the Varnish
process is able to release the file before it is compressed. It seems the
Varnish process is having to wait or retry if we don't delay compression.
Then we use 'lastaction' to script the compress afterwards.

Cheers,

Richard Lane
AHBelo / The Dallas Morning News


---
Date: Mon, 18 May 2015 10:55:53 -0400
From: "Jennings III, Raymond" <raymond.jennings at nytimes.com>
To: varnish-misc <varnish-misc at varnish-cache.org>
Subject: Problem when logrotate runs on Varnish
Message-ID:
        <CADFjDbMXVN=jx-9rCCA9HYMPzCEYrVVup9fORxebF17kc-dXuQ at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

I get an outage at midnight when logrotate runs on the Varnish logs.  I
don't see anything in syslog but I do get various alerts from Nagios, etc.

I have the following logrotate for Varnish.  I see others where they use
USR1 instead of HUP - not sure if that makes a difference.  Anything else I
could look for.  It smells of a "timing issue" but not much to go on or
prove my hunch.



/var/nyt/logs/varnish/*_log {
    daily
    missingok
    rotate 7
    compress
    dateext
    compresscmd /usr/bin/bzip2
    compressext .bz2
    sharedscripts
    postrotate
        /bin/kill -HUP `cat /var/run/varnishlog.pid 2>/dev/null` 2>
/dev/null || true
        /bin/kill -HUP `cat /var/run/varnishncsa.pid 2>/dev/null` 2>
/dev/null || true
    endscript
    lastaction
        /usr/bin/php /var/nyt/bin/varnish/varnish-copylog-S3.php
>>/tmp/varnish-log-S3.txt 2>&1
    endscript
}


Raymond Jennings III
*nytimes.com <http://nytimes.com/>*
*Office: 212.556.7786 <212-556-7786>*

*iPhone: 914.330.5074 <914-330-5074>E-mail: Raymond.Jennings at nytimes.com
<Raymond.Jennings at nytimes.com>FaceTime: Raymond.Jennings at nytimes.com
<Raymond.Jennings at nytimes.com>*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20150519/fde9414d/attachment.html>


More information about the varnish-misc mailing list