Date: Sun, 23 May 1999 09:47:32 -0700 From: Graeme Tait <graeme@echidna.com> To: Roger Marquis <marquis@roble.com> Cc: freebsd-isp@freebsd.org Subject: Re: Web Statistics break up program. Message-ID: <37483124.6C04@echidna.com> References: <Pine.GSO.3.96.990522210859.16625B-100000@roble2.roble.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Roger Marquis wrote: > And if anyone has been able to produce a race condition with "cp > logfile logfile.bk;cp /dev/null logfile" they haven't spoken up. > Having used this technique for years without a race condition it would > appear to be a false alarm. > > The one disadvantage of copying /dev/null is that it is possible to > lose log entries on busy servers however, from checking log files and > rotated logfiles, it would have to be an extremely busy server to lose > log entries. How would you know if you are losing log entries? I intend to try this when I get some free time. To do it I will set up Apache to make a second parallel copy of the access log for one fairly busy site, and use your technique a few times at peak periods on the extra access log file, comparing the resultant log segments with the master log. One question - what ensures there isn't a significant delay between completion of the cp of the logfile, and the start of the cp /dev/null? On a machine running CPU intensive tasks, my experience with executing commands from a console is that sometimes the shell (or something) seems to pause a little before getting a new command running. Our server has a number of CGI tasks that use a lot of CPU - it's not unusual for there to be several such tasks running in parallel, with 100% CPU utilization for seconds at a time. -- Graeme Tait - Echidna To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-isp" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?37483124.6C04>