Sharing data when download the same object from upstream (take 2)

Alex Garzão alex.garzao at
Tue Sep 24 21:15:36 UTC 2013

Hello guys,

I have some doubts, and I will appreciate if someone help me :-)

I posted something about this some days ago [1].

Basically, in the node tree that keeps the objects in the cache, I
inserted a list that keeps all listeners [2] and a FD that points to
tempfile. In ngx_http_upstream.c, after the call to ngx_event_pipe(),
I try to send data to all listeners.

The list and FD are in shared memory, and all processs can use them.

When NGINX starts with 1 worker, my patch works well. But, when it
starts with more than 1 worker, I have some problems. In fact, if a
request is in process 1 (P1), and requests from other process (P2) are
added in the listeners list, P1 can iterate in this list, but it
cannot send data to requests from P2 :-/

If possible, I would like some suggestions about how can I address this issue.

Thanks for your attention.

[1] -
[2] - Listeners are requests that are waiting data from upstream
[3] - Request that connected to upstream

Alex Garzão
Projetista de Software
Azion Technologies
alex.garzao (at)

More information about the nginx-devel mailing list