From owner-freebsd-questions@FreeBSD.ORG Tue Mar 6 06:02:24 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 69A4C16A403 for ; Tue, 6 Mar 2007 06:02:24 +0000 (UTC) (envelope-from david.robillard@gmail.com) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.228]) by mx1.freebsd.org (Postfix) with ESMTP id 14A8A13C47E for ; Tue, 6 Mar 2007 06:02:23 +0000 (UTC) (envelope-from david.robillard@gmail.com) Received: by nz-out-0506.google.com with SMTP id r28so2096475nza for ; Mon, 05 Mar 2007 22:02:23 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=CO20K6uXlVhwHqTHURrGxt64S/GEZXcbqcMVd8K0JE6UIhNozSge049JzWz1evPuMoNi67wvxMdSP4nLIXfLuKak7C7EjJCoX3eZmMOGqK4IpeS1tfWzzwVtiEXxVB3+qaMZVK7ibx3WlaX4SmFHJhvkhOXdBO9TaWTatW9B4G0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=V0EwBmNqGfmUGaB1ImYQGL1TAtxIdoIcuLSSHZjG2SZEpsM6Gozv3hGx0zQTZnoTVxIHwBgP8cmL1PPTi58ebtIg15smHd2Lj/95BH3PsgycZ5rUtHjMW3oXUfDVVyXEaJI8CBtwWMZfzhv02qn2+thYOqOuxObFPQrdj1gHuwQ= Received: by 10.65.224.11 with SMTP id b11mr1882288qbr.1173160943193; Mon, 05 Mar 2007 22:02:23 -0800 (PST) Received: by 10.64.210.7 with HTTP; Mon, 5 Mar 2007 22:02:23 -0800 (PST) Message-ID: <226ae0c60703052202i6853d9a5t263021bc07231d84@mail.gmail.com> Date: Tue, 6 Mar 2007 01:02:23 -0500 From: "David Robillard" To: peter@placidpublishing.net In-Reply-To: <45ECA718.5090908@placidpublishing.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <226ae0c60703051056ofb18dffu1ea0b9d48297b0bf@mail.gmail.com> <45EC6BF3.9090606@placidpublishing.net> <226ae0c60703051152h183fca79k470d2b064d871ccf@mail.gmail.com> <45ECA718.5090908@placidpublishing.net> Cc: freebsd-questions@freebsd.org Subject: Re: Apache Rotate Logs and Log Rotate. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2007 06:02:24 -0000 On 3/5/07, Peter Pluta wrote: > Gotcha, do you use a script to compress the logs after the SIGUSR1 and > after waiting for a bit for apache to clear it's logging buffer (to not > have missing logs)? No I don't. I don't even see why one would want to do this? Newsyslog deletes extra logs. So if our disk space is enough to hold the amount of logs we require (see math below), then there's no need to compress any Apache logs at all. Right!?!! If we come back to my example of 100 VirtualHost with log files of 2Mb each and we keep only 10 of them. Using USR1 as the kill signal, For an httpd children to miss any log entry would mean that this children writes more than 10 times 2Mb of logs in a very short period of time. Check your VirtualHost load and determine the average response time for each httpd children. If it's 2min (which is HUGE for an httpd children) That would mean that you'd need to have more than 20Mb of logs generated in less than 2min. In ASCII, that's a whole lot of logs. I'd say your best bet would be to switch your LogLevel from "debug" to "info" in your httpd.conf and restart Apache... ;) Or you run a really busy website. Or your web application code/architecture may need a revision. Have fun! David > > Well, if you do use newsyslog to rotate Apache log files, then it's > > just a matter of setting the number of files you whish to keep. From > > newsyslog.conf(5) > > > > count Specify the maximum number of archive files which may exist. > > This does not consider the current log file. > > > > Let's say you rotate your files once they reach 2Mb for example and > > that you've configured 10 in your newsyslog,conf field. Then > > that means a maximum of 10 x 2Mb = 20Mb will be kept for one > > VirtualHost. Now if you have 100 virtual hosts all configured this > > way, then you will need 100 x 20Mb = 2000Mb or 2Gb for all your Apache > > logs. > > > > Considering today's disk drive sizes are well beyond the 300Gb, I > > don't think this is a problem at all. > > > > Of course, YMMV so check your own needs and do the math. > > > > Cheers, > > > > David -- David Robillard UNIX systems administrator & Oracle DBA CISSP, RHCE & Sun Certified Security Administrator Montreal: +1 514 966 0122