Welcome! Log In Create A New Profile

Advanced

Nginx eats 100% cpu in ngx_event_pipe_write_to_downstream

Breno Silva
May 11, 2013 03:24PM
Hello list,

We are porting ModSecurity to NGINX. However we are seeing sometimes an
issue. Nginx eats 100% of cpu and when i use gdb i see:

gdb -p 8645

ngx_event_pipe_write_to_downstream (p=0x9bbc720, do_write=0) at
src/event/ngx_event_pipe.c:551

551 if (cl->buf->recycled) {
(gdb)

Looks like it is happening when we call ngx_http_modsecurity_body_filter()
then go to this conditions;

rc = move_chain_to_brigade(in, ctx->brigade, r->pool, 0);

if (rc != NGX_OK) {

r->buffered |= NGX_HTTP_SSI_BUFFERED;

return rc;

}

move_chainto_brigade is defined as:


ngx_int_t

move_chain_to_brigade(ngx_chain_t *chain, apr_bucket_brigade *bb,
ngx_pool_t *pool, ngx_int_t last_buf) {

apr_bucket *e;

ngx_chain_t *cl;


while (chain) {

e = ngx_buf_to_apr_bucket(chain->buf, bb->p, bb->bucket_alloc);

if (e == NULL) {

return NGX_ERROR;

}


APR_BRIGADE_INSERT_TAIL(bb, e);

if (chain->buf->last_buf) {

e = apr_bucket_eos_create(bb->bucket_alloc);

APR_BRIGADE_INSERT_TAIL(bb, e);

chain->buf->last_buf = 0;

return NGX_OK;

}

cl = chain;

chain = chain->next;

ngx_free_chain(pool, cl);

}


if (last_buf) {

e = apr_bucket_eos_create(bb->bucket_alloc);

APR_BRIGADE_INSERT_TAIL(bb, e);

return NGX_OK;

}

return NGX_AGAIN;

}
Let me know if you guys can help us understanding why sometimes we trigger
this issue
Thanks

Breno
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Nginx eats 100% cpu in ngx_event_pipe_write_to_downstream

Breno Silva 1424 May 11, 2013 03:24PM

Re: Nginx eats 100% cpu in ngx_event_pipe_write_to_downstream

Maxim Dounin 541 May 11, 2013 06:58PM

Re: Nginx eats 100% cpu in ngx_event_pipe_write_to_downstream

Breno Silva 520 May 11, 2013 07:12PM

Re: Nginx eats 100% cpu in ngx_event_pipe_write_to_downstream

Maxim Dounin 529 May 11, 2013 08:08PM

Re: Nginx eats 100% cpu in ngx_event_pipe_write_to_downstream

Breno Silva 472 May 12, 2013 10:10AM

Re: Nginx eats 100% cpu in ngx_event_pipe_write_to_downstream

Breno Silva 517 May 12, 2013 04:48PM

Re: Nginx eats 100% cpu in ngx_event_pipe_write_to_downstream

Maxim Dounin 535 May 13, 2013 03:02AM

Re: Nginx eats 100% cpu in ngx_event_pipe_write_to_downstream

Breno Silva 523 May 13, 2013 08:18AM

Re: Nginx eats 100% cpu in ngx_event_pipe_write_to_downstream

Maxim Dounin 659 May 13, 2013 09:06AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 158
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