# Question about access\_log buffer size

**URL:** <https://www.ruby-forum.com/t/question-about-access-log-buffer-size/184108>\
**Category:** NGINX\
**Created:** [February 25, 2010, 6:16am UTC](https://www.ruby-forum.com/t/question-about-access-log-buffer-size/184108 "2010-02-25T06:16:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yong\_xue](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/3ec8ea/32.png) [@yong\_xue](https://www.ruby-forum.com/u/yong_xue)\
**Post date:** [February 25, 2010, 6:16am UTC](https://www.ruby-forum.com/t/question-about-access-log-buffer-size/184108/1 "2010-02-25T06:16:46Z")

</div>

hi,all

The _access\_log_ directive sets the path, format and buffer size for the  
access log file. Using “off” as the only parameter clears all  
_access\_log_ directives  
for the current level. If the format is not indicated, it defaults to  
“combined”  
[http://wiki.nginx.org/NginxHttpLogModule#log\_format\_combined](http://wiki.nginx.org/NginxHttpLogModule#log_format_combined).  
The size of buffer must not exceed the size of the atomic record for  
writing  
into the disk file. This size is not limited for FreeBSD 3.0-6.0.

this is quoted from [wiki.nginx.org](http://wiki.nginx.org).  
My server is running linux 2.6.16.  
I dont know the size of the atomic record for writing into the disk  
file.  
Can somebody help me?

I googled, but cannot make sure that the linux write system call is  
atomic.

–  
Best Regards,

è–› å‹‡

QQ:312200

e-mail:removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![yong\_xue](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/3ec8ea/32.png) [@yong\_xue](https://www.ruby-forum.com/u/yong_xue)\
**Post date:** [February 25, 2010, 1:13pm UTC](https://www.ruby-forum.com/t/question-about-access-log-buffer-size/184108/2 "2010-02-25T13:13:30Z")

</div>

On Thu, Feb 25, 2010 at 01:16:04PM +0800, yong xue wrote:

> I dont know the size of the atomic record for writing into the disk file.  
> Can somebody help me?
> 
> I googled, but cannot make sure that the linux write system call is atomic.

Linux shell ensure atomic write for PIP\_BUF, i.e. 4K. However, I believe  
this value is much more for regular files, so you may try to set 32k.

–  
Igor S.

> **[Igor Sysoev](http://sysoev.ru/en/)**

---

<div class="post-metadata">

**Author:** ![yong\_xue](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/3ec8ea/32.png) [@yong\_xue](https://www.ruby-forum.com/u/yong_xue)\
**Post date:** [February 25, 2010, 4:04pm UTC](https://www.ruby-forum.com/t/question-about-access-log-buffer-size/184108/3 "2010-02-25T16:04:27Z")

</div>

2010/2/25 Igor S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> > into the disk file. This size is not limited for FreeBSD 3.0-6.0.  
> > this value is much more for regular files, so you may try to set 32k.
> 
> thanks.

so the size depends on the implementation. And the access log is not  
much  
serious.  
I will do some reading on the kernel later if i have time.

–  
Best Regards,

è–› å‹‡

QQ:312200

e-mail:removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
MSN:removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
