正好我也碰到这个问题了,现在这台机器有两个worker正处在这个状态,其他worker还能正常服务,pstack每次运行输出都在变化,strace -p 运行若干秒后没有任何输出
[root@p72 ~]# pstack 23292
#0 0x00002b0bb38891a9 in lua_rawget () from /usr/local/openresty/luajit/lib/libluajit-5.1.so.2
#1 0x00000000004899c4 in ngx_http_lua_ngx_re_gmatch_iterator ()
#2 0x00002b0bb387da03 in lj_BC_FUNCC () from /usr/local/openresty/luajit/lib/libluajit-5.1.so.2
#3 0x000000000048e1ef in ngx_http_lua_run_thread ()
#4 0x000000000049080d in ngx_http_lua_content_by_chunk ()
#5 0x00000000004908e8 in ngx_http_lua_content_handler_inline ()
#6 0x0000000000490637 in ngx_http_lua_content_handler ()
#7 0x000000000043ca21 in ngx_http_core_content_phase ()
#8 0x0000000000437e63 in ngx_http_core_run_phases ()
#9 0x0000000000437f60 in ngx_http_handler ()
#10 0x000000000044176d in ngx_http_process_request ()
#11 0x0000000000441f90 in ngx_http_process_request_headers ()
#12 0x000000000042aa46 in ngx_event_process_posted ()
#13 0x000000000042a909 in ngx_process_events_and_timers ()
#14 0x00000000004306bd in ngx_worker_process_cycle ()
#15 0x000000000042ef27 in ngx_spawn_process ()
#16 0x000000000042fd9c in ngx_start_worker_processes ()
#17 0x000000000043120a in ngx_master_process_cycle ()
#18 0x0000000000415c7a in main ()
[root@p72 ~]# strace -p 23292
Process 23292 attached - interrupt to quit
Process 23292 detached
[root@p72 ~]# pstack 23290
#0 0x00002b0bb3882c3b in hashkey () from /usr/local/openresty/luajit/lib/libluajit-5.1.so.2
#1 0x00002b0bb3882ed0 in lj_tab_get () from /usr/local/openresty/luajit/lib/libluajit-5.1.so.2
#2 0x00002b0bb38891bb in lua_rawget () from /usr/local/openresty/luajit/lib/libluajit-5.1.so.2
#3 0x00000000004899c4 in ngx_http_lua_ngx_re_gmatch_iterator ()
#4 0x00002b0bb387da03 in lj_BC_FUNCC () from /usr/local/openresty/luajit/lib/libluajit-5.1.so.2
#5 0x000000000048e1ef in ngx_http_lua_run_thread ()
#6 0x000000000049080d in ngx_http_lua_content_by_chunk ()
#7 0x00000000004908e8 in ngx_http_lua_content_handler_inline ()
#8 0x0000000000490637 in ngx_http_lua_content_handler ()
#9 0x000000000043ca21 in ngx_http_core_content_phase ()
#10 0x0000000000437e63 in ngx_http_core_run_phases ()
#11 0x0000000000437f60 in ngx_http_handler ()
#12 0x000000000044176d in ngx_http_process_request ()
#13 0x0000000000441f90 in ngx_http_process_request_headers ()
#14 0x000000000042aa46 in ngx_event_process_posted ()
#15 0x000000000042a909 in ngx_process_events_and_timers ()
#16 0x00000000004306bd in ngx_worker_process_cycle ()
#17 0x000000000042ef27 in ngx_spawn_process ()
#18 0x000000000042fd9c in ngx_start_worker_processes ()
#19 0x000000000043120a in ngx_master_process_cycle ()
#20 0x0000000000415c7a in main ()
[root@p72 ~]# strace -p 23290
Process 23290 attached - interrupt to quit
Process 23290 detached
Lance
2012/9/28 agentzh
<age...@gmail.com>
Hello!
在 2012年9月27日星期四,陈伟 写道:
已经重启过了。。。 没机会了。。。。
依据您的经验, 可能会有哪些原因呢?
保留第一现场是最重要的。下次记得分别用 pstack 和 strace 获取用户态调用栈和系统调用的若干样本,否则信息严重不足,无法帮你诊断。
agentzh
On 9月28日, 上午10时16分, junwei shi <alohad...@gmail.com> wrote:
> 可以用strace -p pid看下究竟nginx在做什么
>
>
>
>
>
>
>
> On Friday, September 28, 2012 10:14:49 AM UTC+8, 陈伟 wrote:
>
> > 很奇怪的现象, nginx启动后开始没问题。 过一段时间(具体也不清楚多久),就会发现nginx进程占用cpu 达到100%, 但是ps 查看
> > 进程还在, 就是不能处理请求了。 而且一直保持这种状态, 除非kill掉旧的进程, 重启nginx才能恢复。这是怎么回事呢??