question about traffic statistics on each vhost,is it po
lists at wildgooses.com
Thu Oct 2 20:12:36 MSD 2008
> On Wed, Oct 1, 2008 at 1:43 PM, Maxim Dounin <mdounin at mdounin.ru> wrote:
>> It's not simple "dump out Host: header", it's shared memory, locking mutex
>> for each request, loosing stats on binary upgrade, etc, etc.
>> I see no reason why this can't be done from access_logs by simple perl
>> script - either running side-by-side with nginx but perfectly restarable
>> whenever you want, or periodically run at low-load periods.
>> We used to run similar script for calculation of average
>> $upstream_response_time for monitoring purposes and as far as I recall it
>> took less than 1% cpu on not-really-fast machine with more than 10 mln log
>> lines per day.
> Hmm, well, I've tried to get away from having to parse logfiles... but
> this is something I have to implement so I can account for my
> customer's bandwidth usage properly.
Previously there was a syslog patch sent to the list (which I hope might
one day get committed... here's hoping...).
With a bit of ingenuity you can syslog to some other machine which
simply eats the syslog and computes some stats.
Alternatively it's not rocket science to write a little perl demon which
just tails your log file and generates stats. It might even work to
have nginx write to some kind of named pipe and have your perl demon
consume the log file without spooling to disk at all (what happens if
something falls over though... Writing to disk gives you some soft
coupling of systems)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the nginx