Welcome! Log In Create A New Profile

Advanced

Forking Nginx process

February 18, 2015 10:38AM
Hi.
I'm writing simple module for Nginx just to fork process on request and
execute some separate process and then exit.

*if(fork() == 0)*
*{*
* // Use r request pointer*
*.*
*.*
*.*
* // creating out_chain (could be more than 700kb)*
* ngx_http_output_filter ( r , out_chain );*

* ngx_http_finalize_request(r, NGX_OK);*
*}*
*else*
*{*
* close(r->connection->fd); *

* ngx_http_finalize_request(r, NGX_OK);*
*}*

if I'm sending 1 request per time it works fine , but when I'm sending 2 or
more requests at the same time works only the last request , other requests
just staying in loading stage.

Who can help me figure out what is the problem ?

I'm just thinking it could be because ngx_request_t *r pointer is in nginx
shared memory so every request overriding another .... but maybe it's not
about that.

Please let me know if you can give any help.

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

Forking Nginx process

tigran.bayburtsyan 800 February 18, 2015 10:38AM



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

Online Users

Guests: 116
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready