Welcome! Log In Create A New Profile

Advanced

Re: Worker processes not shutting down

Yichun Zhang (agentzh)
September 23, 2014 06:08PM
Hello!

On Fri, Sep 19, 2014 at 12:50 PM, igorhmm wrote:
> I don't known how to reproduce, not yet :-)
>
> I couldn't identify which worker was responding too, but I can see with
> strace warnings in the old wolker about EAGAIN (Resource temporarily
> unavailable). I can see that because old workers still running:
>

Nginx workers take forever to quit usually because of pending timers.

One suggestion is to dump out all the pending timers' handlers so that
we can know what parts of nginx are responsible for this. To be more
specific, you can traverse through the rbtree rooted at the C global
variable "ngx_event_timer_rbtree" and for each tree node, you obtain
the ngx_event_t object by doing the pointer arithmetic "((char *) cur
- offsetof(ngx_event_t, timer))", then check the function pointed to
by "ev->handler" [1]. All these checks can be done in a gdb script or
a systemtap script that is inspecting a typical nginx worker pending
shutting down.

[1] You can take this piece of C code from the ngx_lua module for such
an example: https://github.com/openresty/lua-nginx-module/blob/master/src/ngx_http_lua_timer.c#L465
But you need to rewrite it in gdb's python extension language or
systemtap's stap scripting language for online dynamic tracing.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Worker processes not shutting down

runesoerensen January 24, 2012 03:42PM

Re: Worker processes not shutting down

runesoerensen January 24, 2012 04:17PM

Re: Worker processes not shutting down

Maxim Dounin January 25, 2012 08:48AM

Re: Worker processes not shutting down

runesoerensen October 24, 2012 01:02AM

Re: Worker processes not shutting down

agentzh October 24, 2012 06:14PM

Re: Worker processes not shutting down

n1xman February 12, 2013 02:01AM

Re: Worker processes not shutting down

igorhmm September 19, 2014 10:13AM

Re: Worker processes not shutting down

B.R. September 19, 2014 10:58AM

Re: Worker processes not shutting down

igorhmm September 19, 2014 01:27PM

Re: Worker processes not shutting down

B.R. September 19, 2014 01:48PM

Re: Worker processes not shutting down

igorhmm September 19, 2014 03:50PM

Re: Worker processes not shutting down

B.R. September 19, 2014 04:32PM

Re: Worker processes not shutting down

oscaretu . September 20, 2014 04:18AM

Re: Worker processes not shutting down

dewanggaba September 20, 2014 04:20AM

Re: Worker processes not shutting down

igorhmm September 23, 2014 07:26AM

Re: Worker processes not shutting down

Yichun Zhang (agentzh) September 23, 2014 06:08PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 232
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready