<div dir="ltr">This is a snippet from something I was experimenting with. I can't recall it actually worked, but it might help for a start. Good Luck.<div><br><div><div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:Consolas,"Courier New",monospace;font-size:14px;line-height:19px;white-space:pre"><span style="color:rgb(78,201,176)">ngx_cycle_t</span> *cycle

</div></div><div><div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:Consolas,"Courier New",monospace;font-size:14px;line-height:19px;white-space:pre"><div><span style="color:rgb(197,134,192)">for</span> (i = <span style="color:rgb(181,206,168)">0</span>; i < cycle-><span style="color:rgb(156,220,254)">connection_n</span>; i++) {</div><div>        c = &conns[i];</div><div>        <span style="color:rgb(197,134,192)">if</span> (c-><span style="color:rgb(156,220,254)">fd</span> == (<span style="color:rgb(78,201,176)">ngx_socket_t</span>) -<span style="color:rgb(181,206,168)">1</span> || c-><span style="color:rgb(156,220,254)">idle</span> || c-><span style="color:rgb(156,220,254)">listening</span>) <span style="color:rgb(197,134,192)">continue</span>;</div><div>        hlc = (<span style="color:rgb(78,201,176)">ngx_http_log_ctx_t</span>*)c-><span style="color:rgb(156,220,254)">log</span>-><span style="color:rgb(156,220,254)">data</span>;</div><div>        <span style="color:rgb(197,134,192)">if</span>(!hlc) <span style="color:rgb(197,134,192)">continue</span>;</div><div>        r = hlc-><span style="color:rgb(156,220,254)">current_request</span>;</div><div>        <span style="color:rgb(220,220,170)">ngx_log_error</span>(NGX_LOG_ERR, c-><span style="color:rgb(156,220,254)">log</span>, <span style="color:rgb(181,206,168)">0</span>, <span style="color:rgb(206,145,120)">"has hlc"</span>);</div><div>        <span style="color:rgb(197,134,192)">if</span>(!r) <span style="color:rgb(197,134,192)">continue</span>;</div><div>        <span style="color:rgb(220,220,170)">ngx_log_error</span>(NGX_LOG_ERR, c-><span style="color:rgb(156,220,254)">log</span>, <span style="color:rgb(181,206,168)">0</span>, <span style="color:rgb(206,145,120)">"has req"</span>);</div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 16 Apr 2020 at 18:49, <a href="mailto:sachin.shetty@gmail.com">sachin.shetty@gmail.com</a> <<a href="mailto:nginx-forum@forum.nginx.org">nginx-forum@forum.nginx.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Thanks Mathew.<br>
<br>
I thought about it and even prototyped it with openresty, but I am concerned<br>
about ngx.shared.DICT.get_keys locking the whole dictionary and blocking<br>
connections that are trying to add new incoming connections. <br>
<br>
Is there some worker datastructure available that can be read and reported<br>
from? The worker obviously knows all the connections it is handling and the<br>
various states the connections are in. So it would be easy to iterate the<br>
internal data structure with an ngx.timer.every timer. <br>
<br>
Thanks<br>
Sachin<br>
<br>
Posted at Nginx Forum: <a href="https://forum.nginx.org/read.php?2,287673,287676#msg-287676" rel="noreferrer" target="_blank">https://forum.nginx.org/read.php?2,287673,287676#msg-287676</a><br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</blockquote></div>