nginx access_log buffer大小设置
来源:互联网 发布:virtualbox安卓软件 编辑:程序博客网 时间:2024/05/21 10:27
access_log 的buffer设置多大,看官网说是不能超过原子写入磁盘的大小。这个值在Linux里边是没有变量或者环境变量来设置的。
The access_log directive sets the path, format and buffer size for the access log file. Using "off" as the only parameter clears allaccess_log directives for the current level. If the format is not indicated, it defaults to"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.
为啥有这个限制呢,看一下其代码
n = ngx_write_fd(file->fd, buffer->start, len);#endif if (n == -1) { ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, ngx_write_fd_n " to \"%s\" failed", file->name.data); } else if ((size_t) n != len) { ngx_log_error(NGX_LOG_ALERT, log, 0, ngx_write_fd_n " to \"%s\" was incomplete: %z of %uz", file->name.data, n, len); }
发现他写不完整不会while里边循环写,直接丢弃和报错了。
这个atomtic write size到底多少,压测试试,设置access_log buffer=4096k, 结果一直写到1G还没有报错。
其它相关信息:
huanglq@hadoop99 conf]$ grep PIPE_BUF /usr/include/linux/limits.h
#define PIPE_BUF 4096 /* # bytes in atomic write to a pipe */
PIPE_BUF 是指pipe的buf,而不是文件的,所以不是该值
另外磁盘buf是8Msudo hdparm -i /dev/sda
/dev/sda:
Model=ST3250318AS , FwRev=CC37 , SerialNo= 6VY3FTLF
Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs RotSpdTol>.5% }
RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=4
BuffType=unknown, BuffSize=8192kB
再将日志改成8.3M,超过磁盘的buffsize,写了1.5G还是没有报错
- nginx access_log buffer大小设置
- nginx access_log 完全关闭
- nginx access_log日志
- Oracle Redo Log Buffer的大小设置
- nginx设置请求body大小
- nginx的error_log和access_log分析
- 日志-nginx的access_log与error_log
- 关于设置log buffer 合理大小的几个要点
- 第八讲--buffer cache大小的设置及依据
- 在nginx中设置socket缓冲区大小
- nginx 1.4.6 设置上传大小 client_max_body_size
- 笔记:nginx文件上传大小设置
- nginx 1.4.6 设置上传大小 client_max_body_size
- nginx windows 下,关闭 error_log.log,access_log.log
- nginx服务器access_log日志分析及配置详解
- nginx服务器access_log日志分析及配置详解
- nginx服务器access_log日志分析及配置详解
- nginx服务器access_log日志分析及配置详解
- 1、创建工程及splash界面
- POSITION用法解释
- 机房收费系统-概要设计说明书
- 【Android动画】之Frame动画
- CCS5 的基础知识
- nginx access_log buffer大小设置
- ORACLE 11g 自带程序 SQL Developer中不显示DBMS_OUTPUT.PUT_LINE()解决方案
- C++ 智能指针
- new String创建了多少个String对象
- 自己加班
- 利用ODBC管理excel文件
- C#面向对象经典资料
- Esper学习之二:事件类型
- php中实现倒计时的功能