<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
mike wrote:
<blockquote
 cite="mid:bd9320b30810011539gae12099kf306462793293ad8@mail.gmail.com"
 type="cite">
  <pre wrap="">On Wed, Oct 1, 2008 at 1:43 PM, Maxim Dounin <a class="moz-txt-link-rfc2396E" href="mailto:mdounin@mdounin.ru">&lt;mdounin@mdounin.ru&gt;</a> wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Hello!
    </pre>
  </blockquote>
  <pre wrap=""><!---->
  </pre>
  <blockquote type="cite">
    <pre wrap="">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.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
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.
  </pre>
</blockquote>
<br>
Previously there was a syslog patch sent to the list (which I hope
might one day get committed... here's hoping...).<br>
<br>
With a bit of ingenuity you can syslog to some other machine which
simply eats the syslog and computes some stats.<br>
<br>
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)<br>
<br>
Good luck<br>
<br>
Ed W<br>
</body>
</html>