用Nginx记日志,开发中遇到的若干问题

1,746 views
Skip to first unread message

thorny-road

unread,
Mar 26, 2013, 6:24:16 AM3/26/13
to open...@googlegroups.com
第一次发邮件列表,有点忐忑。最近一个项目打算用Nginx来接收点击流日志。但是真正实施时,还是遇到了不少问题,希望能跟大家讨论下:

1. 在Nginx HttpLogModule的wiki中有这样一段话:

“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.”

nginx是多进程写日志,write原子性很重要。在Linux下很多人说atomic size是PIPE_BUF,即4k。但在网上查到的资料中,我经常看到将buffer大小配置为类似32k这样的大小,感到有点疑惑。写管道的时候,如果并发写大于4k,可能出现问题。但如果写普通文件,经过调研,发现nginx中在文件打开flag中加入了append标识,这样write其实是可以保证原子的。不知道大家觉得是否正确?

另外总觉得用Nginx大量写IO会将主线程阻塞在磁盘io上,总感觉起个专门的磁盘IO线程更好,不知道是否有现成的模块?打算以后自己写个。

2. 关于lua中输出字符的问题

点击流日志分隔符,我效仿网上一篇文章,使用了ascii不可见字符^A。开发中遇到的一个问题是,如果直接将^A写入log_format打印没有问题,但如果在lua中对输入字符串进行处理(比如原先分隔符是|,替换为^A),最终经过nginx打印,会发现打印出的不是^A,而是^A的ascii码,印象中是\x001之类,十分奇怪。目前这个问题还没有深入调查,不知大家遇到过类似问题没?

wd

unread,
Mar 26, 2013, 7:06:03 AM3/26/13
to open...@googlegroups.com

2013/3/26 thorny-road <luomoj...@gmail.com>

2. 关于lua中输出字符的问题

点击流日志分隔符,我效仿网上一篇文章,使用了ascii不可见字符^A。开发中遇到的一个问题是,如果直接将^A写入log_format打印没有问题,但如果在lua中对输入字符串进行处理(比如原先分隔符是|,替换为^A),最终经过nginx打印,会发现打印出的不是^A,而是^A的ascii码,印象中是\x001之类,十分奇怪。目前这个问题还没有深入调查,不知大家遇到过类似问题没?


这个问题我之前也发现了,记录的是 \x001。

wgm.china

unread,
Mar 26, 2013, 9:13:11 AM3/26/13
to openresty
非常关注你的问题,虽然不能给你提供有用的参考信息,不过关注你的应用,希望你的成功开发出resty的接口,最好能够开源让我们学习学习。
 
2013-03-26

wgm.china

发件人:thorny-road
发送时间:2013-03-26 18:24
主题:[openresty] 用Nginx记日志,开发中遇到的若干问题
收件人:"openresty"<open...@googlegroups.com>
抄送:
 
--
--
邮件来自列表“openresty”,专用于技术讨论!
订阅: 请发空白邮件到 openresty...@googlegroups.com
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+...@googlegroups.com
归档: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
教程: http://openresty.org/download/agentzh-nginx-tutorials-zhcn.html
 
 

agentzh

unread,
Mar 26, 2013, 2:33:54 PM3/26/13
to open...@googlegroups.com
Hello!

2013/3/26 thorny-road:
> 2. 关于lua中输出字符的问题
>
> 点击流日志分隔符,我效仿网上一篇文章,使用了ascii不可见字符^A。开发中遇到的一个问题是,如果直接将^A写入log_format打印没有问题,但如果在lua中对输入字符串进行处理(比如原先分隔符是|,替换为^A),最终经过nginx打印,会发现打印出的不是^A,而是^A的ascii码,印象中是\x001之类,十分奇怪。目前这个问题还没有深入调查,不知大家遇到过类似问题没?
>

这与 ngx_lua 无关,是较新的 nginx 核心引入的行为,即自动对 log_format 模版中的 nginx 变量的值中的非
ascii 字节进行转义。

如果你使用的是 ngx_openresty 自带的 nginx 核心,则可以通过 log_escape_non_ascii 指令禁用此行为,即:

log_escape_non_ascii off;

对应的补丁是

https://raw.github.com/agentzh/ngx_openresty/master/patches/nginx-1.2.7-log_escape_non_ascii.patch

Best regards,
-agentzh

thorny-road

unread,
Mar 26, 2013, 7:32:21 PM3/26/13
to open...@googlegroups.com
感谢agentzh!

项目中如遇到其他问题和心得,定会继续和大家分享。


--
--
邮件来自列表“openresty”,专用于技术讨论!
订阅: 请发空白邮件到 openresty...@googlegroups.com
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+...@googlegroups.com
归档: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
教程: http://openresty.org/download/agentzh-nginx-tutorials-zhcn.html





--
我珍藏的记忆 随风轻抚心灵 我锺爱的旋律 随意朗朗行吟

wd

unread,
Mar 26, 2013, 10:03:24 PM3/26/13
to open...@googlegroups.com

2013/3/26 thorny-road <luomoj...@gmail.com>

1. 在Nginx HttpLogModule的wiki中有这样一段话:

“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.”

nginx是多进程写日志,write原子性很重要。在Linux下很多人说atomic size是PIPE_BUF,即4k。但在网上查到的资料中,我经常看到将buffer大小配置为类似32k这样的大小,感到有点疑惑。写管道的时候,如果并发写大于4k,可能出现问题。但如果写普通文件,经过调研,发现nginx中在文件打开flag中加入了append标识,这样write其实是可以保证原子的。不知道大家觉得是否正确?

另外总觉得用Nginx大量写IO会将主线程阻塞在磁盘io上,总感觉起个专门的磁盘IO线程更好,不知道是否有现成的模块?打算以后自己写个。


另外,你要写日志,恐怕 io 是不可避免的。不知道你有没有研究过 flume,我觉得你可以写一个可以将日志发送给 flume 的模块,flume 的接受端可以异机或者本机,通过 tcp 发。这么做同时也搞定了流式收集,flume 还可以将日志直接放到 hfds 上面,方便你后续使用。

thorny-road

unread,
Mar 26, 2013, 10:30:50 PM3/26/13
to open...@googlegroups.com
所见略同,我们正打算调研使用flume,common tech stack就是好啊:)

另外设置了log_escape_non_ascii off; 似乎并没有达到应有的效果,大家有遇到类似的问题吗?希望大家帮忙看看

使用的是ngx_openresty-1.2.6.6,相关配置如下:

log_format tick "$test";
log_escape_non_ascii off;

...

set_unescape_uri $test $arg_test;
set_by_lua $test 'return ngx.var.test.gsub(ngx.var.test, "|", "^C")';

access_log /usr/local/openresty/nginx/logs/clickstream.log tick;

...

访问:http://127.0.0.1/xxx?test=22222|33333|44444

结果打印出来是:22222\x0333333\x0344444

如果直接echo $test,打印出来是正常的,似乎patch没生效。



--
--
邮件来自列表“openresty”,专用于技术讨论!
订阅: 请发空白邮件到 openresty...@googlegroups.com
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+...@googlegroups.com
归档: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
教程: http://openresty.org/download/agentzh-nginx-tutorials-zhcn.html
 
 

thorny-road

unread,
Mar 26, 2013, 11:09:14 PM3/26/13
to open...@googlegroups.com
补充一句,上述配置中^C,在vim中可以用ctrl+v ctrl+c输入。

agentzh

unread,
Mar 27, 2013, 1:47:20 AM3/27/13
to open...@googlegroups.com
Hello!

2013/3/26 thorny-road:
> 另外设置了log_escape_non_ascii off; 似乎并没有达到应有的效果,大家有遇到类似的问题吗?希望大家帮忙看看
>
[...]
> 访问:http://127.0.0.1/xxx?test=22222|33333|44444
>
> 结果打印出来是:22222\x0333333\x0344444
>
> 如果直接echo $test,打印出来是正常的,似乎patch没生效。
>

\x03 这个字符仍在 ASCII 范围之内(0 ~ 127),虽然它是不可打印字符。log_escape_non_ascii
从字面意义上可以看到仅是控制非 ASCII 字节的转义,比如 GB2312 或者 UTF-8 等多字节字符集中的那些最高位为 1
的字节的转义。

Best regards,
-agentzh

thorny-road

unread,
Mar 27, 2013, 2:49:00 AM3/27/13
to open...@googlegroups.com
明白了。还是有根深蒂固的思维惰性。这样的话,目前现有的设施,应该是无法避免'^C'这样的字符被转义的吧?“


--
--
邮件来自列表“openresty”,专用于技术讨论!
订阅: 请发空白邮件到 openresty...@googlegroups.com
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+...@googlegroups.com
归档: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
教程: http://openresty.org/download/agentzh-nginx-tutorials-zhcn.html


agentzh

unread,
Mar 27, 2013, 2:21:51 PM3/27/13
to open...@googlegroups.com
Hello!

2013/3/26 thorny-road:
> 明白了。还是有根深蒂固的思维惰性。这样的话,目前现有的设施,应该是无法避免'^C'这样的字符被转义的吧?“
>

或许你可以考虑直接在你的 Lua 代码中输出日志(比如通过 log_by_lua 或者 content_by_lua)。你可以利用
LuaJIT 的 FFI API 从 Lua 中直接调用 open 和 write 等相关的系统调用:

http://luajit.org/ext_ffi_tutorial.html

建议把你的 FFI 封装代码放在一个单独的 Lua 模块文件中,以避免反复加载。同时你也可以把日志文件的描述符缓冲在你的 Lua 模块的状态变量中,见

http://wiki.nginx.org/HttpLuaModule#Data_Sharing_within_an_Nginx_Worker

换言之,你相当于自己用 Lua 实现了一个 ngx_http_log_module :)

Best regards,
-agentzh

thorny-road

unread,
Mar 27, 2013, 8:45:01 PM3/27/13
to open...@googlegroups.com
多谢agenzh指点!

有了nginx lua,很多业务逻辑写起来顺手多了。感觉开发环境从单机转向多机互联后,有个问题一直没有统一的解决方案。也就是,如果所有网络服务的网络协议,都能遵循一套统一的DSL描述语言(类似protocol buffer和thrift那样),那么我们就可以针对这套dsl规范,自动生成各种语言(包括lua)的客户端,就能进一步减轻工作量。可惜现在很多网络服务,都倾向于自己提供类似java或c的client,协议并不透明,实为一大憾事。



Best regards,
-agentzh

--
--
邮件来自列表“openresty”,专用于技术讨论!
订阅: 请发空白邮件到 openresty...@googlegroups.com
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+...@googlegroups.com
归档: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
教程: http://openresty.org/download/agentzh-nginx-tutorials-zhcn.html


thorny-road

unread,
Mar 27, 2013, 8:51:31 PM3/27/13
to open...@googlegroups.com
另外,昨天有个问题一直没想明白,看了agentzh发的下面这个链接(大体看了下,还没细读),有点明白了:


昨天在想,如果利用nginx lua实现round robin的负载均衡?按照我的理解,nginx conf中的lua代码每次都会重新解析执行,就变成php那样成为一种无状态的服务。而round robin的调度,是需要跨进程知道上一次的调度状态的。

我搜了openresty邮件列表中相关关键字,发现也有不少人有类似的疑问,估计都是这个问题没想明白,看了上面那个链接,估计能改观不少。


在 2013年3月28日上午2:21,agentzh <age...@gmail.com>写道:

Best regards,
-agentzh

--
--
邮件来自列表“openresty”,专用于技术讨论!
订阅: 请发空白邮件到 openresty...@googlegroups.com
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+...@googlegroups.com
归档: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
教程: http://openresty.org/download/agentzh-nginx-tutorials-zhcn.html


330.gif

thorny-road

unread,
Mar 27, 2013, 8:54:22 PM3/27/13
to open...@googlegroups.com
刚才有个细节说的不对,”不是跨进程知道上一次的调度状态“,应该是”跨请求知道上一次的调度状态“
338.gif
330.gif

junwei shi

unread,
Mar 28, 2013, 2:18:17 AM3/28/13
to open...@googlegroups.com
我之前也尝试过,通过LuaJIT 的 FFI API 从 Lua 中直接调用 open 和 write 等相关的系统调用。
源码在: https://github.com/dcshi/lua-resty-Logger (供参考)

thorny-road

unread,
Mar 28, 2013, 2:38:34 AM3/28/13
to open...@googlegroups.com
感谢junwei shi的分享!

thorny-road

unread,
Apr 4, 2013, 8:04:28 AM4/4/13
to open...@googlegroups.com
Hi agentzh,

我在开发自己的nginx日志模块中遇到一个问题,难以解决,希望得到agentzh指点。模块大体流程见附件(附件中只是一个大体的原型,用于梳理模块流程,真正模块会采用单独io线程异步写磁盘)。描述如下:

http {
...
log_set /tmp/tmp.log info 1M;
...
    server {
        location /test1 {
            alog info "hello";
            access_by_lua '
                ngx.location.capture("/test2") 
             ';
             alog info "alog";
              ...
        }

        location /test2 {
              alog info "world";
              ...
        }
    }
}

原本期望输出:
hello
world
alog

但实际上只输出了:
hello
alog

location /test2 中的日志无法输出。

发现proxy_pass没有这种问题,因为proxy_pass又是一次完整的location请求,但这种内部跳转不知道怎么解决。请问agentzh和各位朋友,我怎么样才能感知到某次访问中,location之间的跳转关系呢?
ngx_http_alog_module.c

thorny-road

unread,
Apr 4, 2013, 9:05:26 AM4/4/13
to open...@googlegroups.com
补充一下,实际测试中,应该关掉alog缓存,上述conf中,alog_set语句应改为log_set /tmp/tmp.log info;

agentzh

unread,
Apr 4, 2013, 2:04:14 PM4/4/13
to openresty
Hello!

2013/4/4 thorny-road:
> 原本期望输出:
> hello
> world
> alog
>
> 但实际上只输出了:
> hello
> alog
>
> location /test2 中的日志无法输出。
>

你这里的 alog 指令注册的是 log phase handler?如果是的话,Nginx 子请求默认是不会运行 log phase
的,你需要启用 log_subrequest 指令:

http://wiki.nginx.org/HttpCoreModule#log_subrequest

> 发现proxy_pass没有这种问题,因为proxy_pass又是一次完整的location请求,但这种内部跳转不知道怎么解决。请问agentzh和各位朋友,我怎么样才能感知到某次访问中,location之间的跳转关系呢?
>

你这里有概念错误。ngx.location.capture 发起的是 Nginx 子请求,而不是“内部跳转”。二者的区别可以参见我的教程:

http://openresty.org/download/agentzh-nginx-tutorials-en.html#nginx-variables-variable-lifetime-and-internal-redirection

http://openresty.org/download/agentzh-nginx-tutorials-en.html#nginx-variables-a-detour-to-subrequests

Regards,
-agentzh

thorny-road

unread,
Apr 4, 2013, 7:55:20 PM4/4/13
to open...@googlegroups.com
多谢agentzh指点!等放完假回公司验证下。模块开发完毕后,一定分享给大家。



Regards,
-agentzh

--
--
邮件来自列表“openresty”,专用于技术讨论!

wgm.china

unread,
Apr 5, 2013, 9:21:18 AM4/5/13
to openresty
你开发的日志模块跟nginx自带的模块有什么不同,适用于什么场景?
 
2013-04-05

wgm.china

发件人:thorny-road
发送时间:2013-04-05 07:56
主题:Re: [openresty] 用Nginx记日志,开发中遇到的若干问题
收件人:"openresty"<open...@googlegroups.com>
抄送:
 

thorny-road

unread,
Apr 5, 2013, 8:31:08 PM4/5/13
to open...@googlegroups.com
附件中的模块只是一个demo,里面其实还有bug,只能作为参考。

最终版本的日志模块,跟nginx的log模块总体功能其实差别不大。但这个模块和nginx模块最大的不同,是利用专门的io线程异步写磁盘,主线程和io线程间通过阻塞队列通讯。这样nginx的主线程就不会阻塞在写磁盘上,响应时间会大大降低。等正式模块开发完毕,我会分享给大家。

thorny-road

unread,
Apr 9, 2013, 10:56:35 AM4/9/13
to open...@googlegroups.com
感谢大家前些日子的帮助,我的日志模块基本开发完毕。详细代码见:https://github.com/fantasy-fan/alog-nginx-module

模块的设计思路很明确,采用专门的日志线程写日志,Nginx Worker进程的主线程将日志写入内存缓冲区后返回。当缓冲区满后,主线程会将缓冲区中日志通过阻塞队列(Blocking Queue)交给日志线程,然后由日志线程写入磁盘。

开发完成后,经过了简单的测试,性能功能性都基本满足要求。意外的是,我发现自己写的日志模块性能,相比Nginx原生的日志模块并无明显的性能优势。并不是说本模块性能不好(最大响应时间有较大改善),而是发现Nginx原生的日志模块性能并不差。原先担心的写日志性能问题纯粹臆想。因为现在的磁盘顺序写速度已今非昔比,而且像Linux这样的系统会使用大量的内存作为写磁盘缓冲,因此像Nginx这样顺序追加写磁盘,速度并没有想象中糟糕。感觉自己的知识结构过于老旧,惭愧。


kindy

unread,
Apr 11, 2013, 2:01:13 AM4/11/13
to openresty
赞,探路也是很有意义的。


2013/4/9 thorny-road <luomoj...@gmail.com>



--
- - - - - - - - - - - -
林青(Kindy Lin)

linsu...@gmail.com

unread,
Sep 19, 2017, 8:08:00 AM9/19/17
to openresty
hi,我在项目中遇到一个日志打印错乱的问题。有两条访问日志,本该打两行的,但是打印到一行了,而且第二条有些字段丢失了

在 2013年3月26日星期二 UTC+8下午6:24:16,thorny-road写道:

Yichun Zhang (agentzh)

unread,
Sep 21, 2017, 10:43:50 PM9/21/17
to openresty
Hello!

2017-09-19 5:08 GMT-07:00 <linsu...@gmail.com>:
> hi,我在项目中遇到一个日志打印错乱的问题。有两条访问日志,本该打两行的,但是打印到一行了,而且第二条有些字段丢失了
>

你没用 NFS 这样的基于网络的文件系统吧?也没用 nginx 的 syslog 吧?现代 Linux 系统的 write()
文件追加是可以保证原子的,即使多个进程同时追加一个文件,也不会出现串行的情况。

Regards,
Yichun

Sean Wang

unread,
Jul 1, 2018, 1:27:27 PM7/1/18
to openresty
hello 我么这边在尝试用https://github.com/cloudflare/lua-resty-logger-socket的时候 
将日志写入到rsyslog,但是发现偶发性会出现两行日志并在一起了,请问这个有什么办法解决么?

在 2017年9月22日星期五 UTC+8上午10:43:50,agentzh写道:

samuel...@gmail.com

unread,
Jul 2, 2018, 7:47:18 AM7/2/18
to openresty
这个有比较数据吗

在 2013年4月9日星期二 UTC+8下午10:56:35,thorny-road写道:

Eric Chen

unread,
Jul 26, 2018, 10:48:32 AM7/26/18
to openresty
這情況有遇到,有一次用ab測試並發高請求時,用tcpdump錄封包,發現會有兩筆log在同一個udp封包裡面。


samuel...@gmail.com於 2018年7月2日星期一 UTC+8下午7時47分18秒寫道:

Sean Wang

unread,
Jul 26, 2018, 10:50:52 AM7/26/18
to openresty
hello 最后你们是是否解决的呢 我们TCP UDP都有出现

在 2018年7月26日星期四 UTC+8下午10:48:32,Eric Chen写道:

张辰浩

unread,
Jun 15, 2020, 10:57:17 PM6/15/20
to openresty
大家好,请教一个nginx日志权限的问题,nginx的worker进程是属于satest用户的,如下:
USER        PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root     107995  0.0  0.1 120792  2256 ?        Ss   01:06   0:00 nginx: master process nginx
satest   107996  0.0  0.1 121188  3556 ?        S    01:06   0:00  \_ nginx: worker process
satest   107997  0.0  0.1 121188  3332 ?        S    01:06   0:00  \_ nginx: worker process
access log 文件是属于foo用户的
-r--r--r-- 1 foo foo 4805 Jun 16 01:03 /var/log/nginx/access.log
问题是为何worker进程可以以写模式打开并写一个没有权限的文件呢?我甚至去掉了日志文件的所有写权限,看起来现象是写日志的操作具有root权限
[root@zch-test-149-10 nginx]# lsof /var/log/nginx/access.log
COMMAND    PID   USER   FD   TYPE DEVICE SIZE/OFF     NODE NAME
nginx   107995   root    5w   REG  253,0     5205 34747893 /var/log/nginx/access.log
nginx   107996 satest    5w   REG  253,0     5205 34747893 /var/log/nginx/access.log
nginx   107997 satest    5w   REG  253,0     5205 34747893 /var/log/nginx/access.log

[root@zch-test-149-10 nginx]# id satest
uid=1003(satest) gid=1003(satest) groups=1003(satest)
[root@zch-test-149-10 nginx]# id foo
uid=1004(foo) gid=1004(foo) groups=1004(foo)

还请不吝赐教 感谢!

Triple Z

unread,
Jun 16, 2020, 12:06:19 AM6/16/20
to open...@googlegroups.com, openresty
nginx 首先会通过 root 启动 master 进程。然后以读写模式打开 access.log/error.log ,之后才会用 master 进程 fork 出不同的 worker 进程,再对每个 worker 进程使用 setuid 切换用户。因此 worker 其实获得了 master 已经打开文件的 fd,自然能够写这些文件。



--
Sincerely,
TripleZ

----------------------------------------------------------------
Zhenzhen Zhao (TripleZ)
----------------------------------------------------------------
--
--
邮件来自列表“openresty”,专用于技术讨论!
订阅: 请发空白邮件到 openresty...@googlegroups.com
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+...@googlegroups.com
归档: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
教程: http://openresty.org/download/agentzh-nginx-tutorials-zhcn.html
---
您收到此邮件是因为您订阅了Google网上论坛上的“openresty”群组。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到openresty+...@googlegroups.com
要在网络上查看此讨论,请访问https://groups.google.com/d/msgid/openresty/c91f95ff-5935-4cea-a014-5fe6b1eb88bbo%40googlegroups.com

ch zhang

unread,
Jun 16, 2020, 9:02:01 AM6/16/20
to openresty
感谢回复!查了一些资料并做了一些实验与您说的一致,贴出验证过程供后来者参考:

先查看fork的man手册,有如下说明,worker进程确实与master进程共享日志文件的描述符:
       *  The child inherits copies of the parent's set of open file
          descriptors.  Each file descriptor in the child refers to the same
          open file description (see open(2)) as the corresponding file
          descriptor in the parent.  This means that the two file
          descriptors share open file status flags, file offset, and signal-
          driven I/O attributes (see the description of F_SETOWN and
          F_SETSIG in fcntl(2)).

用strace观察nginx的启动过程,可以看到ngin命令先创建master进程,再clone出了两个work进程,然后调用了setuid,open调用输出太多就没没打出来了
# strace -ff -e  trace=clone,setuid nginx
clone
(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f598c6eab50) = 90256
strace
: Process 90256 attached
[pid 90255] +++ exited with 0 +++
clone
(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f598c6eab50) = 90257
strace
: Process 90257 attached
[pid 90256] clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f598c6eab50) = 90258
strace
: Process 90258 attached
[pid 90257] setuid(1003)                = 0
[pid 90258] setuid(1003)                = 0



在 2020年6月16日星期二 UTC+8下午12:06:19,Triple Z写道:
订阅: 请发空白邮件到 open...@googlegroups.com
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 open...@googlegroups.com

归档: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
教程: http://openresty.org/download/agentzh-nginx-tutorials-zhcn.html
---
您收到此邮件是因为您订阅了Google网上论坛上的“openresty”群组。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到openresty+unsubscribe@googlegroups.com
要在网络上查看此讨论,请访问https://groups.google.com/d/msgid/openresty/c91f95ff-5935-4cea-a014-5fe6b1eb88bbo%40googlegroups.com

Zhenzhen Zhao

unread,
Jun 16, 2020, 9:34:54 AM6/16/20
to open...@googlegroups.com
哈哈,这个实验很详细了~ 当时我是看了看源码理解的,一模一样的问题~


--
Sincerely,
TripleZ

----------------------------------------------------------------
Zhenzhen Zhao (TripleZ)
----------------------------------------------------------------
订阅: 请发空白邮件到 openresty...@googlegroups.com
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+...@googlegroups.com

归档: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
教程: http://openresty.org/download/agentzh-nginx-tutorials-zhcn.html
---
您收到此邮件是因为您订阅了Google网上论坛上的“openresty”群组。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到openresty+...@googlegroups.com
要在网络上查看此讨论,请访问https://groups.google.com/d/msgid/openresty/d518d91c-7fa7-4908-9789-5153f92dda9co%40googlegroups.com
Reply all
Reply to author
Forward
0 new messages