atom feed14 messages in ru.sysoev.nginxRe: dynamic logs
FromSent OnAttachments
Vladan PopovicSep 11, 2008 1:15 pm 
Igor SysoevSep 11, 2008 1:36 pm 
Vladan PopovicSep 11, 2008 3:51 pm 
Igor SysoevSep 11, 2008 10:53 pm 
Vladan PopovicSep 12, 2008 12:38 am 
Igor SysoevSep 12, 2008 12:56 am 
Vladan PopovicSep 12, 2008 4:09 am 
Maxim DouninSep 12, 2008 4:40 am 
Maxim DouninSep 12, 2008 5:19 am 
Igor SysoevSep 12, 2008 5:27 am.log
Vladan PopovicSep 12, 2008 6:06 am 
Igor SysoevSep 12, 2008 6:29 am 
Igor SysoevSep 12, 2008 6:35 am 
Vladan PopovicSep 12, 2008 2:29 pm 
Subject:Re: dynamic logs
From:Igor Sysoev (is@rambler-co.ru)
Date:Sep 12, 2008 5:27:52 am
List:ru.sysoev.nginx
Attachments:

On Fri, Sep 12, 2008 at 04:20:02PM +0400, Maxim Dounin wrote:

Hello!

On Fri, Sep 12, 2008 at 11:10:02AM +0000, Vladan Popovic wrote:

Igor Sysoev <is@...> writes:

On Fri, Sep 12, 2008 at 07:38:42AM +0000, Vladan Popovic wrote:

Sorry for not being more knowledgeable ... I have init.d/nginx script to manage nginx. Should i run strace /etc/init.d/nginx restart or should i run another > instruction? (i did 'strace /etc/init.d/nginx' but couldn't find the string you

are > looking for)

Try the following:

1) stop nginx via "/etc/init.d/nginx stop"

2) add temporarily in nginx.conf:

daemon off; master_process off;

This will force nginx to run single process only.

3) then run nginx directly under strace:

strace /usr/sbin/nginx

4) and make request.

OK - i think i managed to do it ... here's the extract:

open("/var/log/nginx/be-o.com", O_RDWR|O_CREAT|O_APPEND, 0644) = 14 fstat(14, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 fcntl(14, F_GETFL) = 0x8402 (flags O_RDWR|O_APPEND|O_LARGEFILE) fcntl(14, F_SETFL, O_RDWR|O_APPEND|O_DIRECT|O_LARGEFILE) = 0 write(14, "192.168.1.16 - - [12/Sep/2008:19"..., 196) = -1 EINVAL (Invalid argument)

Could you please check if 'directio off;' helps? It should.

I was wrong, it shouldn't help. Try the patch instead.

Yes, the patch will help only. However, I prefer different one.

-- Igor Sysoev http://sysoev.ru/en/

Index: src/http/modules/ngx_http_log_module.c =================================================================== --- src/http/modules/ngx_http_log_module.c (revision 1563) +++ src/http/modules/ngx_http_log_module.c (working copy) @@ -430,6 +430,7 @@ of.log = 1; of.valid = llcf->open_file_cache_valid; of.min_uses = llcf->open_file_cache_min_uses; + of.directio = NGX_MAX_OFF_T_VALUE;

if (ngx_open_cached_file(llcf->open_file_cache, &log, &of, r->pool) != NGX_OK)