diff for opening files with O_NOATIME

Igor Sysoev is at rambler-co.ru
Fri Sep 1 13:59:22 MSD 2006


On Fri, 1 Sep 2006, Yusuf Goolamabbas wrote:

> Igor, Does attached patch work better for you. I specifically only
> modify the open call ngx_http_static_module.c

Yes, I had did the same. The fix will be in next release.

> On 9/1/06, Igor Sysoev <is at rambler-co.ru> wrote:
>> On Fri, 1 Sep 2006, Yusuf Goolamabbas wrote:
>> 
>> > Linux since 2.6.8 supports O_NOATIME in open(2). This  does not update
>> > the  file  last  access  time  (st_atime  in the inode) when the file
>> > is read(2). Cherokee <http://www.0x50.org/> does similar things
>> >
>> > This might help in static file serving so I cooked up this patch. I
>> > did a grep -r RDONLY in the nginx src and didn't think there were
>> > issues if atime updates were disabled for various cases or should I
>> > create a patch specific to ngx_http_static_module.c
>> 
>> I think it's better to #define NGX_NOATIME and to set it explicitly.
>> Thank you.


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





More information about the nginx mailing list