<div dir="ltr">I'm developing a module that uses a handler module and header+body filter module<br>at my handler phase (registered in the nginx rewrite phase) i stop the request (return NGX_OK), then issue a subrequest to another server, get the result back (hook function), then continue to the header+body filter, change the headers + body and calls the next filters accordingly.<br>
also, the subrequest runs thru a proxy , here's the relevant conf lines:<br>----------------------------------<br>(general:)<br>keepalive_timeout 65;<br>gzip on;<br>proxy_http_version 1.1;<br>worker_connections 1024; <br>
<br> location / { // this location is where the ab tries to get (see below the ab test)<br> include <my module conf><br> proxy_pass <a href="http://server">http://server</a><br> }<br><br> location /def1 { // this is the subrequest uri<br>
proxy_buffers 8 128k;<br> proxy_buffer_size 128k;<br> proxy_busy_buffers_size 128k;<br><br> proxy_pass <a href="http://server2/page.php">http://server2/page.php</a> // another nginx runs fastcgi<br>
}<br>------------------------------------------<br><br>all works fine, untill i run an "ab" test against my nginx (10/12 workers) that runs on a multi-core, heavy duty linux server, and here's my ab line:<br>
ab -c 50 -n 20000 http://...myserver...<br>the actual rate is ~1000 requests per second, very high...<br><br>but almost exactly after 18500-18600 reuests (that ran smoothly without any errors, debug level INFO with printouts of my own) - the nginx hangs - not stuck - since i see in debug level "debug" its epoll loop runing ok, but not recv nor proceesing any other requests although they continue to come from my ab test<br>
<br> the stuck occurs right after the last (~18600) subrequest has been sent to the server (def1)<br><br>any suggestions please ?<br><br>thanks <br><br>Gad<br><br><br></div>