26 messages in ru.sysoev.nginxRe: question about traffic statistics...
FromSent OnAttachments
sinnis rOct 21, 2007 11:04 pm 
Manlio PerilloOct 22, 2007 2:52 am 
Fernando PerezJul 3, 2008 3:02 am 
mikeJul 3, 2008 10:56 am 
ThomasOct 1, 2008 9:20 am 
Maxim DouninOct 1, 2008 9:42 am 
mikeOct 1, 2008 12:05 pm 
Maxim DouninOct 1, 2008 1:43 pm 
mikeOct 1, 2008 3:39 pm 
ThomasOct 2, 2008 5:37 am 
Ed WOct 2, 2008 9:12 am 
mikeOct 2, 2008 10:14 am 
ThomasOct 4, 2008 11:03 am 
ThomasOct 4, 2008 12:04 pm 
ThomasOct 4, 2008 12:14 pm 
mikeOct 4, 2008 12:24 pm 
Igor SysoevOct 4, 2008 12:28 pm 
ThomasOct 4, 2008 12:32 pm 
Igor SysoevOct 4, 2008 12:39 pm 
ThomasOct 4, 2008 12:55 pm 
mikeOct 8, 2008 12:07 am 
mikeOct 8, 2008 12:16 am 
ThomasOct 8, 2008 1:44 am 
mikeOct 8, 2008 11:59 am 
Maxim DouninOct 8, 2008 2:13 pm 
mikeOct 8, 2008 2:27 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: question about traffic statistics on each vhost,is it poActions...
From:Maxim Dounin (mdou@mdounin.ru)
Date:Oct 1, 2008 1:43:26 pm
List:ru.sysoev.nginx

Hello!

On Wed, Oct 01, 2008 at 12:06:11PM -0700, mike wrote:

On Wed, Oct 1, 2008 at 9:43 AM, Maxim Dounin <mdou@mdounin.ru> wrote:

Hello! Why not just log needed numbers ($bytes_sent) to access_log and post-process it with anything you want?

I might be forced to do this right now. That means millions of lines per day on 3 servers to combine, merge and calculate...

I'm sure it would be simple for someone to write a module that dumps out Host: header stats to a file every so often (one per day) ... *fingers crossed*

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.